Skip to content

Commit 69a985d

Browse files
committed
chore: release cli v0.1.37
1 parent 94a2424 commit 69a985d

47 files changed

Lines changed: 16729 additions & 1 deletion

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,22 @@
11
# computer-cli
2-
Public mirror of the Agent Computer CLI
2+
3+
Public mirror of the Agent Computer CLI.
4+
5+
## Run with Nix
6+
7+
```bash
8+
nix run github:getcompanion-ai/computer-cli -- --help
9+
nix run github:getcompanion-ai/computer-cli -- --version
10+
```
11+
12+
Install it into your profile with:
13+
14+
```bash
15+
nix profile install github:getcompanion-ai/computer-cli
16+
```
17+
18+
## Other install path
19+
20+
```bash
21+
curl -fsSL https://agentcomputer.ai/install.sh | bash
22+
```

apps/cli/README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# `aicomputer`
2+
3+
CLI for managing computers through the public API.
4+
5+
## Install
6+
7+
```bash
8+
curl -fsSL https://agentcomputer.ai/install.sh | bash
9+
```
10+
11+
Upgrade later with:
12+
13+
```bash
14+
computer upgrade
15+
```
16+
17+
Or run directly from this checkout:
18+
19+
```bash
20+
nix run path:./apps/cli -- --version
21+
```
22+
23+
## Commands
24+
25+
```bash
26+
computer login --api-key <ak_...>
27+
computer login
28+
computer logout
29+
computer whoami
30+
computer claude-login
31+
computer codex-login
32+
computer create my-box
33+
computer ls
34+
computer get my-box
35+
computer power-off my-box
36+
computer power-on my-box
37+
computer image ls
38+
computer image get <image-id>
39+
computer open my-box
40+
computer ssh my-box
41+
computer sync ./my-project
42+
computer ports ls my-box
43+
computer ports publish my-box 3000 --name my-app
44+
computer ports publish my-box 3000 --name my-app --private
45+
# Ports are public by default: the URL is reachable without an access session.
46+
# Pass --private to require an access session (browser login) instead.
47+
computer ports rm my-box 3000
48+
computer rm my-box
49+
```
50+
51+
`computer login` stores a Clerk API key locally or opens the browser login flow.
52+
`computer claude-login` and `computer codex-login` install Claude Code or Codex credentials onto a computer after the CLI is already logged in.
53+
`computer open`, `computer ssh`, and `computer sync` resolve against the current public API.
54+
`computer sync <path>` opens a picker for active SSH-enabled computers and copies the local file or directory into `/home/node/` over `scp`.
55+
The access commands expect local OpenSSH tools such as `ssh` and `scp` to be available in `PATH`.
56+
57+
The CLI is intentionally thin: it reflects the public API primitives and stays
58+
out of legacy app-owned workflows.

apps/cli/package.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "aicomputer",
3+
"version": "0.1.37",
4+
"description": "Computer CLI - manage your Agent Computer computers from the terminal",
5+
"homepage": "https://agentcomputer.ai",
6+
"repository": {
7+
"type": "git",
8+
"url": "git+https://github.com/getcompanion-ai/microagentcomputer.git"
9+
},
10+
"bin": {
11+
"aicomputer": "./dist/index.js",
12+
"agentcomputer": "./dist/index.js",
13+
"computer": "./dist/index.js"
14+
},
15+
"type": "module",
16+
"private": true,
17+
"scripts": {
18+
"build": "tsup --config tsup.config.ts",
19+
"dev": "tsup --config tsup.config.ts --watch",
20+
"package:release": "bash ./scripts/package-release.sh",
21+
"prepack": "npm run build",
22+
"sync:nix": "../../scripts/cli/sync-nix-package.sh",
23+
"test": "npm run build && node --test test/**/*.test.mjs",
24+
"typecheck": "tsc --noEmit"
25+
},
26+
"files": [
27+
"dist",
28+
"scripts",
29+
"package.json",
30+
"README.md"
31+
],
32+
"dependencies": {
33+
"@inquirer/prompts": "^8.3.2",
34+
"@microagentcomputer/public-api-client": "workspace:*",
35+
"chalk": "^5.3.0",
36+
"commander": "^12.1.0",
37+
"open": "^10.1.0",
38+
"ora": "^8.0.1"
39+
},
40+
"devDependencies": {
41+
"@types/node": "^20.0.0",
42+
"tsup": "^8.0.0",
43+
"typescript": "^5.9.3"
44+
}
45+
}

apps/cli/package.nix

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
fetchPnpmDeps,
3+
lib,
4+
nodejs_22,
5+
openssh,
6+
pnpmConfigHook,
7+
pnpm_10,
8+
stdenvNoCC,
9+
}:
10+
11+
let
12+
package = builtins.fromJSON (builtins.readFile ./package.json);
13+
src = lib.fileset.toSource {
14+
root = ../..;
15+
fileset = lib.fileset.unions [
16+
../../package.json
17+
../../pnpm-lock.yaml
18+
../../pnpm-workspace.yaml
19+
../../tsconfig.base.json
20+
../../packages/public-api-client
21+
./.
22+
];
23+
};
24+
in
25+
stdenvNoCC.mkDerivation (finalAttrs: {
26+
pname = package.name;
27+
version = package.version;
28+
inherit src;
29+
30+
pnpmWorkspaces = [
31+
"aicomputer"
32+
"@microagentcomputer/public-api-client"
33+
];
34+
35+
nativeBuildInputs = [
36+
nodejs_22
37+
pnpmConfigHook
38+
pnpm_10
39+
];
40+
41+
pnpmDeps = fetchPnpmDeps {
42+
inherit (finalAttrs) pname version src pnpmWorkspaces;
43+
pnpm = pnpm_10;
44+
fetcherVersion = 3;
45+
hash = "sha256-NtBbn6TZVZSv/1x2ZImAqOSuskmTzv+2qeLGKLykOJc=";
46+
};
47+
48+
buildPhase = ''
49+
runHook preBuild
50+
pnpm --filter aicomputer build
51+
runHook postBuild
52+
'';
53+
54+
installPhase = ''
55+
runHook preInstall
56+
57+
install -d "$out/lib/node_modules/aicomputer"
58+
cp -R apps/cli/dist "$out/lib/node_modules/aicomputer/dist"
59+
cp -R apps/cli/scripts "$out/lib/node_modules/aicomputer/scripts"
60+
install -m644 apps/cli/package.json "$out/lib/node_modules/aicomputer/package.json"
61+
install -m644 apps/cli/README.md "$out/lib/node_modules/aicomputer/README.md"
62+
63+
install -d "$out/bin"
64+
for bin in aicomputer agentcomputer computer; do
65+
cat > "$out/bin/$bin" <<EOF
66+
#!${nodejs_22}/bin/node
67+
process.env.PATH = '${lib.makeBinPath [ openssh ]}:' + (process.env.PATH ?? "");
68+
await import('$out/lib/node_modules/aicomputer/dist/index.js');
69+
EOF
70+
chmod +x "$out/bin/$bin"
71+
done
72+
73+
runHook postInstall
74+
'';
75+
76+
meta = {
77+
description = package.description;
78+
homepage = package.homepage;
79+
mainProgram = "computer";
80+
platforms = lib.platforms.all;
81+
};
82+
})
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Compile CLI binaries for all platforms.
5+
# Requires: bun, a built dist/index.js
6+
#
7+
# Usage: package-release.sh [output-dir] [targets...]
8+
# Defaults to all targets if none specified.
9+
10+
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
11+
OUT_DIR="${1:-${ROOT_DIR}/release}"
12+
shift 2>/dev/null || true
13+
14+
ALL_TARGETS=(linux-x64 linux-arm64 darwin-x64 darwin-arm64)
15+
TARGETS=("${@:-${ALL_TARGETS[@]}}")
16+
if [[ ${#TARGETS[@]} -eq 0 ]]; then
17+
TARGETS=("${ALL_TARGETS[@]}")
18+
fi
19+
20+
rm -rf "${OUT_DIR}"
21+
mkdir -p "${OUT_DIR}"
22+
23+
for target in "${TARGETS[@]}"; do
24+
echo "Compiling computer-${target}..."
25+
bun build "${ROOT_DIR}/dist/index.js" \
26+
--compile \
27+
--target="bun-${target}" \
28+
--outfile "${OUT_DIR}/computer-${target}"
29+
done
30+
31+
# Ad-hoc sign macOS binaries when running on macOS
32+
if [[ "$(uname -s)" == "Darwin" ]] && command -v codesign >/dev/null 2>&1; then
33+
for bin in "${OUT_DIR}"/computer-darwin-*; do
34+
[[ "${bin}" == *.sha256 ]] && continue
35+
codesign --sign - --force "${bin}"
36+
done
37+
fi
38+
39+
for file in "${OUT_DIR}"/computer-*; do
40+
[[ "${file}" == *.sha256 ]] && continue
41+
if command -v sha256sum >/dev/null 2>&1; then
42+
sha256sum "${file}" | awk '{print $1}' > "${file}.sha256"
43+
elif command -v shasum >/dev/null 2>&1; then
44+
shasum -a 256 "${file}" | awk '{print $1}' > "${file}.sha256"
45+
else
46+
openssl dgst -sha256 "${file}" | awk '{print $2}' > "${file}.sha256"
47+
fi
48+
done

0 commit comments

Comments
 (0)