@andocorp/cli 0.3.1 → 0.5.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.
- package/README.md +62 -146
- package/dist/cli.js +17053 -0
- package/package.json +24 -27
- package/LICENSE +0 -21
- package/dist/agent-commands.js +0 -297
- package/dist/api-command.js +0 -212
- package/dist/api-inputs.js +0 -223
- package/dist/api-operations.js +0 -344
- package/dist/args.js +0 -71
- package/dist/auth-commands.js +0 -362
- package/dist/cli-helpers.js +0 -67
- package/dist/cli-login-browser.js +0 -60
- package/dist/cli-login-errors.js +0 -10
- package/dist/cli-login-paths.js +0 -8
- package/dist/cli-login-revoke.js +0 -100
- package/dist/cli-login.js +0 -335
- package/dist/client.js +0 -104
- package/dist/commands.js +0 -155
- package/dist/config-credential-metadata.js +0 -68
- package/dist/config-keyring.js +0 -61
- package/dist/config-logout-credentials.js +0 -171
- package/dist/config-paths.js +0 -41
- package/dist/config-types.js +0 -1
- package/dist/config.js +0 -333
- package/dist/format.js +0 -297
- package/dist/help.js +0 -84
- package/dist/index.js +0 -101
- package/dist/output.js +0 -7
- package/dist/session.js +0 -58
- package/dist/timeouts.js +0 -1
- package/dist/types.js +0 -1
- package/dist/watch-commands.js +0 -121
- package/dist/webhook-commands.js +0 -360
package/README.md
CHANGED
|
@@ -1,173 +1,89 @@
|
|
|
1
1
|
# Ando CLI
|
|
2
2
|
|
|
3
|
-
`ando`
|
|
4
|
-
public `@andocorp/sdk`
|
|
5
|
-
|
|
6
|
-
## Installation
|
|
7
|
-
|
|
8
|
-
```sh
|
|
9
|
-
npm install -g @andocorp/cli
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
Or run without installing:
|
|
13
|
-
|
|
14
|
-
```sh
|
|
15
|
-
npx @andocorp/cli
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Authentication
|
|
19
|
-
|
|
20
|
-
Log in once:
|
|
21
|
-
|
|
22
|
-
```sh
|
|
23
|
-
ando login
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
The command opens a browser authorization page, prints a verification code to
|
|
27
|
-
confirm in the browser, and stores the returned API key in the system keyring
|
|
28
|
-
by default. Non-secret metadata is stored at `~/.config/ando/config.json`.
|
|
29
|
-
|
|
30
|
-
For remote shells or agents that cannot open a browser directly, start a
|
|
31
|
-
two-step login:
|
|
32
|
-
|
|
33
|
-
```sh
|
|
34
|
-
ando login --no-browser
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
Open the printed URL, confirm the verification code, then run the printed
|
|
38
|
-
`ando login poll` command in the original shell to finish authentication.
|
|
39
|
-
|
|
40
|
-
For headless scripts and CI, provide an API key directly:
|
|
3
|
+
`ando` posts to Ando channels and asks Ando agents from a shell. It uses the
|
|
4
|
+
public API through `@andocorp/sdk` and an Ando API key.
|
|
41
5
|
|
|
42
6
|
```sh
|
|
43
|
-
ando login
|
|
7
|
+
ando login # paste a key at a hidden prompt
|
|
8
|
+
ando send '#deploys' "v41 is out"
|
|
9
|
+
pytest 2>&1 | ando send '#ci' --code # standard input, as a code block
|
|
10
|
+
ando send '#deploys' "rolled back" --thread <message-id>
|
|
11
|
+
ando ask @release-agent "what shipped since Friday?" --in '#releases'
|
|
44
12
|
```
|
|
45
13
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
Set `ANDO_HOME` to override the config and auth state directory; otherwise the
|
|
51
|
-
CLI uses the platform config directory.
|
|
52
|
-
|
|
53
|
-
Optional endpoint flags:
|
|
14
|
+
`send` prints a link to the message. `ask` posts the question with the agent
|
|
15
|
+
mentioned, waits for the agent's first reply in that message's thread and
|
|
16
|
+
prints the reply's text; the question and reply stay in the thread for the
|
|
17
|
+
team. `--json` prints the API's message object instead, for scripts.
|
|
54
18
|
|
|
55
|
-
|
|
56
|
-
- `--api-host`: public API base URL for agent-first commands
|
|
57
|
-
- `--realtime-host`: realtime host for SDK subscriptions
|
|
19
|
+
## Let your agents work on a server
|
|
58
20
|
|
|
59
|
-
|
|
21
|
+
In the repository agents should work in, run this and approve the link it prints,
|
|
22
|
+
on any device. The server connects out to Ando: you open no ports and share no
|
|
23
|
+
SSH keys.
|
|
60
24
|
|
|
61
25
|
```sh
|
|
62
|
-
|
|
63
|
-
ando doctor --json
|
|
64
|
-
ando whoami
|
|
65
|
-
ando whoami --json
|
|
66
|
-
ando logout
|
|
26
|
+
npx -y @andocorp/cli up
|
|
67
27
|
```
|
|
68
28
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
29
|
+
Each task works in its own checkout under `~/.ando-tasks`, on its own branch, so
|
|
30
|
+
your folder is never touched. `up` keeps the connector running in the background
|
|
31
|
+
and starts it again after a restart. Run it again in another repository to add
|
|
32
|
+
that one. `ando status`, `logs`, `update` and `stop` manage it, and `ando attach`
|
|
33
|
+
opens a task's session in your terminal. In a container, `up` stays in the
|
|
34
|
+
foreground: keep `~/.config/ando` on a volume to reconnect without approving again.
|
|
72
35
|
|
|
73
|
-
|
|
36
|
+
Tasks run as the account that started it, so use one with only what agents need.
|
|
37
|
+
Linux tasks run in Claude Code, which needs `bubblewrap` and `socat`; `ando up`
|
|
38
|
+
says if anything is missing, or if Ubuntu is stopping the sandbox.
|
|
74
39
|
|
|
75
|
-
|
|
76
|
-
useful for scripts and agents that need an endpoint before a dedicated CLI
|
|
77
|
-
workflow exists.
|
|
40
|
+
## Keys
|
|
78
41
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
ando
|
|
82
|
-
|
|
83
|
-
ando
|
|
84
|
-
ando api /v1/search/messages q==incident mode==semantic
|
|
85
|
-
ando api /v1/conversations/<conversation-id>/messages \
|
|
86
|
-
markdown_content="hello" \
|
|
87
|
-
Idempotency-Key:<key>
|
|
88
|
-
echo '{"markdown_content":"hello"}' | ando api /v1/conversations/<conversation-id>/messages --data -
|
|
89
|
-
ando api /v1/search/messages --help
|
|
90
|
-
ando api /v1/search/messages --spec
|
|
91
|
-
```
|
|
42
|
+
Create a key in Ando's settings with the `messages:read` and `messages:write`
|
|
43
|
+
scopes. The key posts as its member, and that member must belong to the
|
|
44
|
+
channel. `ando login` checks the key with one read and saves it with the API
|
|
45
|
+
URL to `$XDG_CONFIG_HOME/ando/cli.json` (`~/.config/ando/cli.json` by
|
|
46
|
+
default), readable only by you. Use `ando login --key-stdin` to pipe a key in.
|
|
92
47
|
|
|
93
|
-
`
|
|
94
|
-
|
|
95
|
-
body fields, and `--data <json|->` for complete request bodies. The target can
|
|
96
|
-
be a public path or an operation ID from `ando api ls`; query and header names
|
|
97
|
-
are validated against the generated public API metadata. For operation ID
|
|
98
|
-
targets, supply required path parameters as `name=value`.
|
|
48
|
+
`ANDO_API_KEY`, `ANDO_API_URL` and `ANDO_WEB_URL` override the saved values.
|
|
49
|
+
The key is never printed, including in errors and `--json` output.
|
|
99
50
|
|
|
100
|
-
|
|
101
|
-
surface with human-readable output by default and `--json` for scripts.
|
|
51
|
+
## Behaviour
|
|
102
52
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
ando webhooks endpoints update <endpoint-id> \
|
|
112
|
-
--events webhook.test,message.created \
|
|
113
|
-
--exclude-direct-messages
|
|
114
|
-
ando webhooks endpoints disable <endpoint-id>
|
|
115
|
-
ando webhooks endpoints rotate-secret <endpoint-id> --previous-secret-ttl 3600
|
|
116
|
-
ando webhooks endpoints test <endpoint-id> --watch-delivery
|
|
117
|
-
ando webhooks deliveries list --endpoint <endpoint-id> --status failed
|
|
118
|
-
ando webhooks deliveries replay <delivery-id>
|
|
119
|
-
```
|
|
53
|
+
- A target is `#channel-name` or a conversation id. A name that matches no
|
|
54
|
+
channel, or several, fails and lists the candidates.
|
|
55
|
+
- An agent is matched by handle or display name among agent members.
|
|
56
|
+
- Text over Ando's 40,000-character message limit is refused, not truncated.
|
|
57
|
+
- Each `send` or `ask` uses one `Idempotency-Key`. A timed-out or failed post
|
|
58
|
+
is retried once with the same key, so it cannot post twice.
|
|
59
|
+
- `ask` polls the thread every 3 seconds until `--timeout` (default 120
|
|
60
|
+
seconds). On timeout the question stays posted and the command says where.
|
|
120
61
|
|
|
121
|
-
|
|
122
|
-
plain output. Store the secret before clearing the terminal. Webhook endpoints
|
|
123
|
-
act as the creating member/API member; direct messages are excluded unless
|
|
124
|
-
`--include-direct-messages` is set. For local receiver development, expose the
|
|
125
|
-
local server with a public HTTPS tunnel, create or update the endpoint URL, then
|
|
126
|
-
run `ando webhooks endpoints test <endpoint-id>` to send a `webhook.test`
|
|
127
|
-
event. The CLI does not include a Stripe-style `listen --forward-to` relay
|
|
128
|
-
command unless Ando adds a backend relay for local forwarding.
|
|
62
|
+
## Exit codes
|
|
129
63
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
64
|
+
| Code | Meaning |
|
|
65
|
+
| ---- | ---------------------------------------- |
|
|
66
|
+
| 0 | Success |
|
|
67
|
+
| 1 | Usage error, including oversize input |
|
|
68
|
+
| 2 | Not logged in, key rejected, or no scope |
|
|
69
|
+
| 3 | Channel, agent or message not found |
|
|
70
|
+
| 4 | No reply before `--timeout` |
|
|
71
|
+
| 5 | Network or server error |
|
|
136
72
|
|
|
137
|
-
|
|
138
|
-
ando search "incident"
|
|
139
|
-
ando search "alice" --type members
|
|
140
|
-
ando search "standup" --type conversations
|
|
141
|
-
ando search "launch checklist" --type clipboard
|
|
142
|
-
ando search "migration" --type calls --after 2026-01-01T00:00:00.000Z
|
|
143
|
-
```
|
|
73
|
+
Human output goes to standard output; diagnostics go to standard error.
|
|
144
74
|
|
|
145
|
-
|
|
146
|
-
ando get message <message-id>
|
|
147
|
-
ando get member <member-id>
|
|
148
|
-
ando get clipboard <clipboard-id>
|
|
149
|
-
ando get call <call-id>
|
|
150
|
-
ando get transcript <call-id> --limit 100 --cursor <cursor>
|
|
151
|
-
```
|
|
75
|
+
## Development
|
|
152
76
|
|
|
153
77
|
```sh
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
78
|
+
pnpm --filter @andocorp/sdk run build
|
|
79
|
+
pnpm --filter @andocorp/cli run typecheck
|
|
80
|
+
pnpm --filter @andocorp/cli run test
|
|
81
|
+
pnpm --filter @andocorp/cli run build && node packages/cli/dist/cli.js --help
|
|
157
82
|
```
|
|
158
83
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
## Environment
|
|
163
|
-
|
|
164
|
-
- `ANDO_API_KEY`: API key for SDK and public API requests
|
|
165
|
-
- `ANDO_KEYRING`: set to `0` to use file-based auth instead of keyring
|
|
166
|
-
- `ANDO_HOME`: config and auth state directory
|
|
167
|
-
- `ANDO_BASE_URL`: login and SDK REST base URL
|
|
168
|
-
- `ANDO_API_HOST`: public API base URL for agent-first commands
|
|
169
|
-
- `ANDO_REALTIME_HOST`: realtime host for SDK subscriptions
|
|
170
|
-
- `XDG_CONFIG_HOME`: fallback base directory for config/auth state
|
|
84
|
+
Against a local stack, log in with `--api-url http://127.0.0.1:<convex site
|
|
85
|
+
port>/public-api/v1 --web-url http://dev.ando.so:<web port>`.
|
|
171
86
|
|
|
172
|
-
|
|
173
|
-
|
|
87
|
+
The package is `private` until its npm name is settled: `@andocorp/cli`
|
|
88
|
+
0.3.2 on npm is the earlier Toolkit CLI, which this package does not replace
|
|
89
|
+
command for command.
|