@khotan/cli 0.10.0 → 0.11.0

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 (3) hide show
  1. package/README.md +18 -55
  2. package/dist/khotan.js +16472 -1520
  3. package/package.json +2 -3
package/README.md CHANGED
@@ -1,10 +1,9 @@
1
- # Khotan CLI & MCP server
1
+ # Khotan CLI
2
2
 
3
- `@khotan/cli` is the first-party command-line interface and Model Context
4
- Protocol (MCP) server for the Khotan API. Both surfaces are thin adapters over
5
- the public `/api/v1` HTTP API, driven by the shared capability catalog in
6
- [`@khotan/core`](../khotan-core). They add nothing the API cannot do they make
7
- the same operations ergonomic for humans (CLI) and agents (MCP).
3
+ `@khotan/cli` is the first-party command-line interface for the Khotan API. It
4
+ is a thin adapter over the public `/api/v1` HTTP API, driven by the shared
5
+ capability catalog in [`@khotan/core`](../khotan-core). It adds nothing the API
6
+ cannot do it makes the same operations ergonomic for humans and agents alike.
8
7
 
9
8
  ## Install & run
10
9
 
@@ -32,27 +31,24 @@ own agents (Cursor, Devin, …) can drive setup. It is non-destructive and
32
31
  re-runnable, and never writes secrets.
33
32
 
34
33
  ```bash
35
- khotan init # Cursor: .cursor/mcp.json + .cursor/rules/khotan.mdc
36
- khotan init --client generic # root mcp.json + khotan-agents.md
34
+ khotan init # Cursor: .cursor/rules/khotan.mdc
35
+ khotan init --client generic # khotan-agents.md
37
36
  khotan init --force # regenerate managed assets, overwriting edits
38
37
  khotan init --json # machine-readable summary on stdout
39
38
  ```
40
39
 
41
- It writes an MCP config wired to `khotan mcp serve` (credentials referenced by
42
- `KHOTAN_API_URL` / `KHOTAN_API_KEY`, placeholders only) plus agent guidance. The
43
- MCP config merges into an existing one, preserving any other servers. Authenticate
44
- separately with `khotan auth set-key` or environment variables — never commit a key.
40
+ It writes agent guidance for using the CLI. Authenticate separately with
41
+ `khotan auth set-key` or environment variables never commit a key.
45
42
 
46
43
  `init` also installs catalog-derived agent **skills** for using the CLI into
47
44
  `.cursor/skills/`, `.agents/skills/`, and `.claude/skills/` (regardless of
48
45
  `--client`): an overview `khotan` skill plus one per command domain
49
46
  (`khotan-apps`, `khotan-databases`, …). The skills are generated from the same
50
- capability catalog that drives the commands, MCP tools, and `khotan help`, so
51
- they can never drift. They are **managed assets**: every `khotan init` run
52
- regenerates them in place (no `--force` needed), so re-running `init` is how a
53
- workspace picks up new CLI commands — like the `databases branches` group. Your
54
- hand-authored rule/guide and any MCP edits stay non-destructive (preserved
55
- unless `--force`).
47
+ capability catalog that drives the commands and `khotan help`, so they can
48
+ never drift. They are **managed assets**: every `khotan init` run regenerates
49
+ them in place (no `--force` needed), so re-running `init` is how a workspace
50
+ picks up new CLI commands — like the `databases branches` group. Your
51
+ hand-authored rule/guide stays non-destructive (preserved unless `--force`).
56
52
 
57
53
  ## Authentication & profiles
58
54
 
@@ -125,10 +121,10 @@ KHOTAN_API_KEY='<org-scoped key>'
125
121
  KHOTAN_ORG_ID='<org id>'
126
122
  ```
127
123
 
128
- When `KHOTAN_ORG_ID` (or `--assert-org <id>`) is set, every operation and
129
- `khotan mcp serve` verifies `whoami.organizationId` matches before trusting
130
- output and fails closed on mismatch (`error [org_mismatch]`). With no expected
131
- org id set, behavior is unchanged.
124
+ When `KHOTAN_ORG_ID` (or `--assert-org <id>`) is set, every operation verifies
125
+ `whoami.organizationId` matches before trusting output and fails closed on
126
+ mismatch (`error [org_mismatch]`). With no expected org id set, behavior is
127
+ unchanged.
132
128
 
133
129
  ## Command surface
134
130
 
@@ -186,39 +182,6 @@ khotan files download-url file_123 # attachment disposition, any file type
186
182
  See [Serving file attachments](../../docs/files-api-attachments.md) for the full
187
183
  preview/download flow and the receiver wiring guidance.
188
184
 
189
- ## MCP server
190
-
191
- `khotan mcp serve` starts a local stdio MCP server that reuses the same profile,
192
- environment overrides, API client, and catalog as the CLI. It advertises
193
- **tools** (operations) and **resources** (URI-addressed read data) during
194
- initialization.
195
-
196
- - Operations become tools (e.g. `khotan_apps_create`). Destructive tools require
197
- `{ "confirm": true }`; secret tools are labelled `[secret]`. The password-bearing
198
- credential exchange is **not** exposed as a tool.
199
- - Durable read data is exposed as resource templates: `khotan://apps/{appId}`,
200
- `khotan://pipelines/{pipelineId}`, `khotan://databases/{databaseId}`,
201
- `khotan://files/{fileId}`, `khotan://context/{slug}`.
202
- - Secret-bearing values (env var values, connection URIs) are never resources.
203
- - stdout carries JSON-RPC only; all logs go to stderr.
204
-
205
- Example MCP client configuration:
206
-
207
- ```json
208
- {
209
- "mcpServers": {
210
- "khotan": {
211
- "command": "khotan",
212
- "args": ["mcp", "serve"],
213
- "env": {
214
- "KHOTAN_API_URL": "https://app.example.com",
215
- "KHOTAN_API_KEY": "khk_live_..."
216
- }
217
- }
218
- }
219
- }
220
- ```
221
-
222
185
  ## Catalog ↔ OpenAPI consistency
223
186
 
224
187
  `@khotan/core` validates that every catalog operation maps to a real `/api/v1`