All skills
secondsky avatar

/sap-hana-cli

@620a19a
by Eddiesecondsky/sap-skills456 stars
120

Assists with SAP HANA Developer CLI (hana-cli) for database development and administration. Use when: installing hana-cli, connecting to SAP HANA databases, inspecting database objects (tables, views, procedures, functions), managing HDI containers, executing SQL queries, converting metadata to CDS/EDMX/OpenAPI formats, managing SAP HANA Cloud instances, working with BTP CLI integration, or troubleshooting hana-cli commands. Covers: 91 commands, 17+ output formats, HDI container management, cloud operations.

Use this Skill: https://skilld.dev/gh/secondsky/sap-skills/sap-hana-cli

This session only. Nothing lands on disk.

referencescloud-operations.md

≈1.4k tokens on demand. Your agent reads this file only when SKILL.md points to it.

SAP HANA CLI - Cloud & BTP Operations

Source: https://github.com/SAP-samples/hana-developer-cli-tool-example

Commands for managing SAP HANA Cloud instances and SAP BTP integration.


BTP CLI Integration

The hana-cli integrates with SAP BTP CLI for cloud resource management.

Configure BTP Target

# Configure BTP CLI targeting
hana-cli btp

This sets up the connection to your BTP global account.

View BTP Information

# Display current BTP target
hana-cli btpInfo

List BTP Subscriptions

# List subscribed services
hana-cli btpSubs

HANA Cloud Instance Management

List All HANA Cloud Instances

hana-cli hanaCloudInstances

Start HANA Cloud Instance

# Start a stopped instance
hana-cli hanaCloudStart [instance]

Use Cases:

  • Resume development after break
  • Scheduled startup
  • Cost management (stop during off-hours)

Stop HANA Cloud Instance

# Stop running instance
hana-cli hanaCloudStop [instance]

Note: Stopping instances helps reduce costs. Trial instances auto-stop after inactivity.


Cloud Instance Types

HDI Instances

# List Cloud HDI instances
hana-cli hanaCloudHDIInstances

# UI version
hana-cli hanaCloudHDIInstancesUI

Schema Instances

# List Cloud schema instances
hana-cli hanaCloudSchemaInstances

# UI version
hana-cli hanaCloudSchemaInstancesUI

SBSS Instances

Service Broker Secure Store instances.

# List Cloud SBSS instances
hana-cli hanaCloudSBSSInstances

# UI version
hana-cli hanaCloudSBSSInstancesUI

Secure Store Instances

# List Cloud secure store instances
hana-cli hanaCloudSecureStoreInstances

# UI version
hana-cli hanaCloudSecureStoreInstancesUI

UPS Instances

User-Provided Service instances.

# List Cloud UPS instances
hana-cli hanaCloudUPSInstances

# UI version
hana-cli hanaCloudUPSInstancesUI

Cloud Connection

Using Service Keys

Connect to HANA Cloud using service keys:

# Interactive service key connection
hana-cli connectViaServiceKey

Cloud Connection File

{
  "VCAP_SERVICES": {
    "hana": [{
      "name": "hana-cloud",
      "credentials": {
        "host": "xxxxxxxx.hana.trial-eu10.hanacloud.ondemand.com",
        "port": "443",
        "user": "DBADMIN",
        "password": "SecurePass123!",
        "encrypt": true,
        "sslValidateCertificate": true
      }
    }]
  }
}

SSL Requirements

HANA Cloud requires SSL:

hana-cli connect \
  -n "instance.hanacloud.ondemand.com:443" \
  -u DBADMIN \
  --encrypt true

Cloud Shell Compatibility

The hana-cli works in cloud-based development environments:

SAP Business Application Studio

# Open BAS in browser
hana-cli openBAS

Google Cloud Shell

Full compatibility with GCP Cloud Shell.

AWS Cloud9

Full compatibility with AWS Cloud9.

Video Demo

Cloud shell usage: https://youtu.be/L7QyVLvAIIQ


Cloud Workflows

Development Instance Setup

  1. Create instance in SAP BTP Cockpit

  2. Generate service key

  3. Connect via hana-cli:

    hana-cli connectViaServiceKey
  4. Verify connection:

    hana-cli status
    hana-cli systemInfo

Cost Optimization

  1. Check instance status:

    hana-cli hanaCloudInstances
  2. Stop when not needed:

    hana-cli hanaCloudStop myinstance
  3. Start when needed:

    hana-cli hanaCloudStart myinstance

HDI Container in Cloud

  1. List cloud HDI instances:

    hana-cli hanaCloudHDIInstances
  2. Create container:

    hana-cli createContainer MY_APP
  3. Create users:

    hana-cli createContainerUsers MY_APP

CDS Bind for Cloud

Use CDS binding for secure cloud credentials:

Setup

# In your CAP project directory
cds bind --to hana --for hybrid

.cdsrc-private.json

{
  "requires": {
    "db": {
      "kind": "hana",
      "binding": {
        "type": "cf",
        "apiEndpoint": "https://api.cf.eu10.hana.ondemand.com",
        "org": "my-org",
        "space": "dev",
        "instance": "hana-hdi"
      }
    }
  }
}

Benefits

  • No local credential storage
  • Dynamic credential lookup
  • Works with rotated credentials
  • Most secure option

Tradeoff

Each command execution includes credential lookup, adding slight latency.


Troubleshooting Cloud Connections

Instance Not Responding

# Check if stopped
hana-cli hanaCloudInstances

# Start if needed
hana-cli hanaCloudStart myinstance

SSL Certificate Issues

# Ensure encryption enabled
hana-cli connect --encrypt true

# Custom trust store if needed
hana-cli connect --trustStore /path/to/DigiCertGlobalRootCA.crt

BTP Target Issues

# Reconfigure BTP
hana-cli btp

# Verify target
hana-cli btpInfo

Cloud Resources


*Reference: https://github.com/SAP-samples/hana-developer-cli-tool-example*

Source: SKILL.md on GitHub

1 warning16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides comprehensive documentation and MCP integration for the SAP HANA Developer CLI. It follow security best practices for credential management by advising the use of environment variables and gitignore for configuration files. All external downloads and package installations refer to official SAP tools and standard development utilities.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer6mo

    4/17 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 620a19a. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated 2 months ago
Other metadata
metadata
{
  "maintainer": "Eduard Jiglau",
  "maintainer_email": "hello@sap-ai-skills.com",
  "website": "https://sap-ai-skills.com",
  "version": "2.4.1",
  "last_verified": "2025-11-26"
}

README badge

README badge for secondsky/sap-skills/sap-hana-cli