@kodycodes/cli 3.1.1 → 3.1.2

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 (2) hide show
  1. package/README.md +20 -21
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -74,7 +74,7 @@ multi-org store as the active org (no re-login).
74
74
 
75
75
  | Command | Purpose |
76
76
  | ------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
77
- | `kody install` | Detect running local MCP clients, write their config, and start host OAuth. **Recommended long-term path.** |
77
+ | `kody install` | Detect running local MCP clients and write their remote MCP config. The host client starts OAuth when the user connects. **Recommended long-term path.** |
78
78
  | `kody skill install` | Installs the hosted `kody-cli` skill (or the bundled stub offline) into Claude Code / Cursor / Codex / `.agents`. Later CLI runs refresh stale copies by digest. |
79
79
  | `kody login` | Browser OAuth (CIMD + PKCE) for the CLI itself. Adds/replaces one org login (browser picker, or `kody login --org acme`) and keeps other org logins. |
80
80
  | `kody org list` | Lists logged-in orgs and marks the active one. `--json` for agents. |
@@ -82,7 +82,7 @@ multi-org store as the active org (no re-login).
82
82
  | `kody logout` | Removes the active org login (or `--org <slug>` for one org) and clears a stored bootstrap/API token when appropriate. |
83
83
  | `kody status` | Shows CLI login / stored API token state without printing secrets. |
84
84
  | `kody auth bootstrap --code` | Redeems a one-shot `kody_bc_…` from MCP `cliCredentialBootstrap` and stores the resulting `kody_at_…` for `execute --local` (never prints the token). |
85
- | `kody auth bootstrap --scopes` | Opt-in extra scopes: mints the code itself by passing `scopes` to `cliCredentialBootstrap` (with `--token`, else the `kody login` session, else a stored token), then redeems and stores it. See [Opt-in scopes](#opt-in-scopes). |
85
+ | `kody auth bootstrap --scopes` | Replaces the default bootstrap scope list (include every scope you need): mints the code itself by passing `scopes` to `cliCredentialBootstrap` (with `--token`, else the `kody login` session, else a stored token), then redeems and stores it. See [Opt-in scopes](#opt-in-scopes). |
86
86
  | `kody auth setup-git` | Installs a Git credential helper for `https://kody.codes/@owner/name.git` (persistent `kody_at_…`, user-owned token with `package:read`/`package:write`). See [Git HTTPS](#git-https-setup-git). |
87
87
  | `kody auth remove-git` | Inverse of `setup-git`: clears Kody HTTPS git helpers, revokes the stored API token, deletes it from the keychain. Leaves `kody login` alone. |
88
88
  | `kody git-credential` | Credential helper invoked by Git after `setup-git` (`get` / `store` / `erase`). |
@@ -90,7 +90,7 @@ multi-org store as the active org (no re-login).
90
90
  | `kody search [query]` | Calls Kody `search` from the CLI (prefer the host MCP tool). Token-only auth uses Open API `GET /v1/search`. |
91
91
  | `kody api <operationId>` | Thin Open API wrapper matching the MCP `api` tool: `operationId` + flat `--params` JSON. Auth: `--token` / `KODY_API_TOKEN` / stored `auth bootstrap` token. The parsed `/openapi.json` route map is cached under the Kody cache dir keyed by the document's `ETag` and revalidated with `If-None-Match` on each run. |
92
92
  | `kody package publish` | Thin wrapper for `packagePublishExternalPush`. Optional positional `@owner/leaf`, bare leaf name, or package UUID (names are resolved to the package UUID via `packageList`); extra fields via `--params`. Same auth as `kody api`. Prints the API JSON. Exit **0** for `published`, `already_published` (including `artifacts_rebuilt: true`), and `dispatched` (poll `workflowRunList({ workflow_id })`). Exit **1** for refusal/rejection statuses (`checks_failed`, `locked`, `approval_required`, `not_fast_forward`) with the API `message` (or a checks summary) on stderr, like npm. Auth / permission / network failures also exit 1; `--json` adds `{ error, message, sent }` on stdout for network errors (`sent: false` = not sent; `sent: "unknown"` = maybe sent — prefer `kody api workflowRunList` with `workflow_id` when known, otherwise a recent list, before retry). Re-publishing the same commit is safe (durable dedupe / `already_published`). |
93
- | `kody package collaborators` / `grant` / `revoke` | Who can use one package, and add or remove teams and members of the org (`--org`). `<package>` is `@owner/leaf`, the kody id, or the package id. `grant <package> --team <slug>\|--user <username> [--preset use\|contribute\|manage]` (default `use`) adds or changes a collaborator via `packageCollaboratorSet`; people outside the org are refused. `revoke <package> --team\|--user\|--grant <grant_id>` removes one via `packageCollaboratorRemove`. Needs Manage on the package and a token with `package:manage_access` (`auth bootstrap --scopes …,package:manage_access`). Prints a summary, or JSON with `--json`. |
93
+ | `kody package collaborators` / `grant` / `revoke` | Who can use one package, and add or remove teams and members of the org (`--org`). `<package>` is `@owner/leaf`, the name leaf, or the package id. `grant <package> --team <slug>\|--user <username> [--preset use\|contribute\|manage]` (default `use`) adds or changes a collaborator via `packageCollaboratorSet`; people outside the org are refused. `revoke <package> --team\|--user\|--grant <grant_id>` removes one via `packageCollaboratorRemove`. Needs Manage on the package and a token with `package:manage_access` (`auth bootstrap --scopes …,package:manage_access`). Prints a summary, or JSON with `--json`. |
94
94
  | `kody execute` | Calls Kody `execute` from the CLI (`--invoke`, `--code`, `--file`, or stdin via `--file -`). With a scoped API token and no login (or with `--token`), cloud execute goes through CapabilityProxy → `kody.execute` — no `kody login`. Add `--local` to run the module (and static `kody:@…` package modules) on this machine instead. `--credential key=name` (repeatable; `org:name` / `personal:name` / empty `=` for none) picks ADR 0068 credentials for `--local` or a `kody login` MCP session. `--allow-private-network` opts local execution into private and local network access. `--target prod\|mock` (default `prod`) sends CapabilityProxy / search hops to prod or the built-in CLI mock; `--target mock` implies local workerd. |
95
95
  | `kody dev` | Local testing for unpublished packages. Serves `kody.app.entry` on localhost via workerd with hot reload. Subcommands: `fetch`, `job`, `webhook`, `emit`, `check`. Default `--target mock` (scratch storage, fake credentials). Covers exports, webhooks, schedules (run-once), and subscriptions. See [Local package testing](#local-package-testing-kody-dev). |
96
96
 
@@ -112,7 +112,7 @@ you pass `--token` explicitly):
112
112
  ```bash
113
113
  # Preferred for agents on MCP (no tokenCreate, no second OAuth):
114
114
  # 1. MCP api / kody.cliCredentialBootstrap → { bootstrap_code, cli_command }
115
- npx @kodycodes/cli auth bootstrap --code 'kody_bc_…'
115
+ npx @kodycodes/cli auth bootstrap --code 'kody_bc_…' --lifetime short
116
116
  npx @kodycodes/cli execute --local --file ./task.js
117
117
 
118
118
  export KODY_API_TOKEN=… # scopes: local-execute (+ search:read for search)
@@ -136,10 +136,9 @@ npx @kodycodes/cli api usageGet --params '{}'
136
136
  `https://api.kody.codes` and `https://kody.codes/mcp`; preview workers pair
137
137
  when the API worker name adds `-api`, and loopback hosts pair at any port. For
138
138
  a different API origin, use `auth bootstrap --api-url <origin>` or set
139
- `KODY_API_TOKEN`. The Open API must accept that OAuth bearer on
140
- CapabilityProxy / package-graph
141
- ([kody-hq/kody#2812](https://github.com/kody-hq/kody/issues/2812)); until then
142
- use bootstrap or a scoped `kody_at_…` token.
139
+ `KODY_API_TOKEN`. Paired `kody login` OAuth is accepted as Bearer on
140
+ CapabilityProxy and package-graph. Unpaired API origins need bootstrap or a
141
+ scoped `kody_at_…` token.
143
142
  - Wrong/expired token → 401 with the same agent-first not-authenticated guidance
144
143
  (or the OAuth platform-gap message when the bearer is login OAuth).
145
144
  - Wrong scopes → the error names the missing scope and the exact command to mint
@@ -153,8 +152,9 @@ npx @kodycodes/cli api usageGet --params '{}'
153
152
 
154
153
  ## Opt-in scopes
155
154
 
156
- Bootstrap tokens default to least-privilege local-execute scopes (no
157
- `package:write`, for example). Opt in to more when a task needs them:
155
+ Bootstrap tokens default to local-execute use scopes plus `package:write`,
156
+ `package:create`, and `token:delete`. They do not include `search:read`. Pass
157
+ `--scopes` when a task needs a different set (the list replaces the defaults):
158
158
 
159
159
  ```bash
160
160
  # After `kody login` (mints any scope your org role grants):
@@ -373,7 +373,7 @@ npx @kodycodes/cli login
373
373
  npx @kodycodes/cli execute --local --file ./task.js --params '{"to":"me@example.com"}'
374
374
 
375
375
  # Agents on MCP: bootstrap code → store (no tokenCreate, no second OAuth):
376
- npx @kodycodes/cli auth bootstrap --code 'kody_bc_…'
376
+ npx @kodycodes/cli auth bootstrap --code 'kody_bc_…' --lifetime short
377
377
  npx @kodycodes/cli execute --local --file ./task.js --params '{"to":"me@example.com"}'
378
378
 
379
379
  # Or a scoped API token (still wins over login / bootstrap store when set):
@@ -393,10 +393,9 @@ npx @kodycodes/cli execute --local --invoke kody:@scope/pkg/export --params '{"n
393
393
  never printed, never exchanged via `tokenCreate`). Prefer the env var for API
394
394
  tokens so they stay out of shell history and `ps`. The bearer stays in the CLI
395
395
  process; the sandbox only talks to a loopback bridge. Host MCP OAuth from
396
- other clients is never read. Until
397
- [kody-hq/kody#2812](https://github.com/kody-hq/kody/issues/2812) ships,
398
- login-only Bearer is rejected by the Open API — use bootstrap or a `kody_at_…`
399
- token in that case.
396
+ other clients is never read. Paired `kody login` OAuth is accepted as Bearer
397
+ on CapabilityProxy and package-graph. Unpaired API origins need bootstrap or a
398
+ `kody_at_…` token.
400
399
  - **Node.js:** 22 or newer (`package.json` `engines` is `>=22`). Older Node
401
400
  fails immediately with that requirement, before workerd is downloaded or
402
401
  started.
@@ -420,12 +419,12 @@ npx @kodycodes/cli execute --local --invoke kody:@scope/pkg/export --params '{"n
420
419
  each runtime call. CapabilityProxy requests go through Node's own
421
420
  `node:http(s)` client with one keep-alive connection and a 7-minute idle limit
422
421
  for headers and body chunks. Origin's 5-minute deadline for a `fetch` with
423
- `{{secret:…}}` placeholders ends that call first, with its own error. Node's
424
- default 300-second fetch limit no longer cuts it short. With
425
- `NODE_USE_ENV_PROXY=1` or `--use-env-proxy`, these requests honor `HTTP_PROXY`
426
- / `HTTPS_PROXY` / `NO_PROXY` like Node's own fetch (Node 22.21 / 24.5 or
427
- later; older Node fails with a clear error instead of silently bypassing the
428
- proxy). A PR preview's API host is
422
+ `{{secret:…}}` placeholders ends that call first, with its own error. The
423
+ client idle timeout is 7 minutes, so Node's default 300-second fetch limit
424
+ does not apply. With `NODE_USE_ENV_PROXY=1` or `--use-env-proxy`, these
425
+ requests honor `HTTP_PROXY` / `HTTPS_PROXY` / `NO_PROXY` like Node's own fetch
426
+ (Node 22.21 / 24.5 or later; older Node fails with a clear error instead of
427
+ silently bypassing the proxy). A PR preview's API host is
429
428
  `https://kody-pr-<n>-api.<subdomain>.workers.dev`; the app origin
430
429
  (`kody-pr-<n>`) answers `/v1/*` with an HTML 404.
431
430
  - **Errors:** an expired/revoked token or an account without the `local-execute`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kodycodes/cli",
3
- "version": "3.1.1",
3
+ "version": "3.1.2",
4
4
  "description": "Official Kody CLI: login, secure token storage, search, and execute over the OpenAPI.",
5
5
  "type": "module",
6
6
  "bin": {