Skip to content

Commit 13a9e31

Browse files
committed
feat: enhance README with supported environments and installation methods diagrams
1 parent 7829d2d commit 13a9e31

1 file changed

Lines changed: 220 additions & 0 deletions

File tree

README.md

Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,30 @@ Introduction Video: [https://youtu.be/dvVQfi9Qgog](https://youtu.be/dvVQfi9Qgog)
1212

1313
However the tool isn't limited to only local development. It also works well when developing in the cloud. The hana-cli tool can also run well from a cloud shell in the SAP Business Application Studio, Google Cloud Shell, AWS Cloud9, etc. We can also run against a SAP HANA service for SAP BTP or SAP HANA Cloud instance. This demonstrates that the tool can run just about anywhere you can get a command line that has access to the Node.js Runtime. We can also connect to a remote HANA instance even if it isn't running in the same cloud environment in which we are performing our development tasks.
1414

15+
### Supported Environments
16+
17+
```mermaid
18+
graph TD
19+
A["SAP HANA CLI Tool"] --> B{Development Environment}
20+
B --> C["Local Development"]
21+
B --> D["Cloud Development"]
22+
23+
C --> C1["VSCode"]
24+
C --> C2["Local SAP HANA Express"]
25+
C --> C3["Remote SAP HANA"]
26+
27+
D --> D1["SAP Business App Studio"]
28+
D --> D2["Google Cloud Shell"]
29+
D --> D3["AWS Cloud9"]
30+
D --> D4["SAP BTP HANA Service"]
31+
D --> D5["SAP HANA Cloud"]
32+
33+
style A fill:#0070C0
34+
style B fill:#FF6B6B
35+
style C fill:#51CF66
36+
style D fill:#FFD93D
37+
```
38+
1539
Running in Cloud Shells Video: [https://youtu.be/L7QyVLvAIIQ](https://youtu.be/L7QyVLvAIIQ)
1640

1741
## Requirements / Download and Installation
@@ -22,6 +46,28 @@ If you would rather just access the tool directly, it is now available in npm as
2246
npm install -g hana-cli
2347
```
2448

49+
### Installation Methods
50+
51+
```mermaid
52+
graph LR
53+
A["SAP HANA CLI Tool"] --> B{Installation Method}
54+
55+
B --> B1["NPM Package<br/>Quick Install"]
56+
B1 --> B1a["npm install -g hana-cli"]
57+
B1a --> B1b["✅ Ready to Use"]
58+
59+
B --> B2["Clone & Build<br/>From Source"]
60+
B2 --> B2a["Clone Repository<br/>from GitHub"]
61+
B2a --> B2b["Run npm install"]
62+
B2b --> B2c["Run npm link"]
63+
B2c --> B2d["✅ Ready to Use"]
64+
65+
style B1 fill:#0070C0,color:#fff
66+
style B2 fill:#FF6B6B,color:#fff
67+
style B1b fill:#51CF66,color:#fff
68+
style B2d fill:#51CF66,color:#fff
69+
```
70+
2571
Otherwise you can also run it from the sources as described here:
2672

2773
* Install Node.js version 14.x or 16.x on your development machine [https://nodejs.org/en/download/](https://nodejs.org/en/download/)
@@ -102,8 +148,54 @@ This will display your current BTP target information including global account,
102148

103149
This application primarily uses the default-env.json that is often used in local development for connectivity to a remote HANA DB (although it can of course be used with a local SAP HANA, express edition instance as well). For more details on how the default-env.json works, see the readme.md of the @sap/xsenv package or the @sap/hdi-deploy package.
104150

151+
### Connection Configuration Resolution Order
152+
105153
The tool doesn't simply look for a default-env.json file in the current directory however. There are numerous options and places it will look for the connection parameters. Here is the order in which it checks:
106154

155+
```mermaid
156+
graph TD
157+
A["Connection Resolution<br/>Started"] --> B{Admin Mode<br/>Enabled?}
158+
B -->|YES| B1["Look for<br/>default-env-admin.json"]
159+
B -->|NO| C{.cdsrc-private.json<br/>Found?}
160+
161+
B1 --> B2{Found?}
162+
B2 -->|YES| Z1["Use Admin Credentials"]
163+
B2 -->|NO| C
164+
165+
C -->|YES| C1["Use CAP cds bind<br/>Dynamic Lookup"]
166+
C -->|NO| D{.env File<br/>Found?}
167+
168+
C1 --> Z2["Secure Lookup<br/>from CF/K8s"]
169+
170+
D -->|YES| D1{Contains<br/>VCAP_SERVICES?}
171+
D1 -->|YES| Z3["Use VCAP Services"]
172+
D1 -->|NO| E
173+
D -->|NO| E
174+
175+
E{--conn Parameter<br/>Specified?} -->|YES| E1["Look for specified<br/>connection file"]
176+
E1 --> E2{Local or<br/>Home Found?}
177+
E2 -->|YES| Z4["Use Specified File"]
178+
E2 -->|NO| F
179+
E -->|NO| F
180+
181+
F["Look for<br/>default-env.json<br/>in current/parent dirs"]
182+
F --> G{Found?}
183+
G -->|YES| Z5["Use default-env.json"]
184+
G -->|NO| H["Last Resort:<br/>Look for default.json<br/>in HOME/.hana-cli/"]
185+
186+
H --> I{Found?}
187+
I -->|YES| Z6["Use default.json"]
188+
I -->|NO| Z7["❌ No Connection<br/>Configuration Found"]
189+
190+
style Z1 fill:#51CF66
191+
style Z2 fill:#51CF66
192+
style Z3 fill:#51CF66
193+
style Z4 fill:#51CF66
194+
style Z5 fill:#51CF66
195+
style Z6 fill:#51CF66
196+
style Z7 fill:#FF6B6B
197+
```
198+
107199
* First we look for the Admin option and use a default-env-admin.json - this overrides all other parameters
108200
* If no admin option or if there was an admin option but no default-env-admin.json could be found in this directory or 5 parent directories, then look for `.cdsrc-private.json` in this directory or 5 parent directories and use [`cds bind`](https://cap.cloud.sap/docs/advanced/hybrid-testing#bind-to-cloud-services) functionality to lookup the credentials securely. This is the most secure option, but please note: this will make each command take a few seconds longer as credentials are no longer stored locally but looked up from cf or k8s dynamically with each command
109201
* If no `.cdsrc-private.json` found in this directory or 5 parent directories, then look for a .env file in this directory or up to 5 parent directories
@@ -269,6 +361,37 @@ For complete implementation details, usage examples, and customization options,
269361
270362
The hana-cli tool includes a complete browser-based interface built with SAP UI5 and the Fiori Launchpad, providing a graphical alternative to the command-line interface. This web interface offers an intuitive, tile-based navigation system for all database operations.
271363
364+
```mermaid
365+
graph TB
366+
CLI["hana-cli<br/>Command Line<br/>Interface"]
367+
368+
CLI -->|--web flag| Server["Web Server<br/>Port 3010"]
369+
370+
Server --> UI["Fiori Launchpad UI<br/>SAP UI5 Application"]
371+
372+
UI --> DB["Database<br/>Operations"]
373+
UI --> Cloud["Cloud Services<br/>BTP/CF Integration"]
374+
UI --> Admin["Admin<br/>Functions"]
375+
376+
DB --> T["Tables,<br/>Views,<br/>Schemas"]
377+
DB --> I["Indexes,<br/>Functions,<br/>Procedures"]
378+
379+
Cloud --> HDI["HDI<br/>Containers"]
380+
Cloud --> SBSS["SBSS<br/>Services"]
381+
Cloud --> Store["SecureStore<br/>& Schema"]
382+
383+
Admin --> Conv["Mass<br/>Conversion"]
384+
Admin --> Monitor["System<br/>Monitoring"]
385+
Admin --> API["REST API"]
386+
387+
API --> Swagger["Swagger/OpenAPI<br/>Documentation<br/>27+ Endpoints"]
388+
389+
style CLI fill:#0070C0,color:#fff
390+
style Server fill:#FF6B6B,color:#fff
391+
style UI fill:#FFD93D,color:#000
392+
style Swagger fill:#51CF66,color:#000
393+
```
394+
272395
**Key Features:**
273396
274397
* **Fiori Launchpad Interface**: Modern, responsive UI with organized tile groups
@@ -294,6 +417,31 @@ The web UI runs on `http://localhost:3010` by default and provides access to all
294417
295418
The hana-cli tool now includes experimental support for the Model Context Protocol (MCP), enabling AI assistants like Claude to interact with SAP HANA databases through natural language. This integration exposes all 100+ hana-cli commands as tools that AI assistants can invoke directly.
296419
420+
```mermaid
421+
graph LR
422+
AI["🤖 AI Assistant<br/>Claude, etc."]
423+
424+
AI -->|Natural Language<br/>Query| MCP["MCP Server<br/>hana-cli Integration"]
425+
426+
MCP -->|Tool Invocation| Tools["100+ hana-cli<br/>Commands as Tools"]
427+
428+
Tools --> DB["SAP HANA<br/>Database"]
429+
Tools --> Cloud["BTP/Cloud<br/>Services"]
430+
Tools --> HDI["HDI<br/>Containers"]
431+
432+
DB -->|Data & Results| Tools
433+
Cloud -->|Service Info| Tools
434+
HDI -->|Container Status| Tools
435+
436+
Tools -->|Formatted<br/>Response| MCP
437+
MCP -->|Natural Language<br/>Result| AI
438+
439+
style AI fill:#9D55F0,color:#fff
440+
style MCP fill:#0070C0,color:#fff
441+
style Tools fill:#FF6B6B,color:#fff
442+
style DB fill:#51CF66,color:#fff
443+
```
444+
297445
**Key Features:**
298446
299447
* Natural language database queries and operations
@@ -312,6 +460,41 @@ For detailed setup instructions, configuration options, and usage examples, plea
312460
313461
The hana-cli tool follows consistent parameter naming, aliasing, and default value conventions across all commands to provide a predictable and intuitive user experience.
314462
463+
### Command Categories Overview
464+
465+
```mermaid
466+
graph TB
467+
A["200+ hana-cli<br/>Commands"] --> B{Command<br/>Category}
468+
469+
B --> C["Connection<br/>Commands"]
470+
B --> D["Data<br/>Manipulation"]
471+
B --> E["Database<br/>Inspection"]
472+
B --> F["Performance<br/>Analysis"]
473+
B --> G["Cloud<br/>Integration"]
474+
B --> H["HDI<br/>Management"]
475+
476+
C --> C1["connect<br/>copy2DefaultEnv<br/>copy2Env"]
477+
478+
D --> D1["export<br/>import<br/>dataSync<br/>tableCopy"]
479+
480+
E --> E1["tables<br/>views<br/>procedures<br/>schemas<br/>indexes"]
481+
482+
F --> F1["tableHotspots<br/>queryPlan<br/>alerts<br/>healthCheck"]
483+
484+
G --> G1["btp<br/>btpInfo<br/>activateHDI"]
485+
486+
H --> H1["containers<br/>createContainer<br/>dropContainer"]
487+
488+
style A fill:#0070C0,color:#fff
489+
style B fill:#FF6B6B,color:#fff
490+
style C fill:#51CF66,color:#fff
491+
style D fill:#9D55F0,color:#fff
492+
style E fill:#FFD93D,color:#000
493+
style F fill:#F39C12,color:#fff
494+
style G fill:#1ABC9C,color:#fff
495+
style H fill:#E74C3C,color:#fff
496+
```
497+
315498
### Global Standard Parameters
316499
317500
All commands support the following standard connection and debugging parameters:
@@ -400,6 +583,43 @@ Default values are standardized to ensure consistent behavior:
400583
401584
#### Using Standard Parameters
402585
586+
```mermaid
587+
graph LR
588+
A["hana-cli<br/>Command"]
589+
590+
A --> B{Choose<br/>Operation}
591+
592+
B --> C["List Operation<br/>tables, views, etc."]
593+
C --> C1["--schema<br/>-s"]
594+
C --> C2["--limit<br/>-l"]
595+
C --> C3["--profile<br/>-p"]
596+
C1 --> C4["Filter by schema"]
597+
C2 --> C5["Limit results"]
598+
C3 --> C6["Select DB profile"]
599+
600+
B --> D["Data Operation<br/>export, import, etc."]
601+
D --> D1["--sourceTable/-st<br/>--targetTable/-tt"]
602+
D --> D2["--format<br/>-f"]
603+
D --> D3["--dryRun/-dr<br/>--preview"]
604+
D1 --> D4["Source/Target"]
605+
D2 --> D5["Output format"]
606+
D3 --> D6["Dry run preview"]
607+
608+
B --> E["Batch Operation<br/>massGrant, etc."]
609+
E --> E1["--schema/-s"]
610+
E --> E2["--dryRun/-dr"]
611+
E --> E3["--log"]
612+
E1 --> E4["Target schema"]
613+
E2 --> E5["Safe execution"]
614+
E3 --> E6["Operation log"]
615+
616+
style A fill:#0070C0,color:#fff
617+
style B fill:#FF6B6B,color:#fff
618+
style C fill:#51CF66,color:#fff
619+
style D fill:#9D55F0,color:#fff
620+
style E fill:#FFD93D,color:#000
621+
```
622+
403623
```bash
404624
# List all tables in current schema with preview of first 100
405625
hana-cli tables -s myschema -l 100

0 commit comments

Comments
 (0)