Skip to content
Development
Skill

/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,

From plugin
sap-skills
48540 skills31 agents69 commands8 MCP

Claude Code

$ npx -y skills add secondsky/sap-skills --skill sap-hana-cli --agent claude-code

SKILL.md

sap-hana-cli.SKILL.md
name: sap-hana-cli
description: |
  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.
license: GPL-3.0
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"

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](https://github.com/SAP-samples/hana-developer-cli-tool-example) **npm Package**: [https://www.npmjs.com/package/hana-cli](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](#quick-start)
  • [Core Command Categories](#core-command-categories)
  • [Output Formats](#output-formats)
  • [Connection Configuration](#connection-configuration)
  • [Common Workflows](#common-workflows)
  • [Bundled Resources](#bundled-resources)

Quick Start

Installation

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

# Verify installation
hana-cli version

First Connection

# 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):

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

| Scenario | Recommended Tool | Why | |----------|------------------|-----| | Exploratory queries, ad-hoc analysis | **MCP** | Natural language, no syntax needed | | Automation scripts, CI/CD pipelines | **CLI** | Scriptable, consistent output | | Learning database structure | **MCP** | Conversational discovery | | Generating CDS/EDMX/OpenAPI output | **CLI** | Supports 17+ formats | | Complex multi-step workflows | **CLI** | Fine-grained control | | Quick data sampling and inspection | **MCP** | Faster 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

# 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
Read more
@secondsky
Ships withsap-skills

40 SAP development plugins with evidence-tracked verification SAP development plugins for AI coding assistants, with public-source or package-registry verification tracked where available.

48540 skills31 agents8 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
485
Star history of secondsky/sap-skills on GitHub, a chart by star-history.com

Other skills on sap-skills.

sap-abap-cds

sap-abap-cds

Comprehensive SAP ABAP CDS (Core Data Services) reference for data modeling, view development, and semantic enrichment. Use when…

sap-abap

sap-abap

Comprehensive ABAP development skill for SAP systems. Use when writing ABAP code, working with internal tables, structures, ABAP…

sap-ai-core

sap-ai-core

Guides development with SAP AI Core and SAP AI Launchpad for enterprise AI/ML workloads on SAP BTP. Use when: deploying…

sap-api-policy

sap-api-policy

Evidence-based assessment of whether an SAP API/interface usage scenario aligns with the SAP API Policy (v.4.2026a). Use whenever…

sap-api-style

sap-api-style

This skill provides comprehensive guidance for documenting SAP APIs following the SAP API Style Guide standards. It should be…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc13d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react2d252k
@facebook@facebookInstall Skill

Questions about sap-hana-cli.

Which coding agents can use sap-hana-cli?
sap-hana-cli installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.