@zocomputer/cli 0.1.0 → 0.1.1
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 +9 -7
- package/dist/generated/commands.js +25 -1
- package/dist/login.js +4 -3
- package/dist/main.js +9 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,15 +3,13 @@
|
|
|
3
3
|
The public Zo CLI signs in through your browser and selects a workspace for
|
|
4
4
|
System API commands. It supports the maintained Node 22, 24 and 26 LTS lines on macOS and Linux;
|
|
5
5
|
see [runtime requirements](../README.md#set-up).
|
|
6
|
-
Version 0.1.0 is a release candidate. Publish it only after the production
|
|
7
|
-
OAuth client and session endpoint are live and the release checks pass.
|
|
8
6
|
|
|
9
7
|
## Install or upgrade
|
|
10
8
|
|
|
11
9
|
After publication, install the versioned package:
|
|
12
10
|
|
|
13
11
|
```sh
|
|
14
|
-
npm install --global @zocomputer/cli@0.1.
|
|
12
|
+
npm install --global @zocomputer/cli@0.1.1
|
|
15
13
|
zo --version
|
|
16
14
|
zo login
|
|
17
15
|
```
|
|
@@ -23,7 +21,7 @@ you run a command.
|
|
|
23
21
|
To test unpublished artifacts, install both tarballs together:
|
|
24
22
|
|
|
25
23
|
```sh
|
|
26
|
-
npm install --global ./zocomputer-system-api-0.1.
|
|
24
|
+
npm install --global ./zocomputer-system-api-0.1.1.tgz ./zocomputer-cli-0.1.1.tgz
|
|
27
25
|
zo --version
|
|
28
26
|
```
|
|
29
27
|
|
|
@@ -80,9 +78,13 @@ workspaces, a terminal prompts for a selection; scripts must supply
|
|
|
80
78
|
person separately from the effective subject in the selected workspace.
|
|
81
79
|
`context list`, `context use` and status refresh that view from the server.
|
|
82
80
|
|
|
83
|
-
`login
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
`login` prints the authorization URL on its own line on stderr, opens your
|
|
82
|
+
browser, and waits for sign-in to finish. You can copy the URL into another
|
|
83
|
+
browser window. The message is dim on interactive terminals and plain when
|
|
84
|
+
redirected, with `--json`, or when `NO_COLOR` is set.
|
|
85
|
+
|
|
86
|
+
`login --no-browser` prints the same URL and waits without opening a browser.
|
|
87
|
+
It is not a device-code login. The browser must reach the CLI's localhost callback.
|
|
86
88
|
|
|
87
89
|
## Tokens and logout
|
|
88
90
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Generated by scripts/generate-commands.mjs. Do not edit.
|
|
2
2
|
export const commandManifest = {
|
|
3
|
-
schemaDigest: "sha256:
|
|
3
|
+
schemaDigest: "sha256:eaaf7ee560e0c39788aab1da5335e7717fc7244b9868589282dadfb6a9ea205d",
|
|
4
4
|
commands: [
|
|
5
5
|
{
|
|
6
6
|
action: "zo.activity.list",
|
|
@@ -249,6 +249,30 @@ export const commandManifest = {
|
|
|
249
249
|
},
|
|
250
250
|
],
|
|
251
251
|
},
|
|
252
|
+
{
|
|
253
|
+
action: "zo.connection.slack.complete_authorization",
|
|
254
|
+
path: ["connection", "slack", "complete-authorization"],
|
|
255
|
+
versions: [
|
|
256
|
+
{
|
|
257
|
+
version: 1,
|
|
258
|
+
description: "Exchange a Slack challenge code and store its service token. Attempts are single-use and expire after ten minutes.",
|
|
259
|
+
inputJson: '{"additionalProperties":false,"properties":{"connection_id":{"maxLength":200,"minLength":1,"title":"Connection Id","type":"string"},"expected_revision":{"exclusiveMinimum":0,"maximum":9007199254740991,"title":"Expected Revision","type":"integer"},"attempt_id":{"maxLength":200,"minLength":1,"title":"Attempt Id","type":"string"},"code":{"maxLength":256,"minLength":1,"title":"Code","type":"string"}},"required":["connection_id","expected_revision","attempt_id","code"],"title":"SlackAuthorizationCompleteInput","type":"object"}',
|
|
260
|
+
resultKind: "inline",
|
|
261
|
+
},
|
|
262
|
+
],
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
action: "zo.connection.slack.start_authorization",
|
|
266
|
+
path: ["connection", "slack", "start-authorization"],
|
|
267
|
+
versions: [
|
|
268
|
+
{
|
|
269
|
+
version: 1,
|
|
270
|
+
description: "Get a Slack service-token authorization command. Requires a workspace owner and a Slack service-token connection.",
|
|
271
|
+
inputJson: '{"additionalProperties":false,"properties":{"connection_id":{"maxLength":200,"minLength":1,"title":"Connection Id","type":"string"},"expected_revision":{"exclusiveMinimum":0,"maximum":9007199254740991,"title":"Expected Revision","type":"integer"}},"required":["connection_id","expected_revision"],"title":"ConnectionTargetInput","type":"object"}',
|
|
272
|
+
resultKind: "inline",
|
|
273
|
+
},
|
|
274
|
+
],
|
|
275
|
+
},
|
|
252
276
|
{
|
|
253
277
|
action: "zo.connection.update",
|
|
254
278
|
path: ["connection", "update"],
|
package/dist/login.js
CHANGED
|
@@ -86,10 +86,11 @@ export async function loginCode(issuer, audience, clientId, options = {}) {
|
|
|
86
86
|
try {
|
|
87
87
|
if (options.signal?.aborted)
|
|
88
88
|
abort();
|
|
89
|
-
else
|
|
89
|
+
else {
|
|
90
90
|
options.announce?.(authorize.href);
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
if (!options.noBrowser)
|
|
92
|
+
void (options.openBrowser ?? openBrowser)(authorize.href).catch(fail);
|
|
93
|
+
}
|
|
93
94
|
return { code: await received, verifier, redirectUri };
|
|
94
95
|
}
|
|
95
96
|
finally {
|
package/dist/main.js
CHANGED
|
@@ -26,7 +26,7 @@ Use --profile to keep separate sign-ins. New profiles use production.
|
|
|
26
26
|
ZO_SYSTEM_API_ACCESS_TOKEN overrides saved credentials; ZO_WORKSPACE_ID selects a workspace.
|
|
27
27
|
`;
|
|
28
28
|
const localHelp = {
|
|
29
|
-
login: "Usage: zo login [--profile <name>] [--workspace <id>] [--no-browser]\nNew profiles use production. Browser consent approves workspaces and identities.\n--no-browser
|
|
29
|
+
login: "Usage: zo login [--profile <name>] [--workspace <id>] [--no-browser]\nPrint the sign-in URL, open your browser, and wait for approval.\nNew profiles use production. Browser consent approves workspaces and identities.\n--no-browser skips opening the browser and still waits for the localhost callback.\nInternal testing: --environment staging explicitly binds a separate profile to staging.\n",
|
|
30
30
|
logout: "Usage: zo logout [--profile <name>] [--local-only]\nRevoke the saved sign-in and pending replaced sign-ins. --local-only removes local credentials without revoking server access.\n",
|
|
31
31
|
auth: "Usage: zo auth status | token [--headers]\nStatus shows the current identity; token explicitly prints an access token.\n",
|
|
32
32
|
"auth status": "Usage: zo auth status [--profile <name>] [--workspace <id>] [--json]\nShow the approving person, sign-in expiry and effective identity in the selected workspace.\n",
|
|
@@ -121,7 +121,14 @@ export async function run(argv = process.argv.slice(2), runtime = {}) {
|
|
|
121
121
|
const login = await auth.login({
|
|
122
122
|
noBrowser: parsed.flags.has("no-browser"),
|
|
123
123
|
signal,
|
|
124
|
-
announce: (url) =>
|
|
124
|
+
announce: (url) => {
|
|
125
|
+
const message = `Open this URL to sign in:\n${url}\n`;
|
|
126
|
+
const dim = stderr.isTTY &&
|
|
127
|
+
!options.json &&
|
|
128
|
+
env.NO_COLOR === undefined &&
|
|
129
|
+
env.TERM !== "dumb";
|
|
130
|
+
stderr.write(dim ? `\u001b[2m${message}\u001b[22m` : message);
|
|
131
|
+
},
|
|
125
132
|
});
|
|
126
133
|
stderr.write(`Sign-in saved for profile ${profile.name}.\n`);
|
|
127
134
|
if (login.cleanupPending)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zocomputer/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Public Zo command line client",
|
|
6
6
|
"bin": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"node": "^22.23.4 || ^24.22.1 || ^26.13.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@zocomputer/system-api": "0.1.
|
|
17
|
+
"@zocomputer/system-api": "0.1.1"
|
|
18
18
|
},
|
|
19
19
|
"publishConfig": {
|
|
20
20
|
"access": "public",
|