Skip to main content
Version: v4

Operations API Commands

Added in: v4.3.0 (confirmed via release notes)

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=true as a parameter

Supported Operations

The following operations are available through the CLI. Operations that require complex nested parameters or object structures are not supported via CLI and must be executed through the HTTP API.

Complete Operations List

note

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).

OperationDescriptionCategoryAvailable Since
describe_tableDescribe table structure and metadataDatabasev4.3.0
describe_allDescribe all databases and tablesDatabasev4.3.0
describe_databaseDescribe database structureDatabasev4.3.0
create_databaseCreate a new databaseDatabasev4.3.0
drop_databaseDelete a databaseDatabasev4.3.0
create_tableCreate a new tableDatabasev4.3.0
drop_tableDelete a tableDatabasev4.3.0
create_attributeCreate a table attributeDatabasev4.3.0
drop_attributeDelete a table attributeDatabasev4.3.0
search_by_idSearch records by IDDatav4.3.0
search_by_valueSearch records by attribute valueDatav4.3.0
insertInsert new recordsDatav4.4.9
updateUpdate existing recordsDatav4.4.9
upsertInsert or update recordsDatav4.4.9
deleteDelete recordsDatav4.3.0
sqlExecute SQL queriesDatav4.3.0
csv_file_loadLoad data from CSV fileDatav4.3.0
csv_url_loadLoad data from CSV URLDatav4.3.0
list_usersList all usersSecurityv4.3.0
add_userCreate a new userSecurityv4.3.0
alter_userModify user propertiesSecurityv4.3.0
drop_userDelete a userSecurityv4.3.0
list_rolesList all rolesSecurityv4.3.0
drop_roleDelete a roleSecurityv4.3.0
create_csrCreate certificate signing requestSecurityv4.4.0
sign_certificateSign a certificateSecurityv4.4.0
list_certificatesList SSL/TLS certificatesSecurityv4.4.0
add_certificateAdd SSL/TLS certificateSecurityv4.4.0
remove_certificateRemove SSL/TLS certificateSecurityv4.4.0
add_ssh_keyAdd SSH keySecurityv4.4.0
get_ssh_keyGet SSH keySecurityv4.7.2
update_ssh_keyUpdate SSH keySecurityv4.4.0
delete_ssh_keyDelete SSH keySecurityv4.4.0
list_ssh_keysList all SSH keysSecurityv4.4.0
set_ssh_known_hostsSet SSH known hostsSecurityv4.4.0
get_ssh_known_hostsGet SSH known hostsSecurityv4.4.0
cluster_get_routesGet cluster routing informationClusteringv4.3.0
cluster_networkGet cluster network statusClusteringv4.3.0
cluster_statusGet cluster statusClusteringv4.3.0
remove_nodeRemove node from clusterClusteringv4.3.0
add_componentAdd a componentComponentsv4.3.0
deploy_componentDeploy a componentComponentsv4.3.0
deploy (alias)Alias for deploy_componentComponentsv4.3.0
package_componentPackage a componentComponentsv4.3.0
package (alias)Alias for package_componentComponentsv4.3.0
drop_componentRemove a componentComponentsv4.3.0
get_componentsList all componentsComponentsv4.3.0
get_component_fileGet component file contentsComponentsv4.3.0
set_component_fileSet component file contentsComponentsv4.3.0
install_node_modulesInstall Node.js dependenciesComponentsv4.3.0
set_configurationUpdate configuration settingsConfigurationv4.3.0
get_configurationGet current configurationConfigurationv4.3.0
create_authentication_tokensCreate authentication tokensAuthenticationv4.3.0
refresh_operation_tokenRefresh operation tokenAuthenticationv4.3.0
restart_serviceRestart Harper serviceSystemv4.3.0
restartRestart Harper instanceSystemv4.3.0
system_informationGet system informationSystemv4.3.0
registration_infoGet registration informationLicensingv4.3.0
get_fingerprintGet instance fingerprintLicensingv4.3.0
set_licenseSet license keyLicensingv4.3.0
get_usage_licensesGet usage and license infoLicensingv4.7.3
get_jobGet job statusJobsv4.3.0
search_jobs_by_start_dateSearch jobs by start dateJobsv4.3.0
read_logRead application logsLoggingv4.3.0
read_transaction_logRead transaction logsLoggingv4.3.0
read_audit_logRead audit logsLoggingv4.3.0
delete_transaction_logs_beforeDelete old transaction logsLoggingv4.3.0
purge_streamPurge streaming dataMaintenancev4.3.0
delete_records_beforeDelete old recordsMaintenancev4.3.0
get_statusGet custom status informationStatusv4.6.0
set_statusSet custom status informationStatusv4.6.0
clear_statusClear custom status informationStatusv4.6.0

Command Aliases

The following aliases are available for convenience:

  • deploydeploy_component
  • packagepackage_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
tip

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"]'
tip

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
tip

For comprehensive configuration options, see the Configuration Reference.

Component Operations

Deploy a component:

harper deploy_component project=my-cool-app package=https://github.com/HarperDB/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
tip

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
tip

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:

Parameter Formatting

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

Object parameters are not supported via CLI. For operations requiring complex nested objects, use:

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

Example Script:

#!/bin/bash

# Deploy component to remote cluster
export CLI_TARGET_USERNAME=HDB_ADMIN
export CLI_TARGET_PASSWORD=$SECURE_PASSWORD

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

The following operation types are not supported via CLI:

  • Operations requiring complex nested JSON structures
  • Operations with array-of-objects parameters
  • File upload operations
  • Streaming operations

For these operations, use the Operations API directly via HTTP.

See Also