@settlemint/dalp-cli 3.1.5-main.32670705612 → 3.1.5-release.32679963579

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +168 -41
  2. package/dist/dalp.js +191672 -146333
  3. package/package.json +18 -17
  4. package/dist/dalp.js.map +0 -239
package/README.md CHANGED
@@ -8,70 +8,197 @@
8
8
  </p>
9
9
  </p>
10
10
 
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/@settlemint/dalp-cli" rel="nofollow"><img src="https://img.shields.io/npm/v/@settlemint/dalp-cli" alt="npm version"></a>
13
+ <a href="https://www.npmjs.com/package/@settlemint/dalp-cli" rel="nofollow"><img src="https://img.shields.io/npm/dw/@settlemint/dalp-cli" alt="npm downloads"></a>
14
+ </p>
15
+
16
+ <div align="center">
17
+ <a href="https://settlemint.com">Website</a>
18
+ <span>&nbsp;&nbsp;&bull;&nbsp;&nbsp;</span>
19
+ <a href="https://www.npmjs.com/package/@settlemint/dalp-cli">NPM</a>
20
+ <span>&nbsp;&nbsp;&bull;&nbsp;&nbsp;</span>
21
+ <a href="mailto:support@settlemint.com">Support</a>
22
+ <br />
23
+ </div>
24
+
11
25
  ## About
12
26
 
13
- kubectl-style CLI over the public promise-based `@settlemint/dalp-sdk`.
27
+ The DALP CLI provides a command-line interface for interacting with the Digital Asset Lifecycle Platform. Manage security tokens, identities, compliance, and platform operations directly from the terminal — or let your AI agent do it for you.
14
28
 
15
- Command paths come from the **OpenAPI URL** (static segments) plus the HTTP verb:
29
+ ## Installation
16
30
 
17
- | HTTP | URL | CLI |
18
- | ------ | ----------------------------------------- | ---------------------------------------------------- |
19
- | `GET` | `/api/v2/tokens` | `dalp get tokens` |
20
- | `GET` | `/api/v2/tokens/{tokenAddress}` | `dalp get tokens <tokenAddress>` |
21
- | `GET` | `/api/v2/tokens/{tokenAddress}/documents` | `dalp get tokens documents <tokenAddress>` |
22
- | `POST` | `/api/v2/tokens/{tokenAddress}/mints` | `dalp create tokens mints <tokenAddress> --body '…'` |
31
+ ```bash
32
+ # npm
33
+ npm install -g @settlemint/dalp-cli
23
34
 
24
- OpenAPI text is extracted at **compile time** (`bun run codegen`) into
25
- `src/generated/openapi-surface.json` and drives help, args, options, enums,
26
- examples, and hints for agents (Incur `--llms` / MCP / skills).
35
+ # bun
36
+ bun add -g @settlemint/dalp-cli
37
+ ```
27
38
 
28
- ## Setup
39
+ ## Quick Start
29
40
 
30
41
  ```bash
31
- dalp config set apiUrl https://dalp.example.com
42
+ # Authenticate (OAuth 2.0 device flow — no passwords in your terminal)
32
43
  dalp login
33
- dalp org switch org_…
44
+
45
+ # Show current user
34
46
  dalp whoami
47
+
48
+ # List all tokens
49
+ dalp tokens list --format json
35
50
  ```
36
51
 
37
- ## Examples
52
+ ## Worked Examples
53
+
54
+ End-to-end flows you can run as-is. Add `--format json` to any command for machine-readable output.
55
+
56
+ ### Authenticate and inspect the platform
38
57
 
39
58
  ```bash
40
- dalp get tokens --help
41
- dalp get tokens index --sort name --limit 25
42
- dalp get tokens documents index 0x…
43
- dalp create tokens mints 0x… --body '{"recipients":[…],"amounts":[…]}'
44
- # Mutations wait for settlement by default (TTY spinner + status). Agents get streamed status events.
45
- dalp create tokens mints 0x… --body '…' --no-wait
59
+ # Authenticate against a specific instance (or set DALP_URL)
60
+ dalp login --url https://dalp.example.com
61
+
62
+ # Confirm who you are and which organization is active
63
+ dalp whoami
64
+
65
+ # List deployed systems, then the tokens they hold
66
+ dalp system list
67
+ dalp tokens list --format json
46
68
  ```
47
69
 
48
- ## Status UX (Incur best practices)
70
+ Expected outcome: a stored API key in your keychain, your user and organization echoed back, and a token inventory in JSON.
49
71
 
50
- Long-running work uses `async *run` generators ([Incur Streaming](https://github.com/wevm/incur#streaming)):
72
+ > SDK equivalent: `createDalpClient` with `dalp.token.list()` and `dalp.system.read()` — see the [`@settlemint/dalp-sdk` README](../sdk/README.md).
51
73
 
52
- - **Humans (TTY):** braille spinner on stderr with clear phase messages (`Preparing…`, `Submitting METHOD /url…`, `Waiting for settlement…`).
53
- - **Agents (`c.agent`):** structured yields `{ phase, message, status? }` with no spinner noise on stdout.
54
- - **Blockchain mutations:** when the API returns a `transactionId`, the CLI polls `@settlemint/dalp-sdk/wait-for-transaction` until terminal (override with `--no-wait`).
55
- - **SSE endpoints** (`…/stream`): each Server-Sent Event is yielded as a chunk. Use `--format jsonl` for NDJSON (`{"type":"chunk","data":…}`).
56
- - **Errors:** public `message` stays the headline; `why` / `fix` and mapped resource `links` become an Incur CTA (`meta.cta`) so agents get next commands without scraping free text.
57
- - **Success links:** JSON:API `links` (`next` / `prev` / related) map to suggested CLI commands when present.
74
+ ### Create an asset and verify it round-trip
58
75
 
59
76
  ```bash
60
- dalp get transaction-requests stream <transactionId>
61
- dalp get tokens create stream <transactionId>
62
- dalp get actions stream
63
- dalp get monitoring api request-logs stream
77
+ # Create a bond token (type-specific fields go in --json)
78
+ dalp tokens create --name "Bund 7Y" --symbol BUND7 --decimals 18 --type bond --country-code 276 --json '{"isin":"DE000BU27014"}'
79
+
80
+ # Find it in the token list (filterable by search query)
81
+ dalp tokens list --query BUND7
82
+
83
+ # Read its details and holder list by contract address
84
+ dalp tokens read <address>
85
+ dalp tokens holders <address>
86
+ ```
87
+
88
+ Expected outcome: a new bond token deployed through the platform, retrievable by address with an empty holder list.
89
+
90
+ > SDK equivalent: the typed `dalp.token.*` namespace in [`@settlemint/dalp-sdk`](../sdk/README.md).
91
+
92
+ ### Register an investor identity and run KYC
93
+
94
+ ```bash
95
+ # Create an on-chain identity for a wallet, then register it with a country code
96
+ dalp identities create --wallet 0x1234...abcd
97
+ dalp identities register --wallet 0x1234...abcd --country 276
98
+
99
+ # Check the registration landed
100
+ dalp identities registration-status 0x1234...abcd
101
+
102
+ # Start a KYC submission for the user and send it for review
103
+ dalp kyc version-create <userId>
104
+ dalp kyc version-submit --version-id <versionId>
64
105
  ```
65
106
 
66
- ## Architecture
107
+ Expected outcome: a registered on-chain identity for the wallet and a KYC version in review.
108
+
109
+ > SDK equivalent: `dalp.system.identity.*` and `dalp.user.kyc.*` in [`@settlemint/dalp-sdk`](../sdk/README.md).
110
+
111
+ ### Using the CLI from an AI agent
112
+
113
+ Every command accepts `--format json` (also `yaml`, `md`, `jsonl`; the default is token-efficient TOON) and a `--json` shorthand, so output is always machine-parseable. Authentication is interactive by design: `dalp login` runs an OAuth 2.0 device flow in a browser, then persists an API key to the system keychain — subsequent commands, including agent-driven ones, run non-interactively against that stored credential. Instance and organization can be pinned via the `DALP_URL` and `DALP_ORG` environment variables.
114
+
115
+ ## AI Agent Integration
116
+
117
+ The CLI is built from the ground up for AI agents. Every command is a typed, validated tool that agents can discover and call autonomously.
118
+
119
+ ### Model Context Protocol (MCP)
120
+
121
+ Run the CLI as an MCP server, exposing every command as a tool with Zod-validated parameters, descriptions, and examples:
122
+
123
+ ```bash
124
+ # Auto-register with your AI agent (Claude Code, Cursor, Codex, OpenClaw)
125
+ dalp mcp add
126
+
127
+ # Or run the MCP server directly
128
+ dalp --mcp
129
+ ```
130
+
131
+ ### Skills
132
+
133
+ Auto-generate skill files from command metadata for agent discovery:
134
+
135
+ ```bash
136
+ # Install skill files for your agent
137
+ dalp skills add
138
+
139
+ # View as Markdown or JSON Schema
140
+ dalp --llms
141
+ dalp --schema
142
+ ```
143
+
144
+ ### Structured Output
145
+
146
+ Every command supports `--format json` for machine-readable output, making it composable with shell tools and agent workflows:
147
+
148
+ ```bash
149
+ # Progressive discovery: systems → tokens → holders
150
+ dalp system list --format json
151
+ dalp tokens list --format json
152
+ dalp tokens holders <address> --format json
153
+ ```
67
154
 
68
- | Concern | Implementation |
69
- | --------- | ------------------------------------------------------------------ |
70
- | Framework | Incur + Zod |
71
- | HTTP | `createDalpClient` + `@settlemint/dalp-sdk/operations` |
72
- | Docs | Compile-time OpenAPI surface (`bun run codegen`) |
73
- | Auth | Device login → API key; `X-Organization-Id` from stored active org |
155
+ ### Supported Agents
156
+
157
+ Auto-detection and one-command setup for Claude Code, Codex Desktop, Cursor, and OpenClaw.
158
+
159
+ ## Commands
160
+
161
+ | Command | Description |
162
+ | ------------------------- | ----------------------------------- |
163
+ | `login` | Authenticate with the DALP platform |
164
+ | `logout` | End the current session |
165
+ | `whoami` | Show the current authenticated user |
166
+ | `tokens` | Manage security tokens |
167
+ | `token-sales` | Manage token sales |
168
+ | `tokens documents` | Manage token-related documents |
169
+ | `identity` | Manage on-chain identities |
170
+ | `identity-recoveries` | Recover lost identities |
171
+ | `kyc` | Manage KYC verification |
172
+ | `compliance-templates` | Manage compliance templates |
173
+ | `asset-type-templates` | Manage asset type templates |
174
+ | `user` | Manage platform users |
175
+ | `contacts` | Manage contacts |
176
+ | `account` | Manage accounts |
177
+ | `admin` | Administrative operations |
178
+ | `auth` | Authentication configuration |
179
+ | `config` | CLI configuration |
180
+ | `exchange-rates` | View exchange rates |
181
+ | `external-tokens` | Manage external tokens |
182
+ | `fixed-yield-schedules` | Manage fixed yield instruments |
183
+ | `monitoring` | Platform monitoring |
184
+ | `search-results` | Search across the platform |
185
+ | `settings` | Platform settings |
186
+ | `system` | System administration |
187
+ | `blockchain-transactions` | View transactions |
188
+ | `xvp-settlements` | Cross-value-payment operations |
189
+ | `actions` | Manage actions |
190
+
191
+ ## Security
192
+
193
+ - **OAuth 2.0 Device Authorization Grant** (RFC 8628) — no passwords in your terminal
194
+ - Credentials stored in system keychain (macOS) or encrypted file (Linux/Windows)
195
+ - API key auto-creation during login
196
+ - Agents operate with your user permissions only
197
+
198
+ ## Configuration
199
+
200
+ The CLI resolves configuration from (in order): CLI flags, environment variables, project config (`.dalprc.json`), and user config (`~/.config/dalp/`).
74
201
 
75
202
  ## License
76
203
 
77
- See `LICENSE`.
204
+ This project is licensed under the **SettleMint Commercial Customer Source License**. See the LICENSE file included in the package for full terms.