A command-line interface (CLI) tool that connects to SAP NetWeaver Application Server for ABAP systems via OData protocols. The CLI enables users to interact with SAP business entities (such as Sales Orders, Purchase Orders, Business Partners) using intuitive business-level commands, without needing to know the underlying OData service paths or technical entity set names. The tool dynamically discovers available OData services and entity sets from the SAP system's Service_Catalog, caches the results locally, and resolves business entity names at runtime. This eliminates the need for a compiled-in registry and ensures the CLI always reflects the services actually available on the connected SAP system.
This SAP-centric CLI also provides a powerful foundation for LLMs by allowing them to discover business entities in real-time and perform tasks through intuitive commands, rather than relying on a static, pre-defined map of technical OData paths.
Input
sap-cli read ZCRM_BUPA_ODATA --object AccountCollection --key "'USSU-VSF54'" --profile defaultOutput
┌───────────────────────┬──────────────────────────────────────────┐
│ Property ┆ Value │
╞═══════════════════════╪══════════════════════════════════════════╡
│ Ac.title descr. ┆ │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ Academic Title ┆ │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ BusinessPartner [key] ┆ USSU-VSF54 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ Date of Birth ┆ │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ Partner Cat. ┆ 1 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ Hash Value ┆ FEC28D54915E4C008C0B4D06FBC5EADD8EEF98F3 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ BP Description ┆ "FindYou, Inc" │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ TRUE ┆ false │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ Name 1 ┆ "FindYou, Inc" │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ Name 2 ┆ │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ Search Text ┆ "FINDYOU, INC" USSU-VSF54 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ Title ┆ Mr. │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤Input
Can you use the sap-cli and list all services with regards to 'sales orders'Output
✓ Trusted: sap-cli list --filter "sales order" --format markdown
| Technical Name | Version | Description |
| --- | --- | --- |
| ZC_SALESORDERQUERY_CDS | 1 | Sales Order Header Query |
| ZSD_SO_PROCFLOW_SRV | 1 | SD Process Flow for Sales Order |
| ZSD_SO_MNT_F0804_PBS_SRV | 1 | Maintain Sales Order for Professional Services |
| ZSD_SO_LIST_F0804_SFS_SRV | 1 | Sales Orders for Sell from Stock |
| ZSD_SO_LIST_F0804_PBS_SRV | 1 | Sales Orders for Professional Based Services |
| ZSD_SOF | 1 | Sales Order Fulfillment Reuse Component |
| ZSD_SOFM_SRV | 1 | Service for Sales Order Fulfillment Monitor |
| ZSD_SOFM_CREDIT_BLOCK_SRV | 1 | Resolve Credit Block in Sales Orders |Every command accepts these flags:
--profile <NAME> Connection profile to use (default: "default")
--url <URL> SAP system base URL (overrides profile)
--client <CLIENT> SAP client number (overrides profile)
--user <USER> Username (overrides profile)
--password <PASSWORD> Password (overrides profile)
--format <FORMAT> Output format: table (default), json, markdown (use for LLM)
--verbose Enable debug logging
--insecure Skip TLS certificate verification (for self-signed certs)
--refresh Force refresh of cached service catalog and metadata
Warning: Using
--insecuredisables TLS certificate verification. This makes the connection vulnerable to man-in-the-middle attacks. Only use this flag for development or testing with self-signed certificates — never in production.
Profiles store your SAP connection details locally. Passwords are encrypted with AES-256-GCM using a machine-derived key.
# Add a profile (password is prompted interactively — never passed as a CLI argument)
sap-cli profile add default --url https://host:port --client 100 --user MYUSER
# List all profiles
sap-cli profile list
# Delete a profile
sap-cli profile delete defaultProfiles are stored in ~/.config/sap-cli/profiles.toml.
The list command discovers OData services and their entity sets from the SAP system's service catalog.
# List all available OData services
sap-cli list --profile default
# Filter services by name or description
sap-cli list --filter "sales" --profile default
# List entity sets within a specific service
sap-cli list ZCRM_BUPA_ODATA --profile default
# Show entity detail (properties, types, keys) for a specific entity set
sap-cli list ZCRM_BUPA_ODATA --object AccountCollection --profile defaultService catalog results are cached locally with a 60-minute TTL. Use --refresh to force a fresh fetch.
The read command fetches entity data from an OData V2 service.
# Read a collection (first page)
sap-cli read ZCRM_BUPA_ODATA --object AccountCollection --profile default
# Limit results
sap-cli read ZCRM_BUPA_ODATA --object AccountCollection --top 10 --profile default
# Read a single entity by key
sap-cli read ZCRM_BUPA_ODATA --object AccountCollection --key "'USSU-VSF54'" --profile default
# Allows supports composite keys, if required
sap-cli read MY_SERVICE --object SalesOrderItem --key "SalesOrder='123',SalesOrderItem='10'"
# Filter, select, and sort
sap-cli read ZCRM_BUPA_ODATA --object AccountCollection \
--filter "name1 eq 'ABC Company 02'" \
--select "name1" \
--orderby "name1 asc" \
--top 20 \
--profile default
# Expand navigation properties
sap-cli read ZCRM_BUPA_ODATA --object AccountCollection --expand "Addresses" --profile default
# Follow server-side pagination
sap-cli read ZCRM_BUPA_ODATA --object AccountCollection --follow-next --profile default
# Output as markdown for LLM usage
sap-cli read ZCRM_BUPA_ODATA --object AccountCollection --top 5 --format markdown --profile defaultOutput includes SAP labels as column headers (falling back to technical names), key fields marked with [key], and linked navigation properties shown in a separate section.
cargo test --test integration 2>&1To build the release binary:
cargo build --releaseThe binary will be at target/release/sap-cli. You can copy it to somewhere on your PATH or create a symlink (e.g. /usr/local/bin/) to use it globally:
cp target/release/sap-cli /usr/local/bin/or
ln -sf "$(pwd)/target/release/sap-cli" /usr/local/bin/sap-cli0.1.0 Initial Release
- 10 MB limit on $metadata / CATALOGSERVICE
- 10 seconds timeout on initial connect, 60 seconds timeout to retrieve payload(s)
- 60 minutes cache for catalog and metadata
- Commands only accept technical names only for now
- Expand: Formatting could be improved
- Currently not yet supported:
- OData V4
- Create / Update / Delete operations
- Server-side navigation property traversal
This project is licensed under
All rights reserved.