AGENTS.md@packages/cli · git:20261019.f7b4bbb · 2026-10-19 · sha256 b891c7b722973a5d

AGENTS.md@packages/cli git:20261019.f7b4bbbA

Immutable. This exact content never changes and is served at /api/v1/blob/b891c7b722973a5d.

# @shadowclone/cli

The `shadowclone` command. It parses commands, calls the other packages, and builds the CLI package for npm.

<!-- package-facts:start -->

(generated by `bun run guides`; do not edit by hand)

- Package name: `@shadowclone/cli`
- Workspace dependencies: `@shadowclone/agents`, `@shadowclone/bot`, `@shadowclone/builds`, `@shadowclone/changes`, `@shadowclone/clones`, `@shadowclone/core`, `@shadowclone/environment`, `@shadowclone/harness`, `@shadowclone/hub`, `@shadowclone/learning`, `@shadowclone/live`, `@shadowclone/mcp`, `@shadowclone/profile`, `@shadowclone/redact`, `@shadowclone/review`, `@shadowclone/sessions`, `@shadowclone/skills`, `@shadowclone/web`
- External dependencies: `@anthropic-ai/sandbox-runtime`, `bun`, `commander`, `smol-toml`, `zod`
- Export subpaths: `.`

<!-- package-facts:end -->

## Owns

- `bin/shadowclone.mjs`: the `bin` entry. It runs `dist/shadowclone.js` with Bun.
- `src/main.ts`: the command router and the usage text. Each command has its own file, such as `init.ts`, `learn.ts`, `review.ts`, and `forget.ts`.
- `scripts/build.ts`: bundles the workspace packages into `dist/`.
- `scripts/stage.ts` and `publishedManifest.ts`: write the publishable package to `out/package`.

## Rules

- This package publishes the CLI. The separate skills artifact publishes portable content. Workspace runtime packages stay private.
- `publishedManifest` copies a fixed list of fields. It drops every `workspace:` dependency.
- The build fails when the bundle contains a path of the build machine.
- The bundle keeps `@anthropic-ai/sandbox-runtime` external. The published manifest retains its pinned dependency so installed packages include native sandbox helpers.
- Product name and version come from `@shadowclone/core/product.json`. Workspace manifests have no version.
- `forget --all` stops while task worktrees from earlier versions remain.
- Error text passes through `redactSecrets` before it prints.
- Update the usage text in `src/main.ts` and `docs/guides/commands.md` when you add a command.

## Tests

Run `bun test` in this folder, or `bun test packages/cli` from the root. Many tests create a synthetic home folder and run `git`. The `scripts/` tests check the bundle and the staged package.

Update this file in the same commit when you change the package purpose, public exports, dependencies, or a rule above.