agentcage 0.1.1 → 0.1.3

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,5 +1,12 @@
1
1
  # agentcage
2
2
 
3
+ ```
4
+ ▄▄▄ ▄▄▄▄ ▄▄▄▄ ▄▄▄▄ █ ▄▄▄▄ ▄▄▄ ▄▄▄▄ ▄▄▄▄
5
+ ▄▄▄█ █ █ █▄▄▄ █ █ ▀█▀ █ ▄▄▄█ █ █ █▄▄▄
6
+ █▄▄█ ▀▀▀█ █▄▄▄ █ █ █▄▄ █▄▄▄ █▄▄█ ▀▀▀█ █▄▄▄
7
+ ▀▀▀▀ ▀▀▀▀
8
+ ```
9
+
3
10
  Isolated dev containers for AI coding agents. Each project gets its own Linux container. **The project source lives
4
11
  in a Docker volume, not in a folder mounted from your laptop**, so agents in the container can't see your other files. Each container can
5
12
  run an **OpenCode server** that the OpenCode Desktop app on your laptop connects to. The app is only the UI: every agent tool
@@ -13,7 +20,7 @@ You need **Docker** (Docker Desktop on Windows/macOS, Docker Engine on Linux), *
13
20
  **OpenCode Desktop** (open it once so its settings exist).
14
21
 
15
22
  ```bash
16
- npm install -g agentcage
23
+ npm install -g agentcage # also updates to the latest version
17
24
  agentcage doctor # checks everything above
18
25
  ```
19
26
 
@@ -54,6 +61,7 @@ agentcage connect <name> # (re)register the container in OpenCode Desktop
54
61
  agentcage upgrade <name> # rebuild with the Desktop app's OpenCode version (volumes kept)
55
62
  agentcage stop <name>
56
63
  agentcage remove <name> # delete container, volumes and config
64
+ agentcage version # installed version and the latest on npm
57
65
  agentcage doctor
58
66
  agentcage adopt <name> # import a container made by the old bash scripts in legacy/
59
67
  ```
package/bin/agentcage.js CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ import { readFileSync } from 'node:fs';
2
3
  import { parseArgs } from 'node:util';
3
4
  import * as p from '@clack/prompts';
4
5
  import { adoptContainer, listContainers, loadContainer, removeContainer, saveContainer, state, up, writeDevcontainer, openIde, ws } from '../src/container.js';
@@ -22,6 +23,7 @@ const HELP = `agentcage: isolated dev containers for AI coding agents
22
23
  agentcage provider <name> add model provider API keys to OpenCode in the container
23
24
  agentcage upgrade <name> rebuild with the Desktop app's OpenCode version (volumes kept)
24
25
  agentcage remove <name> delete container, volumes and config
26
+ agentcage version installed version, and the latest on npm (update: npm i -g agentcage@latest)
25
27
  agentcage doctor check Docker, Node and OpenCode Desktop
26
28
  agentcage adopt <name> import a container made by the old devbox bash scripts
27
29
 
@@ -30,7 +32,7 @@ const HELP = `agentcage: isolated dev containers for AI coding agents
30
32
  let { values: f, positionals: [cmd, arg, arg2] } = parseArgs({
31
33
  allowPositionals: true,
32
34
  options: { name: { type: 'string' }, tools: { type: 'string' }, git: { type: 'string' }, providers: { type: 'string' },
33
- ide: { type: 'string' }, yes: { type: 'boolean', short: 'y' }, help: { type: 'boolean', short: 'h' } },
35
+ ide: { type: 'string' }, yes: { type: 'boolean', short: 'y' }, help: { type: 'boolean', short: 'h' }, version: { type: 'boolean', short: 'v' } },
34
36
  });
35
37
  const csv = s => s?.split(',').map(x => x.trim()).filter(Boolean);
36
38
  const container = () => loadContainer(arg ?? (() => { throw new Error(`Usage: agentcage ${cmd} <name>`); })());
@@ -47,6 +49,11 @@ async function start(b) {
47
49
  }
48
50
 
49
51
  const commands = {
52
+ async version() {
53
+ const v = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version;
54
+ const latest = await fetch('https://registry.npmjs.org/agentcage/latest').then(r => r.json()).then(j => j.version, () => undefined);
55
+ console.log(`agentcage ${v}${!latest ? '' : latest === v ? ' (latest)' : `\nNewer version ${latest} on npm. Update with: npm i -g agentcage@latest`}`);
56
+ },
50
57
  async new() { await newWizard({ src: arg, name: f.name, tools: csv(f.tools), git: f.git, providers: csv(f.providers), ide: f.ide, yes: f.yes }); },
51
58
  list() {
52
59
  const rows = listContainers().map(b => [b.name, state(b), b.tools.includes('opencode') ? String(b.port) : '-', b.opencodeVersion ?? '-', b.git]);
@@ -109,6 +116,7 @@ const commands = {
109
116
  },
110
117
  };
111
118
 
119
+ if (f.version) cmd = 'version';
112
120
  if (f.help || cmd === 'help') console.log(HELP);
113
121
  else if (cmd && !commands[cmd]) { console.error(`Unknown command '${cmd}'.\n\n${HELP}`); process.exit(1); }
114
122
  else await Promise.resolve().then(() => commands[cmd ?? 'menu']()).catch(e => { p.log.error(e.message); process.exit(1); });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentcage",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Isolated dev containers for AI coding agents (OpenCode, Claude Code), connected to OpenCode Desktop",
5
5
  "type": "module",
6
6
  "bin": {