SAP HANA CLI - Complete Command Reference
Source: https://github.com/SAP-samples/hana-developer-cli-tool-example Total Commands: 91
Table of Contents
- Database Object Commands
- Inspection Commands
- Connection Commands
- HDI Container Commands
- Query & Execution Commands
- Mass Operation Commands
- Cloud & BTP Commands
- User & Role Commands
- System Information Commands
- Development Commands
- Monitoring Commands
- Documentation Commands
Database Object Commands
tables
List tables in schema.
hana-cli tables [schema]Options:
| Option | Alias | Type | Default | Description |
|---|---|---|---|---|
| schema | s | string | CURRENT_SCHEMA | Target schema |
| limit | l | number | 200 | Max results |
UI Alternative: tablesUI
views
List views in schema.
hana-cli views [schema]procedures
List stored procedures.
hana-cli procedures [schema]functions / functionsUI
List database functions.
hana-cli functions [schema]indexes / indexesUI
List database indexes.
hana-cli indexes [schema] [table]sequences
List sequences.
hana-cli sequences [schema]synonyms
List synonyms.
hana-cli synonyms [schema]triggers
List database triggers.
hana-cli triggers [schema]schemas / schemasUI
List available schemas.
hana-cli schemasdataTypes / dataTypesUI
Display HANA data type specifications.
hana-cli dataTypesobjects
List all database objects.
hana-cli objects [schema]libraries
List database libraries.
hana-cli libraries [schema]Inspection Commands
inspectTable
Inspect table structure with format conversion.
Aliases: it, table, insTbl, inspecttable, inspectable
hana-cli inspectTable [schema] [table]Options:
| Option | Alias | Type | Default | Description |
|---|---|---|---|---|
| table | t | string | required | Table name |
| schema | s | string | CURRENT_SCHEMA | Schema name |
| output | o | string | tbl | Output format |
| useHanaTypes | hana | boolean | false | Use HANA types |
| useQuoted | q | boolean | false | Quoted identifiers |
| useExists | exists | boolean | true | Check existence |
Output Formats: tbl, sql, sqlite, postgres, cds, json, yaml, cdl, hdbcds, hdbtable, hdbmigrationtable, jsdoc, graphql, edmx, annos, edm, swgr, openapi
UI Alternative: inspectTableUI
inspectView
Inspect view definition.
hana-cli inspectView [schema] [view]inspectProcedure
Inspect stored procedure.
hana-cli inspectProcedure [schema] [procedure]inspectFunction
Inspect function definition.
hana-cli inspectFunction [schema] [function]inspectIndex
Inspect index structure.
hana-cli inspectIndex [schema] [index]inspectTrigger
Inspect trigger definition.
hana-cli inspectTrigger [schema] [trigger]inspectUser
Inspect database user.
hana-cli inspectUser [user]inspectLibrary
Inspect database library.
hana-cli inspectLibrary [schema] [library]inspectLibMember
Inspect library member.
hana-cli inspectLibMember [schema] [library] [member]inspectJWT
Inspect and decode JWT token.
hana-cli inspectJWT [token]Connection Commands
connect
Establish and save database connection.
Aliases: c, login
hana-cli connect [user] [password]Options:
| Option | Alias | Type | Default | Description |
|---|---|---|---|---|
| connection | n | string | - | host:port |
| user | u | string | - | Database user |
| password | p | string | - | Password (masked) |
| userstorekey | U | string | - | User store key |
| save | s | boolean | true | Save credentials |
| encrypt | e | boolean | - | Enable SSL |
| trustStore | t | string | - | SSL certificate path |
connectViaServiceKey
Connect using BTP service key.
hana-cli connectViaServiceKeystatus
Display current connection status.
hana-cli statuscertificates
List system certificates.
hana-cli certificatesHDI Container Commands
activateHDI
Enable HDI service for tenant.
hana-cli activateHDI [tenant]adminHDI
Create/assign HDI admin privileges.
hana-cli adminHDI [user]adminHDIGroup
Add HDI group administrator.
hana-cli adminHDIGroup [group] [user]containers
List HDI containers.
Aliases: cont, listContainers
hana-cli containers [containerGroup] [container]Options:
| Option | Alias | Type | Default | Description |
|---|---|---|---|---|
| container | c | string | * | Container filter |
| containerGroup | g | string | * | Group filter |
| limit | l | number | 200 | Max results |
UI Alternative: containersUI
createContainer
Create new HDI container.
hana-cli createContainer [container] [group]createContainerUsers
Create container access users.
hana-cli createContainerUsers [container]dropContainer
Remove HDI container.
hana-cli dropContainer [container]createGroup
Create container group.
hana-cli createGroup [group]dropGroup
Remove container group.
hana-cli dropGroup [group]Query & Execution Commands
querySimple
Execute SQL query with flexible output.
Aliases: qs, querysimple
hana-cli querySimple [query]Options:
| Option | Alias | Type | Default | Description |
|---|---|---|---|---|
| query | q | string | required | SQL query |
| folder | f | string | ./ | Output directory |
| filename | n | string | - | Output filename |
| output | o | string | table | Output format |
| profile | p | string | - | Connection profile |
Output Formats: table, json, excel, csv
UI Alternative: querySimpleUI
callProcedure
Execute stored procedure.
Aliases: cp, callprocedure, callProc, callSP
hana-cli callProcedure [schema] [procedure]Options:
| Option | Alias | Type | Default | Description |
|---|---|---|---|---|
| procedure | p | string | required | Procedure name |
| schema | s | string | CURRENT_SCHEMA | Schema name |
hdbsql
Direct SQL execution interface.
hana-cli hdbsqlMass Operation Commands
massConvert
Batch convert database objects.
Aliases: mc, massconvert, massConv
hana-cli massConvert [schema] [table] [view]UI Alternative: massConvertUI
massRename
Batch rename operations.
hana-cli massRename [schema]massUsers
Bulk user operations.
hana-cli massUsersCloud & BTP Commands
btp
Configure BTP CLI targeting.
hana-cli btpbtpInfo
Display BTP target details.
hana-cli btpInfobtpSubs
List BTP subscriptions.
hana-cli btpSubshanaCloudInstances
List HANA Cloud instances.
hana-cli hanaCloudInstanceshanaCloudHDIInstances / hanaCloudHDIInstancesUI
List Cloud HDI instances.
hana-cli hanaCloudHDIInstanceshanaCloudSchemaInstances / hanaCloudSchemaInstancesUI
List Cloud schema instances.
hana-cli hanaCloudSchemaInstanceshanaCloudSBSSInstances / hanaCloudSBSSInstancesUI
List Cloud SBSS instances.
hana-cli hanaCloudSBSSInstanceshanaCloudSecureStoreInstances / hanaCloudSecureStoreInstancesUI
List Cloud secure store instances.
hana-cli hanaCloudSecureStoreInstanceshanaCloudUPSInstances / hanaCloudUPSInstancesUI
List Cloud UPS instances.
hana-cli hanaCloudUPSInstanceshanaCloudStart
Start HANA Cloud instance.
hana-cli hanaCloudStart [instance]hanaCloudStop
Stop HANA Cloud instance.
hana-cli hanaCloudStop [instance]User & Role Commands
users
List database users.
hana-cli usersroles
List database roles.
hana-cli rolescreateXSAAdmin
Create XSA administrator.
hana-cli createXSAAdmin [user]createJWT
Generate JWT token.
hana-cli createJWTSystem Information Commands
systemInfo / systemInfoUI
Display system information.
hana-cli systemInfohostInformation
Display host details.
hana-cli hostInformationversion
Display hana-cli version.
hana-cli versionports
List database ports.
hana-cli portsdisks
Display disk information.
hana-cli disksdataVolumes
Display data volume information.
hana-cli dataVolumesiniFiles
List INI configuration files.
hana-cli iniFilesiniContents
Display INI file contents.
hana-cli iniContents [file]Development Commands
cds
Convert database objects to CDS format.
hana-cli cds [schema] [object]createModule
Create development module.
hana-cli createModulecopy2DefaultEnv
Copy credentials to default-env.json.
hana-cli copy2DefaultEnvcopy2Env
Copy credentials to .env file.
hana-cli copy2Envcopy2Secrets
Copy credentials to secrets.
hana-cli copy2SecretsopenDBExplorer
Open HANA Database Explorer.
hana-cli openDBExploreropenBAS
Open Business Application Studio.
hana-cli openBASMonitoring Commands
features / featuresUI
Display database features.
hana-cli featuresfeatureUsage / featureUsageUI
Display feature usage metrics.
hana-cli featureUsagetraces
List trace files.
hana-cli tracestraceContents
Display trace contents.
hana-cli traceContents [trace]privilegeError
Diagnose privilege errors.
hana-cli privilegeErrorreclaim
Reclaim database resources.
hana-cli reclaimDocumentation Commands
changeLog / changeLogUI / openChangeLog
View release changelog.
hana-cli changeLog
hana-cli openChangeLog # Opens in browserreadMe / readMeUI / openReadMe
View documentation.
hana-cli readMe
hana-cli openReadMe # Opens in browserissue
Report issue to GitHub.
hana-cli issueUI
Open general web UI.
hana-cli UIGlobal Options
All commands support:
| Option | Alias | Description |
|---|---|---|
| --help | -h | Display help |
| --admin | - | Use admin credentials |
| --conn | - | Specify connection file |
| --profile | -p | Connection profile |
*Reference: https://github.com/SAP-samples/hana-developer-cli-tool-example*