Sap Hana Cli logo

Sap Hana Cli

Community
secondsky
sap-hana-cli

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.

Overview

Publishersecondsky
Repositorysap-skills
Skill namesap-hana-cli
Stars
445
Forks
117
Bundled files
15
LicenseGPL-3.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 15 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by secondsky on GitHub. Read the source before you install it.

Installation

Install the Sap Hana Cli AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/secondsky/sap-skills.git /tmp/sap-skills
mkdir -p .claude/skills
cp -r /tmp/sap-skills/plugins/sap-hana-cli/skills/sap-hana-cli .claude/skills/sap-hana-cli
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Sap Hana Cli in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Sap Hana Cli on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Sap Hana Cli is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

SAP HANA Developer CLI (hana-cli)

Related Skills

  • sap-cap-capire: Use for CAP database development, HDI container management, and CDS syntax comparison
  • sap-btp-cloud-platform: Use for HANA Cloud operations, BTP integration, and cloud instance management
  • sap-abap-cds: Use for comparing CDS syntax between CAP and ABAP or understanding HANA CDS features
  • sap-datasphere: Use when working with SAP Datasphere integration or data warehousing scenarios
  • sap-dependency-security: Use for secure dependency upgrades, exact MCP server pins, npm package hardening, lockfile linting, and cooldown policy when projects include hana-cli dependencies

A developer-centric command-line interface for SAP HANA database development, particularly useful in non-SAP tooling environments like VS Code.

Repository: https://github.com/SAP-samples/hana-developer-cli-tool-example npm Package: https://www.npmjs.com/package/hana-cli Current Version: 3.202405.1 (April 2024) Node.js Requirement: ≥20.19.0


Table of Contents

Quick Start

Installation

bash
# Install globally via npm (recommended)
npm install -g hana-cli

# Verify installation
hana-cli version

First Connection

bash
# Interactive connection setup
hana-cli connect

# Or specify connection directly
hana-cli connect -n "hostname:port" -u DBUSER -p PASSWORD --save

# Using service key (HANA Cloud)
hana-cli connectViaServiceKey

MCP Integration (AI-Driven Database Operations)

Overview

The hana-mcp-server integration enables natural language database operations through Claude's Model Context Protocol. Use conversational queries alongside traditional CLI commands for a complete development workflow.

Setup

The bundled MCP config pins hana-mcp-server@0.3.4. Use sap-dependency-security before changing this pin because the server receives HANA tenant connection environment variables.

1. Environment Variables

Required configuration (add to ~/.zshrc, ~/.bashrc, or project .env):

bash
export HANA_HOST="your-hana-host.hanacloud.ondemand.com"
export HANA_PORT="443"
export HANA_USER="DBADMIN"
export HANA_PASSWORD="your-password"
export HANA_ENCRYPT="true"  # Optional, defaults to true
export HANA_DATABASE=""     # Optional, for MDC tenant
export HANA_CONNECTION_TYPE="single-container"  # Optional
2. Connection Types
  • single-container (default): Standard HANA databases
  • mdc-system: Multi-tenant system database
  • mdc-tenant: Specific tenant in multi-tenant environment

When to Use: CLI vs MCP

ScenarioRecommended ToolWhy
Exploratory queries, ad-hoc analysisMCPNatural language, no syntax needed
Automation scripts, CI/CD pipelinesCLIScriptable, consistent output
Learning database structureMCPConversational discovery
Generating CDS/EDMX/OpenAPI outputCLISupports 17+ formats
Complex multi-step workflowsCLIFine-grained control
Quick data sampling and inspectionMCPFaster for one-off queries

Example Natural Language Queries

Schema & Table Discovery
  • "Show me all schemas in this HANA database"
  • "List all tables in the SYSTEM schema"
  • "What tables exist in the MY_APP schema?"
  • "Show me all views in the PUBLIC schema"
Table Structure & Metadata
  • "Describe the structure of the USERS table"
  • "What columns does the ORDERS table have?"
  • "Show me the data types for MY_TABLE"
  • "What is the primary key of the CUSTOMERS table?"
Data Sampling & Inspection
  • "Sample 5 rows from the PRODUCTS table"
  • "Show me the first 10 records from SALES_DATA"
  • "Get sample data from ORDER_ITEMS table"
  • "Display a few rows from MY_TABLE"
Query Execution
  • "How many rows are in the CUSTOMERS table?"
  • "Show me distinct values in the STATUS column of ORDERS"
  • "What is the maximum value in the PRICE column of PRODUCTS?"
  • "Find all records in USERS where country is 'USA'"
System Performance & Monitoring
  • "Check the HANA database status"
  • "Show me system performance metrics"
  • "What is the current database version?"

MCP Tools Available

The hana-mcp-server provides these MCP tools:

  • list_schemas: Enumerate all schemas
  • list_tables: Show tables in a schema
  • describe_table: Get table structure and metadata
  • query: Execute SQL queries from natural language
  • sample_data: Retrieve sample rows
  • system_info: Database status and performance

Example: MCP + CLI Workflow

bash
# 1. Use MCP to explore (natural language)
"Show me all tables in the PRODUCTS schema"

# 2. Use MCP to understand structure
"Describe the PRODUCTS.INVENTORY table"

# 3. Use CLI for format conversion (precise output)
hana-cli inspectTable -t INVENTORY -s PRODUCTS -o cds

# 4. Use CLI for HDI operations
hana-cli createContainer -c MY_CONTAINER

Core Command Categories

Database Object Inspection

CommandAliasesPurpose
inspectTableit, tableInspect table structure
inspectView-Inspect view definition
inspectProcedure-Inspect stored procedure
inspectFunction-Inspect function definition
tables-List all tables in schema
views-List all views in schema
procedures-List stored procedures
functions-List functions

Query Execution

CommandAliasesPurpose
querySimpleqsExecute SQL query
callProcedurecpExecute stored procedure
hdbsql-Direct SQL execution

HDI Container Management

CommandAliasesPurpose
containerscontList HDI containers
createContainer-Create new container
dropContainer-Remove container
activateHDI-Enable HDI service
adminHDI-Administer HDI privileges

Cloud & BTP Operations

CommandAliasesPurpose
hanaCloudInstances-List HANA Cloud instances
hanaCloudStart-Start cloud instance
hanaCloudStop-Stop cloud instance
btp-Configure BTP CLI
btpInfo-Display BTP target info

Output Formats

The --output / -o option supports 17+ formats:

FormatUse Case
tblHuman-readable table (default)
jsonJSON data
yamlYAML format
csvCSV export
excelExcel file
cdsCAP CDS definitions
hdbcdsHANA CDS format
hdbtableHDB Table definitions
sqlSQL DDL statements
edmxOData EDMX metadata
openapiOpenAPI/Swagger spec
graphqlGraphQL schema

Connection Configuration

Connection credentials are searched in priority order:

  1. default-env-admin.json (with --admin flag)
  2. .cdsrc-private.json (via cds bind)
  3. .env file with VCAP_SERVICES
  4. File specified via --conn parameter
  5. default-env.json in current/parent directories
  6. ~/.hana-cli/default.json

For connection templates, see templates/default-env.json.


Common Workflows

Inspect and Convert Table to CDS

bash
# Inspect table structure
hana-cli inspectTable -s MYSCHEMA -t MYTABLE

# Convert to CDS format
hana-cli inspectTable -s MYSCHEMA -t MYTABLE -o cds

Mass Convert Schema Objects

bash
# Convert all objects in schema to CDS
hana-cli massConvert -s MYSCHEMA

Execute Query with Export

bash
# Run query and export to JSON
hana-cli querySimple -q "SELECT * FROM MYTABLE" -o json

# Export to Excel file
hana-cli querySimple -q "SELECT * FROM MYTABLE" -o excel -f ./output -n report

Manage HDI Containers

bash
# List all containers
hana-cli containers

# Create new container
hana-cli createContainer -c MY_CONTAINER -g MY_GROUP

# Create container users
hana-cli createContainerUsers -c MY_CONTAINER

UI Commands

Many commands have browser-based UI alternatives (suffix UI):

  • tablesUI - Browse tables visually
  • containersUI - Manage containers in browser
  • massConvertUI - Visual mass conversion
  • querySimpleUI - Query builder interface
  • systemInfoUI - System dashboard

Key Features

  • Multi-database support: HANA, PostgreSQL, SQLite backends
  • Format conversion: 17+ output formats including CDS, EDMX, OpenAPI
  • HDI management: Full container lifecycle management
  • Cloud integration: SAP BTP CLI and HANA Cloud support
  • Interactive prompts: Missing parameters prompted automatically
  • Service key auth: Secure cloud authentication

Detailed References

For comprehensive documentation:

  • All 91 Commands: See references/command-reference.md
  • Connection & Security: See references/connection-security.md
  • HDI Management: See references/hdi-management.md
  • Output Formats: See references/output-formats.md
  • Cloud Operations: See references/cloud-operations.md
  • Database Inspection: See references/db-inspection.md
  • Mass Operations: See references/mass-operations.md
  • System Administration: See references/system-admin.md
  • Web UI Interface: See references/web-ui.md
  • Troubleshooting Guide: See references/troubleshooting.md
  • Development Environment: See references/development-environment.md
  • ABAP Programming Patterns: See references/abap-programming.md

Troubleshooting

Connection Issues

bash
# Check current connection status
hana-cli status

# Test with explicit credentials
hana-cli connect -n "host:443" -u USER -p PASS --encrypt true

# Use SSL trust store
hana-cli connect --trustStore /path/to/certificate.pem

Permission Errors

bash
# Diagnose privilege errors
hana-cli privilegeError

# View current user info
hana-cli inspectUser

Version Compatibility

  • Node.js: Requires ≥20.19.0
  • @sap/cds: Uses 9.4.4
  • @sap/cds-dk: Requires ≥8.9 for cds bind

Bundled Resources

Reference Documentation

  • references/command-reference.md - Complete command reference with all options
  • references/abap-programming.md - ABAP-specific programming patterns
  • references/development-environment.md - Development setup and environment guidance
  • references/connection-security.md - Secure connection and credential handling
  • references/troubleshooting.md - Common errors and recovery steps

Templates

  • templates/default-env.json - Local connection template for CAP-style bindings
  • templates/cdsrc-private.json - CAP private configuration template

Resources


Last Updated: 2025-11-26 | Version: 1.1.0

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Sap Hana Cli AI skill do?

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.

Why use Sap Hana Cli on TypingMind?

Because you install it once and use it with any model. Sap Hana Cli is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Sap Hana Cli in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/secondsky/sap-skills/tree/main/plugins/sap-hana-cli/skills/sap-hana-cli. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Sap Hana Cli?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Sap Hana Cli?

As many as you like. As long as a model supports skills, you can use Sap Hana Cli with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Sap Hana Cli AI skill free?

Yes. It is published on GitHub by secondsky under the GPL-3.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇