@divergeai/cli 0.1.27 → 0.1.29
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.
- package/README.md +66 -21
- package/dist/diverge.mjs +1059 -938
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -6,8 +6,8 @@ model gateway, and call platform tools as yourself.
|
|
|
6
6
|
```bash
|
|
7
7
|
npm install -g @divergeai/cli
|
|
8
8
|
diverge login # browser sign-in; the organization is chosen afterwards in the CLI
|
|
9
|
+
diverge dsh # DeepSeek Harness on the gateway, up to date, with your skills
|
|
9
10
|
diverge agents setup claude # Claude Code on the gateway
|
|
10
|
-
diverge agents run dsh -- --profile web --port 3131 --no-open
|
|
11
11
|
diverge tools list --organization-id <id>
|
|
12
12
|
```
|
|
13
13
|
|
|
@@ -50,11 +50,16 @@ platform grants it only where your roles back the login's scopes.
|
|
|
50
50
|
`status`, `Acting as:` before every `tools` request — because a token
|
|
51
51
|
names only a user id and the wrong account is invisible without the email:
|
|
52
52
|
use the operator account for operator work, and the break-glass account
|
|
53
|
-
only knowingly.
|
|
53
|
+
only knowingly. The `Organization:` and `Acting as:` lines go to stderr, so
|
|
54
|
+
a pipe receives only the command's output and `--json` is the document
|
|
55
|
+
alone.
|
|
54
56
|
- A login is for one account. `diverge login --as <email>` tells the platform
|
|
55
57
|
which one; it signs that account in instead of reusing whatever session the
|
|
56
58
|
browser holds and issues nothing to any other. Without `--as` the account
|
|
57
|
-
of the last login is kept, so switching accounts is always explicit
|
|
59
|
+
of the last login is kept, so switching accounts is always explicit: a
|
|
60
|
+
browser that signs in any other account is refused and the login, shared
|
|
61
|
+
by every session on the machine, is left as it was. A second identity
|
|
62
|
+
beside it gets its own `DIVERGE_HOME`.
|
|
58
63
|
- Without `--scopes` a login asks for the scopes the platform registers for
|
|
59
64
|
this CLI — everything it and Forge use — and holds what your roles grant,
|
|
60
65
|
so a routine re-login never narrows what another session relies on. The
|
|
@@ -96,13 +101,38 @@ the gateway, keeping everything else in the file:
|
|
|
96
101
|
| `claude` | `~/.claude/settings.json` (or `./.claude/settings.local.json` with `--scope project`): the gateway base URL and `diverge token` as the key helper; `--project-id` adds the project header, `--model-discovery` lets Claude Code list the gateway's models |
|
|
97
102
|
| `opencode` | `~/.config/opencode/opencode.json`: a `divergent-<surface>` provider reading `DIVERGENT_TOKEN` |
|
|
98
103
|
| `codex` | `~/.codex/config.toml`: a `divergent` provider block with `diverge token` as its auth command; `--print` shows it instead |
|
|
99
|
-
| `dsh` | `$DSH_HOME/divergent-<surface>.yml`: a patch overlay with the models the gateway serves, each with the input, context window and output cap the gateway lists for it, dsh's DeepSeek adapter, telemetry upload and vendor search turned off, a shell command budget raised from dsh's 60 s to the CLI's own request ceiling so a platform tool call is never cut off before the platform answers, and Chrome DevTools MCP on port 9222; the Divergent agent preset; and your skills in `$DSH_HOME/skills`, through which the agent reaches every platform tool, web search included, from dsh's shell with `diverge tools` |
|
|
100
104
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
dsh
|
|
105
|
+
### dsh
|
|
106
|
+
|
|
107
|
+
`diverge dsh` is the one command for DeepSeek Harness; dsh needs no setup and
|
|
108
|
+
no install of its own. With nothing else it starts dsh's web UI and prints the
|
|
109
|
+
URL; `diverge dsh -- "<task>"` answers one task headless and exits; anything
|
|
110
|
+
after `--` goes to dsh as given. Each launch, in order:
|
|
111
|
+
|
|
112
|
+
1. updates the CLI when a newer release exists and restarts on it. A registry
|
|
113
|
+
that does not answer or an install that fails warns and goes on;
|
|
114
|
+
`DIVERGE_NO_UPDATE_CHECK=1` skips this.
|
|
115
|
+
2. signs in if the login does not serve the gateway.
|
|
116
|
+
3. installs the dsh release this CLI is tested with, once per release, under
|
|
117
|
+
`$DIVERGE_HOME/harness/dsh/<version>`: about a minute and nearly 1 GB, and
|
|
118
|
+
Node 24.9 or later. A dsh you installed yourself is neither used nor touched.
|
|
119
|
+
A version no launch has used for a week is deleted.
|
|
120
|
+
4. brings your skills up to date in `$DSH_HOME/skills`.
|
|
121
|
+
5. writes the overlay `$DSH_HOME/divergent-<surface>.yml`: the models the
|
|
122
|
+
gateway serves, each with the input, context window and output cap the
|
|
123
|
+
gateway lists for it; dsh's DeepSeek adapter, telemetry upload and vendor
|
|
124
|
+
search turned off, in the shipped agent presets too; a shell command budget
|
|
125
|
+
raised from dsh's 60 s to the CLI's own request ceiling so a platform tool
|
|
126
|
+
call is never cut off before the platform answers; and Chrome DevTools MCP
|
|
127
|
+
on port 9222. The agent reaches every platform tool, web search included,
|
|
128
|
+
from dsh's shell with `diverge tools`.
|
|
129
|
+
6. starts dsh, keeps its token fresh in dsh's own credentials file until it
|
|
130
|
+
exits, and records the session as the organization's own (ADR 0121).
|
|
131
|
+
|
|
132
|
+
The CLI runs only the dsh release it is tested with, because dsh's configuration
|
|
133
|
+
and session log change between its pre-releases. A weekly job proposes the next
|
|
134
|
+
release, CI runs it for real on the overlay, and the merged change reaches you
|
|
135
|
+
as a CLI update on your next launch.
|
|
106
136
|
|
|
107
137
|
The session runs on its own token, not on your login. The CLI keeps
|
|
108
138
|
`$DSH_HOME/session-token` fresh beside the credentials file, and writes
|
|
@@ -171,7 +201,7 @@ every call instead of depending on the machine's default organization.
|
|
|
171
201
|
Nobody runs the install by hand after the first time: `diverge login`
|
|
172
202
|
installs, and a session start refreshes — `agents setup claude` writes a
|
|
173
203
|
SessionStart hook into Claude Code's user settings, a Divergent checkout
|
|
174
|
-
refreshes from its worktree setup for every harness, and `
|
|
204
|
+
refreshes from its worktree setup for every harness, and `diverge dsh`
|
|
175
205
|
refreshes before dsh starts. A refresh is per organization: it
|
|
176
206
|
replaces that organization's folders, retires the ones it stopped serving,
|
|
177
207
|
and never touches another organization's or a skill you authored beside
|
|
@@ -192,6 +222,19 @@ command in a fresh sandbox. Its tool definitions ride on every request
|
|
|
192
222
|
(about 5k tokens, cached after the first). Without a Chrome on the port the
|
|
193
223
|
server waits; the first tool call connects.
|
|
194
224
|
|
|
225
|
+
dsh runs the repository's hooks. Started inside a git checkout whose root
|
|
226
|
+
holds a Claude Code hook config (`.claude/settings.json`), `diverge dsh`
|
|
227
|
+
mounts dsh's own hook bridge (`@deepseek-ai/dsh-hooks-claude-code`, installed
|
|
228
|
+
beside the harness) on that file, and says so at launch; anywhere else
|
|
229
|
+
nothing is mounted. The bridge reads the file once at start and runs each
|
|
230
|
+
command hook at the matching moment: session start, prompt, tool use, stop.
|
|
231
|
+
Three things differ from Claude Code, and a hook meant for both allows for
|
|
232
|
+
them: a hook runs inside dsh's sandbox (the working directory is writable,
|
|
233
|
+
the home directory is not, `/tmp` does not outlive the command); context is
|
|
234
|
+
read only as JSON (`hookSpecificOutput.additionalContext`), never as plain
|
|
235
|
+
output; and a stop hook is never told the stop was already continued, so it
|
|
236
|
+
keeps its own record of what it held for.
|
|
237
|
+
|
|
195
238
|
## Platform tools
|
|
196
239
|
|
|
197
240
|
Every command takes the scope it acts in: `--organization-id` (or
|
|
@@ -201,7 +244,7 @@ resource inside a project, `--project-id` (or `DIVERGENT_PROJECT_ID`).
|
|
|
201
244
|
|
|
202
245
|
```bash
|
|
203
246
|
diverge tools list --filter rbac # find candidates by name or description
|
|
204
|
-
diverge tools describe
|
|
247
|
+
diverge tools describe rbac_update_role # one schema, on demand
|
|
205
248
|
diverge tools call rbac_list_roles --args-json '{}'
|
|
206
249
|
diverge tools call rbac_list_roles --json # exactly one JSON outcome on stdout, errors included
|
|
207
250
|
diverge tools call inventory_lookup_stock --args-file args.json # or --args-json - to read stdin
|
|
@@ -253,18 +296,19 @@ reaches it through your bridge binding. See
|
|
|
253
296
|
[RFC: Tenant Plugins](../../docs/rfcs/rfc-tenant-plugins.md).
|
|
254
297
|
|
|
255
298
|
```bash
|
|
256
|
-
diverge plugins validate manifest.json #
|
|
257
|
-
diverge plugins publish manifest.json #
|
|
299
|
+
diverge plugins validate manifest.json # forge_validate_plugin: every problem at once, and whether publishing needs a decision
|
|
300
|
+
diverge plugins publish manifest.json # forge_publish_plugin, raised as you; a person decides in Compass; exits 3 while it waits
|
|
258
301
|
diverge plugins list
|
|
259
|
-
diverge plugins retire <pluginId> # the descriptor and its tools go
|
|
302
|
+
diverge plugins retire <pluginId> # forge_retire_plugin, raised as you; the descriptor and its tools go, installations stay
|
|
260
303
|
```
|
|
261
304
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
305
|
+
Every write is a tool invocation decided by the organization's policy
|
|
306
|
+
(ADR 0124): `publish` and `retire` print the invocation and its Compass link
|
|
307
|
+
and exit 3 while they wait; read the outcome with
|
|
308
|
+
`diverge tools invocation <id>`. Tools are pinned to the manifest: a change
|
|
309
|
+
is a new version published again. A version that only reshapes or removes
|
|
310
|
+
the tools already served is what the deploy pipeline stores unattended with
|
|
311
|
+
`forge_reshape_plugin`; `validate` says which publish a version needs.
|
|
268
312
|
After publishing, enable the plugin with `forge_set_plugin_state` (or the
|
|
269
313
|
Forge Routing page) and bind the runtime with a bridge binding whose
|
|
270
314
|
`runtimeType` equals the manifest's `runtime.type`; declare `networkPolicy`
|
|
@@ -278,6 +322,7 @@ version in the background and caches the answer under `$DIVERGE_HOME`; the
|
|
|
278
322
|
next command prints one line on stderr when a newer release exists. Nothing
|
|
279
323
|
waits on the network for it, and it stays quiet in the bridge, in
|
|
280
324
|
non-interactive shells, under `CI`, and with `DIVERGE_NO_UPDATE_CHECK=1`.
|
|
325
|
+
`diverge dsh` does not wait for the notice: it updates before it launches.
|
|
281
326
|
|
|
282
327
|
## Environment
|
|
283
328
|
|
|
@@ -289,7 +334,7 @@ non-interactive shells, under `CI`, and with `DIVERGE_NO_UPDATE_CHECK=1`.
|
|
|
289
334
|
| `DIVERGENT_CLIENT_ID`, `DIVERGENT_CLIENT_SECRET`, `DIVERGENT_USER_ID` | unattended tool execution with service credentials, delegated to that person |
|
|
290
335
|
| `DIVERGENT_TOKEN_FILE` | a file holding the token this session runs on, in place of any login (see Session token) |
|
|
291
336
|
| `DSH_HOME` | where dsh keeps its files, default `~/.dsh` |
|
|
292
|
-
| `DIVERGE_NO_UPDATE_CHECK` | set to skip the once-a-day check for a newer release |
|
|
337
|
+
| `DIVERGE_NO_UPDATE_CHECK` | set to skip the once-a-day check for a newer release, and the update at a `diverge dsh` launch |
|
|
293
338
|
|
|
294
339
|
## Security
|
|
295
340
|
|