Operations API Commands
The Harper CLI supports executing operations from the Operations API directly from the command line. This enables powerful automation and scripting capabilities.
General Syntax
harper <operation> <parameter>=<value>
Output Format:
- Default: YAML
- JSON: Pass
json=trueas a parameter
Supported Operations
The following operations are available through the CLI. Argument values are JSON-parsed, so operations that take nested objects or arrays of objects work from the CLI as well. See Parameter Formatting for how to quote them.
Complete Operations List
This is just a brief overview of all operations available as CLI commands. Review the respective operation documentation for more information on available arguments and expected behavior. Keep in mind that all operations options are converted to CLI arguments in the same way (using snake_case).
| Operation | Description | Category | Available Since |
|---|---|---|---|
describe_table | Describe table structure and metadata | Database | v4.3.0 |
describe_all | Describe all databases and tables | Database | v4.3.0 |
describe_database | Describe database structure | Database | v4.3.0 |
create_database | Create a new database | Database | v4.3.0 |
drop_database | Delete a database | Database | v4.3.0 |
create_table | Create a new table | Database | v4.3.0 |
drop_table | Delete a table | Database | v4.3.0 |
create_attribute | Create a table attribute | Database | v4.3.0 |
drop_attribute | Delete a table attribute | Database | v4.3.0 |
search_by_id | Search records by ID | Data | v4.3.0 |
search_by_value | Search records by attribute value | Data | v4.3.0 |
insert | Insert new records | Data | v4.4.9 |
update | Update existing records | Data | v4.4.9 |
upsert | Insert or update records | Data | v4.4.9 |
delete | Delete records | Data | v4.3.0 |
sql | Execute SQL queries | Data | v4.3.0 |
csv_file_load | Load data from CSV file | Data | v4.3.0 |
csv_url_load | Load data from CSV URL | Data | v4.3.0 |
list_users | List all users | Users & Roles | v4.3.0 |
add_user | Create a new user | Users & Roles | v4.3.0 |
alter_user | Modify user properties | Users & Roles | v4.3.0 |
drop_user | Delete a user | Users & Roles | v4.3.0 |
list_roles | List all roles | Users & Roles | v4.3.0 |
drop_role | Delete a role | Users & Roles | v4.3.0 |
create_csr | Create certificate signing request | Security | v4.4.0 |
sign_certificate | Sign a certificate | Security | v4.4.0 |
list_certificates | List SSL/TLS certificates | Security | v4.4.0 |
add_certificate | Add SSL/TLS certificate | Security | v4.4.0 |
remove_certificate | Remove SSL/TLS certificate | Security | v4.4.0 |
add_ssh_key | Add SSH key | Components | v4.4.0 |
get_ssh_key | Get SSH key | Components | v4.7.2 |
update_ssh_key | Update SSH key | Components | v4.4.0 |
delete_ssh_key | Delete SSH key | Components | v4.4.0 |
list_ssh_keys | List all SSH keys | Components | v4.4.0 |
set_ssh_known_hosts | Set SSH known hosts | Components | v4.4.0 |
get_ssh_known_hosts | Get SSH known hosts | Components | v4.4.0 |
cluster_get_routes | Get cluster routing information | Clustering | v4.3.0 |
cluster_network | Get cluster network status | Clustering | v4.3.0 |
cluster_status | Get cluster status | Clustering | v4.3.0 |
remove_node | Remove node from cluster | Clustering | v4.3.0 |
add_component | Add a component | Components | v4.3.0 |
deploy_component | Deploy a component | Components | v4.3.0 |
deploy (alias) | Alias for deploy_component | Components | v4.3.0 |
package_component | Package a component | Components | v4.3.0 |
package (alias) | Alias for package_component | Components | v4.3.0 |
drop_component | Remove a component | Components | v4.3.0 |
get_components | List all components | Components | v4.3.0 |
get_component_file | Get component file contents | Components | v4.3.0 |
set_component_file | Set component file contents | Components | v4.3.0 |
install_node_modules | Install Node.js dependencies | Components | v4.3.0 |
set_configuration | Update configuration settings | Configuration | v4.3.0 |
get_configuration | Get current configuration | Configuration | v4.3.0 |
create_authentication_tokens | Create authentication tokens | Authentication | v4.3.0 |
refresh_operation_token | Refresh operation token | Authentication | v4.3.0 |
restart_service | Restart Harper service | System | v4.3.0 |
restart | Restart Harper instance | System | v4.3.0 |
system_information | Get system information | System | v4.3.0 |
registration_info | Get registration information | Licensing | v4.3.0 |
get_fingerprint | Get instance fingerprint | Licensing | v4.3.0 |
set_license | Set license key | Licensing | v4.3.0 |
get_usage_licenses | Get usage and license info | Licensing | v4.7.3 |
create_backup | Create a managed database backup | Backups | v5.2.0 |
list_backups | List managed backups | Backups | v5.2.0 |
verify_backup | Verify a managed backup's integrity | Backups | v5.2.0 |
delete_backup | Delete a managed backup | Backups | v5.2.0 |
purge_backups | Delete all but the newest backups | Backups | v5.2.0 |
restore_backup | Restore a database from a backup | Backups | v5.2.0 |
get_backup | Download a full database snapshot | Backups | v5.2.0 |
get_job | Get job status | Jobs | v4.3.0 |
search_jobs_by_start_date | Search jobs by start date | Jobs | v4.3.0 |
read_log | Read application logs | Logging | v4.3.0 |
read_transaction_log | Read transaction logs | Logging | v4.3.0 |
read_audit_log | Read audit logs | Logging | v4.3.0 |
delete_transaction_logs_before | Delete old transaction logs | Logging | v4.3.0 |
purge_stream | Purge streaming data | Maintenance | v4.3.0 |
delete_records_before | Delete old records | Maintenance | v4.3.0 |
get_status | Get custom status information | Status | v4.6.0 |
set_status | Set custom status information | Status | v4.6.0 |
clear_status | Clear custom status information | Status | v4.6.0 |
Command Aliases
The following aliases are available for convenience:
deploy→deploy_componentpackage→package_component
For detailed parameter information for each operation, see the Operations API documentation.
Command Examples
Database Operations
Describe a database:
harper describe_database database=dev
Describe a table (with YAML output):
harper describe_table database=dev table=dog
Example Output:
schema: dev
name: dog
hash_attribute: id
audit: true
schema_defined: false
attributes:
- attribute: id
is_primary_key: true
- attribute: name
indexed: true
clustering_stream_name: 3307bb542e0081253klnfd3f1cf551b
record_count: 10
last_updated_record: 1724483231970.9949
For detailed information on database and table structures, see the Database Reference.
Data Operations
Search by ID (with JSON output):
harper search_by_id database=dev table=dog ids='["1"]' get_attributes='["*"]' json=true
Search by value:
harper search_by_value table=dog search_attribute=name search_value=harper get_attributes='["id", "name"]'
For more information on querying data, see the REST Reference and GraphQL Querying.
Configuration Operations
Set configuration:
harper set_configuration logging_level=error
Get configuration:
harper get_configuration
For comprehensive configuration options, see the Configuration Reference.
Component Operations
Deploy a component:
harper deploy_component project=my-cool-app package=https://github.com/HarperFast/application-template
Get all components:
harper get_components
Note: deploy is an alias for deploy_component:
harper deploy project=my-app package=https://github.com/user/repo
For more information on components and applications, see the Components Reference.
User and Role Operations
List users:
harper list_users
List roles:
harper list_roles
For detailed information on users, roles, and authentication, see the Security Reference.
Remote Operations
All CLI operations can be executed on remote Harper instances. See CLI Overview - Remote Operations for details on authentication and remote execution.
Remote Component Deployment
When using remote operations, you can deploy a local component or application to the remote instance.
Deploy current directory:
If you omit the package parameter, the current directory will be packaged and deployed:
harper deploy target=https://server.com:9925
Note: deploy is an alias for deploy_component.
Deploy to clustered environment:
For clustered environments, use the replicated=true parameter to ensure the deployment is replicated to all nodes:
harper deploy target=https://server.com:9925 replicated=true
Restart after deployment (with replication):
After deploying to a clustered environment, restart all nodes to apply changes:
harper restart target=https://server.com:9925 replicated=true
For more information on Harper applications and components, see:
- Components - Application architecture and structure
- Deploying Harper Applications - Step-by-step deployment guide
Parameter Formatting
Every argument is split on the first = and the value is parsed as JSON. If the value is not valid JSON, it is passed through unchanged as a string. That single rule covers all of the parameter types below: database=dev fails to parse and stays the string "dev", json=true parses to the boolean true, and ids='["1","2"]' parses to an array.
The one exception is ref (used by deploy-by-reference), which is always taken as a raw string so that a numeric-looking git tag such as ref=1.0 is not rewritten into the number 1.
String Parameters
Simple string values can be passed directly:
harper describe_table database=dev table=dog
Array Parameters
Array parameters must be quoted and formatted as JSON:
harper search_by_id database=dev table=dog ids='["1","2","3"]'
Object Parameters
Objects and arrays of objects are supported. Pass them as single-quoted JSON:
harper deploy_component project=my-app package=npm:@my-org/my-app@1.2.3 \
credentials='[{"registry":"registry.my-org.com","secret":"deploy.my-app.registry.my-org.com"}]'
harper deploy setup=true prints exactly this credentials='[...]' form as the command to run after it seals a registry or git token, so an array-of-objects argument is the normal path for private-package deploys rather than an edge case.
Quoting rules:
- Wrap the JSON in single quotes. Double quotes let the shell expand
$, backticks, and history references inside the value; single quotes pass the JSON through intact. - The whole
key=valuepair is one shell argument, so no unescaped spaces outside the quotes. Compact JSON with no spaces after:and,avoids the problem entirely. - To embed a literal single quote inside the JSON, end the quoted run, escape it, and reopen:
'{"name":"O'\''Brien"}'.
Command-line arguments are not private. Anything you type appears in shell history, in process listings (ps), and in CI job logs. Prefer a stored secret reference (the secret field above) or an environment variable over inlining a plaintext token in an argument.
Boolean Parameters
Boolean values can be passed as strings:
harper get_configuration json=true
harper deploy target=https://server.com:9925 replicated=true
Output Formatting
YAML (Default)
By default, CLI operation results are formatted as YAML for readability:
harper describe_table database=dev table=dog
JSON
Pass json=true to get JSON output (useful for scripting):
harper describe_table database=dev table=dog json=true
Scripting and Automation
The Operations API commands through the CLI are ideal for:
- Build and deployment scripts
- Automation workflows
- CI/CD pipelines
- Administrative tasks
- Monitoring and health checks
Check status:
# Log in to the cluster
harper login https://cluster-node-1.example.com:9925
# Provide your cluster's username and password when prompted.
# Deploy component to remote cluster
harper deploy \
target=https://cluster-node-1.example.com:9925 \
replicated=true \
package=https://github.com/myorg/my-component
# Restart the cluster
harper restart \
target=https://cluster-node-1.example.com:9925 \
replicated=true
# Check status
harper get_components \
target=https://cluster-node-1.example.com:9925 \
json=true
Limitations
Nested objects and arrays of objects are not a limitation; see Object Parameters. The real constraints are about what an argument value can carry:
- Raw binary bodies. An argument value is text, so an operation whose request body is raw binary has no general CLI form. The two that need one have dedicated handling:
deploy_componentpackages and uploads the current directory whenpackageis omitted, andget_backupstreams the snapshot to a file. Any other binary payload has to go over HTTP. - Large payloads. There is no way to feed an argument value from stdin or a file, and the operating system caps total argument length. Bulk data such as an inline
csv_data_loadis better sent over HTTP. - Secrets on the command line. Arguments are visible in shell history,
psoutput, and CI logs. Use a stored secret reference or an environment variable instead of an inline token.
For these cases, use the Operations API directly via HTTP.
See Also
- CLI Overview - General CLI information
- CLI Commands - Core CLI commands
- Operations API Overview - Operations API documentation
- Operations API Reference - Complete operations list
- CLI Authentication - Authentication details