@andocorp/cli 0.5.3 → 0.5.4
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 +44 -17
- package/dist/cli.js +1 -1
- package/package.json +12 -1
package/README.md
CHANGED
|
@@ -18,25 +18,52 @@ team. `--json` prints the API's message object instead, for scripts.
|
|
|
18
18
|
|
|
19
19
|
## Let your agents work on a server
|
|
20
20
|
|
|
21
|
-
In the repository agents should work in, run this and approve the link it prints
|
|
22
|
-
|
|
23
|
-
SSH keys.
|
|
21
|
+
In the repository agents should work in, run this and approve the link it prints.
|
|
22
|
+
At a computer with a browser, press Enter to open it; over SSH, open it on any
|
|
23
|
+
device. The server connects out to Ando: you open no ports and share no SSH keys.
|
|
24
24
|
|
|
25
25
|
```sh
|
|
26
26
|
npx -y @andocorp/cli up
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
to
|
|
29
|
+
`up` then runs one small real task to check the machine works, saying what it is
|
|
30
|
+
doing, and keeps the connector running in the background, starting it again
|
|
31
|
+
after a restart. Run it again in another repository to add that one.
|
|
32
|
+
|
|
33
|
+
Each task works in its own checkout under `~/.ando-tasks`, on its own branch,
|
|
34
|
+
made from what you've committed, so your folder is never touched. The checkout
|
|
35
|
+
also brings what git doesn't hold:
|
|
36
|
+
|
|
37
|
+
- gitignored `.env*` files and `.claude/settings.local.json`
|
|
38
|
+
- gitignored symlinks (such as `code -> ../code`); the task may open what they
|
|
39
|
+
link to
|
|
40
|
+
- gitignored paths that `.worktreeinclude` names
|
|
41
|
+
- `node_modules`, `.venv` and `venv` at the top of the repository, copied
|
|
42
|
+
without using more disk where the file system supports it (APFS, Btrfs, XFS)
|
|
43
|
+
|
|
44
|
+
Uncommitted changes to tracked files stay out, and nothing is taken from inside
|
|
45
|
+
an ignored folder unless `.worktreeinclude` names it.
|
|
46
|
+
|
|
47
|
+
| Command | What it does |
|
|
48
|
+
| ------------------------------ | --------------------------------------------------------------------------- |
|
|
49
|
+
| `ando up [--folder <path>...]` | Connect a repository and keep it connected |
|
|
50
|
+
| `ando up --in-place` | Run tasks in the folder itself, not a checkout (`--checkout` switches back) |
|
|
51
|
+
| `ando up --foreground` | Stay in this terminal instead of the background |
|
|
52
|
+
| `ando status [--json]` | What's connected, and recent tasks |
|
|
53
|
+
| `ando logs [-f] [-n <lines>]` | What the connector has been doing |
|
|
54
|
+
| `ando attach [task]` | Open a task's session here, outside its limits |
|
|
55
|
+
| `ando update` | Move to the newest connector; tasks pick up where they left off |
|
|
56
|
+
| `ando stop` | Stop the connector until the next `ando up` |
|
|
57
|
+
|
|
58
|
+
If the account has an `~/.aws` folder, a task's `aws` commands use it, with
|
|
59
|
+
`AWS_PROFILE` and `AWS_REGION` from the shell where you ran `up`. A task can
|
|
60
|
+
refresh single sign-on tokens but cannot change `~/.aws/config` or
|
|
61
|
+
`~/.aws/credentials`.
|
|
62
|
+
|
|
63
|
+
At a terminal, output is coloured and marked by how each step went. Piped
|
|
64
|
+
output, `NO_COLOR` and `ando logs` get plain text. In a container, `up` stays in
|
|
65
|
+
the foreground: keep `~/.config/ando` on a volume to reconnect without approving
|
|
66
|
+
again.
|
|
40
67
|
|
|
41
68
|
Tasks run as the account that started it, so use one with only what agents need.
|
|
42
69
|
Linux tasks run in Claude Code, which needs `bubblewrap` and `socat`; `ando up`
|
|
@@ -89,6 +116,6 @@ pnpm --filter @andocorp/cli run build && node packages/cli/dist/cli.js --help
|
|
|
89
116
|
Against a local stack, log in with `--api-url http://127.0.0.1:<convex site
|
|
90
117
|
port>/public-api/v1 --web-url http://dev.ando.so:<web port>`.
|
|
91
118
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
119
|
+
A merge to main that changes `version` in `package.json` publishes that version
|
|
120
|
+
to npm (`.github/workflows/publish-cli.yml`). Bump `VERSION` in `src/run.ts` in
|
|
121
|
+
the same change.
|
package/dist/cli.js
CHANGED
|
@@ -139,7 +139,7 @@ ${fence}`}function mention(membershipId,name){let label=name.replace(/[|>\n]/gu,
|
|
|
139
139
|
${listCandidates(exact.map(conversation=>`#${conversation.name} ${conversation.id}`))}`):new CliError(ExitCode.notFound,channels.length===0?`No channel named #${name} that this key can see.`:`No channel named #${name}. Similar channels:
|
|
140
140
|
${listCandidates(channels.map(conversation=>`#${conversation.name} ${conversation.id}`))}`)}function agentLabel(member){return member.display_name?`@${member.handle} (${member.display_name})`:`@${member.handle}`}var MAX_MEMBER_LOOKUPS=10;async function agentCandidates(api,name){let query=name.replace(/[-_.]+/gu," ").trim()||name,result=await call("Agent search",api.GET("/search/members",{params:{query:{q:query}}})),hits=result.data?.items??result.items??[];return(await Promise.all(hits.slice(0,MAX_MEMBER_LOOKUPS).map(async hit=>{if(hit.principal_type&&hit.principal_type!=="agent")return null;if(hit.principal_type&&hit.handle)return hit;let id=hit.workspace_membership_id??hit.workspaceMembershipId??hit.id;if(!id)return null;try{return await call("Reading a member",api.GET("/members/{memberId}",{params:{path:{memberId:id}}}))}catch(error){if(error instanceof CliError&&error.exitCode===ExitCode.notFound)return null;throw error}}))).filter(member=>member?.principal_type==="agent")}async function resolveAgent(api,target){let name=target.trim().replace(/^@/u,"");if(!name)throw usageError("Agent name is empty. Use @agent-name.");let agents=await agentCandidates(api,name),wanted=normalize(name),byHandle=agents.filter(member=>normalize(member.handle)===wanted),exact=byHandle.length>0?byHandle:agents.filter(member=>normalize(member.display_name??"")===wanted);if(exact.length===1){let agent=exact[0];return{membershipId:agent.workspace_membership_id,authorIds:new Set([agent.workspace_membership_id,agent.id,agent.membership_id].filter(Boolean)),name:agent.display_name||agent.handle,handle:agent.handle}}throw exact.length>1?new CliError(ExitCode.notFound,`@${name} matches ${exact.length} agents. Use the handle:
|
|
141
141
|
${listCandidates(exact.map(agentLabel))}`):new CliError(ExitCode.notFound,agents.length===0?`No agent named @${name} in this workspace.`:`No agent named @${name}. Similar agents:
|
|
142
|
-
${listCandidates(agents.map(agentLabel))}`)}var systemClock={now:()=>Date.now(),sleep:ms=>new Promise(resolve2=>setTimeout(resolve2,ms))},DEFAULT_POLL_INTERVAL_MS=3e3,hasText=message=>(message.content??"").trim().length>0||message.attachments.length>0||message.image_urls.length>0;async function waitForReply(api,input){let clock=input.clock??systemClock,interval=input.pollIntervalMs??DEFAULT_POLL_INTERVAL_MS,deadline=clock.now()+input.timeoutMs,after,pendingId=null,missingIds=new Set;for(;;){try{if(pendingId)try{let detail=await call("Reading the reply",api.GET("/conversation-messages/{messageId}",{params:{path:{messageId:pendingId}}}));if(hasText(detail.data))return detail.data}catch(error){if(error instanceof CliError&&error.exitCode===ExitCode.notFound){missingIds.add(pendingId),pendingId=null;continue}throw error}else for(;;){let page=await call("Reading thread replies",api.GET("/conversation-messages/{messageId}/replies",{params:{path:{messageId:input.threadRootId},query:{limit:50,...after?{after}:{}}}})),reply=page.data.items.find(message=>!missingIds.has(message.id)&&(input.authorIds.has(message.authorWorkspaceMembershipId)||input.authorIds.has(message.author_id)));if(reply){if(hasText(reply))return reply;pendingId=reply.id;break}let cursor=page.data.page_info.end_cursor??page.data.page_info.next_cursor;if(cursor&&(after=cursor),!page.data.page_info.has_next_page||!cursor)break}}catch(error){if(!(error instanceof TransientApiError))throw error;input.onTransientError?.(error)}let remaining=deadline-clock.now();if(remaining<=0)return null;await clock.sleep(Math.min(interval,remaining))}}var VERSION="0.5.
|
|
142
|
+
${listCandidates(agents.map(agentLabel))}`)}var systemClock={now:()=>Date.now(),sleep:ms=>new Promise(resolve2=>setTimeout(resolve2,ms))},DEFAULT_POLL_INTERVAL_MS=3e3,hasText=message=>(message.content??"").trim().length>0||message.attachments.length>0||message.image_urls.length>0;async function waitForReply(api,input){let clock=input.clock??systemClock,interval=input.pollIntervalMs??DEFAULT_POLL_INTERVAL_MS,deadline=clock.now()+input.timeoutMs,after,pendingId=null,missingIds=new Set;for(;;){try{if(pendingId)try{let detail=await call("Reading the reply",api.GET("/conversation-messages/{messageId}",{params:{path:{messageId:pendingId}}}));if(hasText(detail.data))return detail.data}catch(error){if(error instanceof CliError&&error.exitCode===ExitCode.notFound){missingIds.add(pendingId),pendingId=null;continue}throw error}else for(;;){let page=await call("Reading thread replies",api.GET("/conversation-messages/{messageId}/replies",{params:{path:{messageId:input.threadRootId},query:{limit:50,...after?{after}:{}}}})),reply=page.data.items.find(message=>!missingIds.has(message.id)&&(input.authorIds.has(message.authorWorkspaceMembershipId)||input.authorIds.has(message.author_id)));if(reply){if(hasText(reply))return reply;pendingId=reply.id;break}let cursor=page.data.page_info.end_cursor??page.data.page_info.next_cursor;if(cursor&&(after=cursor),!page.data.page_info.has_next_page||!cursor)break}}catch(error){if(!(error instanceof TransientApiError))throw error;input.onTransientError?.(error)}let remaining=deadline-clock.now();if(remaining<=0)return null;await clock.sleep(Math.min(interval,remaining))}}var VERSION="0.5.4",HELP=`ando \u2014 use Ando from a terminal
|
|
143
143
|
|
|
144
144
|
Usage:
|
|
145
145
|
ando up [--folder <path>...] Let your agents work on this server: connect
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@andocorp/cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"description": "Use Ando from a terminal: post to channels, ask agents, and let agents work on your server.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -13,6 +13,17 @@
|
|
|
13
13
|
"engines": {
|
|
14
14
|
"node": ">=22"
|
|
15
15
|
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"ando",
|
|
18
|
+
"agents",
|
|
19
|
+
"ai-agents",
|
|
20
|
+
"claude-code",
|
|
21
|
+
"codex",
|
|
22
|
+
"mcp",
|
|
23
|
+
"cli",
|
|
24
|
+
"team-chat"
|
|
25
|
+
],
|
|
26
|
+
"homepage": "https://docs.ando.so/docs/external-agents#connect-a-server",
|
|
16
27
|
"repository": {
|
|
17
28
|
"type": "git",
|
|
18
29
|
"url": "git+https://github.com/Ando-Corporation/ando.git",
|