0101-agents 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/bin/cli.js +60 -10
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -10,7 +10,7 @@
10
10
  // 0101-agents list
11
11
  // 0101-agents help
12
12
 
13
- import { execSync } from 'node:child_process'
13
+ import { execSync, spawn } from 'node:child_process'
14
14
  import {
15
15
  existsSync, mkdirSync, readFileSync, writeFileSync, readdirSync,
16
16
  rmSync, statSync, createWriteStream,
@@ -169,10 +169,11 @@ async function prompt(question) {
169
169
  async function cmdLogin(args) {
170
170
  let key = args[0]
171
171
  if (!key) {
172
+ console.log(dim('Get your license key at https://0101.fyi/account'))
172
173
  key = await prompt('Paste your license key: ')
173
174
  }
174
175
  key = key.trim()
175
- if (!key) die('No key provided.')
176
+ if (!key) die('No key provided. Get one at https://0101.fyi/account')
176
177
  writeConfig({ ...readConfig(), license_key: key })
177
178
  ok(`Saved license to ${CONFIG_PATH}`)
178
179
  }
@@ -222,7 +223,8 @@ async function cmdInstall(args) {
222
223
 
223
224
  console.log('')
224
225
  ok(`Installed ${bold(agent)} ${manifest.latest} → ${installDir}`)
225
- info(`Start: cd ${installDir} && claude`)
226
+ info(`Start: 0101-agents start ${agent}`)
227
+ info(` or: cd ${installDir} && claude`)
226
228
  }
227
229
 
228
230
  async function cmdUpdate(args) {
@@ -281,17 +283,64 @@ function cmdList() {
281
283
  }
282
284
  }
283
285
 
286
+ async function cmdStart(args) {
287
+ const agent = args[0]
288
+ if (!agent) die('Usage: 0101-agents start <agent> [-- <claude-args>]')
289
+ const dir = agentInstallDir(agent)
290
+ if (!existsSync(dir)) {
291
+ die(`${agent} is not installed. Try: 0101-agents install ${agent}`)
292
+ }
293
+
294
+ // Best-effort update check. Silently skipped if offline or the server
295
+ // misbehaves — never blocks the launch.
296
+ try {
297
+ const manifest = await fetchManifest(agent)
298
+ const current = installedVersion(agent)
299
+ if (current && manifest.latest !== current) {
300
+ console.log(
301
+ dim(`⚠ ${agent} ${manifest.latest} available (run: 0101-agents update ${agent})`),
302
+ )
303
+ }
304
+ } catch {
305
+ // ignore
306
+ }
307
+
308
+ // Everything after the agent name passes through to `claude`. Supports both:
309
+ // 0101-agents start marketer --resume
310
+ // 0101-agents start marketer -- --resume (explicit separator)
311
+ // The `--` is optional; if present, we drop it.
312
+ let claudeArgs = args.slice(1)
313
+ if (claudeArgs[0] === '--') claudeArgs = claudeArgs.slice(1)
314
+
315
+ // Hand the terminal over to `claude` with cwd set to the agent dir. When
316
+ // claude exits, the user returns to their original shell location.
317
+ const child = spawn('claude', claudeArgs, { cwd: dir, stdio: 'inherit' })
318
+ child.on('error', (e) => {
319
+ if (e.code === 'ENOENT') {
320
+ die('`claude` not found in PATH. Install Claude Code first: https://claude.com/code')
321
+ }
322
+ die(`Failed to start claude: ${e.message}`)
323
+ })
324
+ child.on('exit', (code) => process.exit(code ?? 0))
325
+ }
326
+
284
327
  function cmdHelp() {
285
328
  console.log(`0101-agents — install and update Claude Code agents.
286
329
 
287
330
  Commands:
288
- ${bold('login')} [<key>] Save your license key
289
- ${bold('logout')} Forget your license key
290
- ${bold('whoami')} Show current license
291
- ${bold('install')} <agent> [--force] Install an agent
292
- ${bold('update')} <agent> Update an installed agent (preserves data/)
293
- ${bold('list')} List installed agents
294
- ${bold('help')} Show this message
331
+ ${bold('login')} [<key>] Save your license key
332
+ ${bold('logout')} Forget your license key
333
+ ${bold('whoami')} Show current license
334
+ ${bold('install')} <agent> [--force] Install an agent
335
+ ${bold('update')} <agent> Update an installed agent (preserves data/)
336
+ ${bold('start')} <agent> [-- args] Open the agent (runs claude inside its dir)
337
+ ${bold('list')} List installed agents
338
+ ${bold('help')} Show this message
339
+
340
+ Examples:
341
+ 0101-agents start marketer
342
+ 0101-agents start marketer --resume
343
+ 0101-agents start marketer -- -p "audit https://example.com"
295
344
 
296
345
  Install dir: ${INSTALL_ROOT}
297
346
  Config: ${CONFIG_PATH}`)
@@ -308,6 +357,7 @@ try {
308
357
  case 'whoami': await cmdWhoami(); break
309
358
  case 'install': await cmdInstall(rest); break
310
359
  case 'update': await cmdUpdate(rest); break
360
+ case 'start': await cmdStart(rest); break
311
361
  case 'list': cmdList(); break
312
362
  case 'help':
313
363
  case '-h':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "0101-agents",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "",
5
5
  "bin": {
6
6
  "0101-agents": "./bin/cli.js"