← Browse

@sap-samples/cloud-cap-hana-swapi

A

hana-cli — AI Coding Assistant Context

rulescursor

Install

agr install @sap-samples/cloud-cap-hana-swapi --target cursor

Writes 1 file into .cursor/rules/, pinned to git-04fcbc38.

  • .cursorrules

Document

hana-cli — AI Coding Assistant Context

About hana-cli

hana-cli (npm: hana-cli, install: npm install -g hana-cli) is a command-line tool for SAP HANA database development. It simplifies complex multi-step database operations into single commands. It is a development tool, not a replacement for hdbsql or production admin tools.

Version: 4.202603.2
Requirements: Node.js ≥ 20.19.0
Module: ESM ("type": "module")

When to Use hana-cli

Use hana-cli when a developer needs to:

  • Explore schemas: hana-cli tables, hana-cli views, hana-cli schemas
  • Inspect objects: hana-cli inspectTable, hana-cli inspectView, hana-cli inspectProcedure
  • Import/export data: hana-cli import, hana-cli export
  • Run queries: hana-cli querySimple --query "SQL"
  • Check health: hana-cli healthCheck, hana-cli systemInfo
  • Manage connections: hana-cli connect, hana-cli status
  • Profile data: hana-cli dataProfile, hana-cli dataValidator
  • Compare schemas: hana-cli compareSchema, hana-cli compareData
  • Monitor performance: hana-cli expensiveStatements, hana-cli memoryAnalysis
  • Manage security: hana-cli users, hana-cli roles, hana-cli securityScan
  • Work with HANA Cloud: hana-cli hanaCloudInstances, hana-cli hanaCloudStart
  • Manage HDI: hana-cli containers, hana-cli adminHDI

Key Patterns

  1. Always verify connection first: hana-cli status
  2. Explore before modifying: Use tables, inspectTable, dataProfile before import/export
  3. Use dry-run for imports: hana-cli import --filename data.csv --table X --schema Y --dryRun
  4. Use --output flag: Many commands support --output json|csv|table|excel
  5. Use --query flag with querySimple: hana-cli querySimple --query "SELECT ..." (not positional args)
  6. Interactive mode: Run hana-cli with no arguments for a menu-driven experience

Connection Setup

hana-cli connect                    # Interactive wizard
hana-cli connectViaServiceKey       # Via BTP service key
hana-cli copy2DefaultEnv            # Copy to default-env.json for CAP projects
hana-cli status                     # Verify connection

Reference

For the complete command reference with all parameters, see:

  • HANA_CLI_REFERENCE.md (full reference, all commands)
  • HANA_CLI_QUICKSTART.md (getting started, top 10 commands)
  • HANA_CLI_EXAMPLES.md (real-world scenarios)
  • HANA_CLI_WORKFLOWS.md (multi-step workflows)
  • categories/*.md (per-category deep dives)

Or run hana-cli <command> --help for any specific command.

Trustgrade A

  • passBody integrity

    Whether the stored document is plausibly the kind of file the artifact declares, rather than something fetched by mistake.

  • passType matchnot applicable to this artifact type

    Whether the artifact is really the kind of thing its metadata claims it is.

  • passFreshness

    How long since the source repository was last pushed to.

  • passPrompt injection

    Scans the artifact's own text for instructions aimed at your agent rather than at you.

  • passLicense

    Whether the source repository declares an SPDX license permissive enough to redistribute.

How the grade is calculated

Each check contributes 0 points when it passes, 1 when it warns, and 2 when it fails. The total maps to a letter:

  • Aevery check passed
  • Bone warning
  • Ctwo warnings
  • Dprompt injection or body integrity failed, or three warnings
  • Fone of those failed, and something else is wrong

These are automated hygiene checks, not a security audit, and not a dependency or vulnerability scan. A grade of A means nothing was flagged — not that the artifact is safe.

Versions

  • git-04fcbc3815c72026-08-06