@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 CHANGED
@@ -1,173 +1,89 @@
1
1
  # Ando CLI
2
2
 
3
- `ando` provides agent-first terminal commands for Ando. It is built on the
4
- public `@andocorp/sdk` package and authenticates with an Ando API key.
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 --api-key ando_sk_...
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
- You can also set `ANDO_API_KEY` for one-off or CI usage.
47
-
48
- Set `ANDO_KEYRING=0` to use file-based auth instead of the system keyring. In
49
- that mode the API key is stored in `auth.json` under the Ando config directory.
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
- - `--base-url`: login and SDK REST base URL
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
- Check local auth health or remove local credentials:
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
- ando doctor
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
- `ando whoami` prints the member and workspace resolved by the active API key.
70
- `ando logout` revokes browser-created CLI credentials before removing local auth
71
- state. API keys supplied manually or through `ANDO_API_KEY` remain local-only.
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
- ## Commands
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
- The raw public API escape hatch mirrors the generated Ando API surface. It is
76
- useful for scripts and agents that need an endpoint before a dedicated CLI
77
- workflow exists.
40
+ ## Keys
78
41
 
79
- ```sh
80
- ando api ls
81
- ando api ls --json
82
- ando api searchMessages q==incident mode==semantic
83
- ando api getMember memberId=<member-id>
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
- `ando api` accepts `name==value` query parameters, `Header:Value` declared
94
- request headers, `field=value` JSON string body fields, `field:=json` typed JSON
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
- Webhook endpoint and delivery commands cover the same SDK webhook management
101
- surface with human-readable output by default and `--json` for scripts.
51
+ ## Behaviour
102
52
 
103
- ```sh
104
- ando webhooks endpoints list
105
- ando webhooks endpoints create \
106
- --url https://example.com/ando/webhooks \
107
- --events webhook.test,message.created \
108
- --name "Development receiver" \
109
- --include-direct-messages
110
- ando webhooks endpoints get <endpoint-id> --json
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
- Endpoint creation and secret rotation print one-time signing secrets in the
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
- ```sh
131
- ando messages --channel engineering --limit 10
132
- ando messages -c engineering -m 10
133
- ando messages --dm alex --before <cursor> --json
134
- ando messages --conversation <conversation-id>
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
- ```sh
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
- ```sh
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
- ando thread <thread-root-message-id>
155
- ando thread <thread-root-message-id> --limit 50 --after <cursor>
156
- ando thread -m <message-id> --json
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
- Every agent-first command supports `--json` for machine-readable output.
160
- Without `--json`, commands print tab-separated rows.
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
- Flags take precedence over environment variables, and environment variables
173
- take precedence over saved config.
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.