---
url: https://repo.icebreaker.top/reference/commands.md
---
# Command Reference

Use [`repo workspace move`](./move.md) with `--to`, `--name`, or both to preview workspace refactoring. Review the JSON plan and located source tasks, then explicitly apply it with `--apply`.

Use [`repo workspace prepare`](./artifacts.md) to preview a native Turbo prune build context or pinned pnpm deploy production directory, then explicitly apply a reviewed JSON plan. Select one exact package and an empty output outside the workspace.

This page focuses on high-value repoctl commands and options.

## `repo docs plan` / `repo docs deploy`

```bash
repo docs plan guide --channel preview --source-sha <full-main-sha> --json
repo docs plan guide --channel stable --release <completion-record-id> --json
repo docs plan guide --channel stable --commits <correction-sha> --json
```

`plan` reads publication evidence and checks the frozen source. `deploy` accepts the same selection, runs the configured build, and uses either the built-in `cloudflare-workers` provider or a `deployScript` adapter. Native Cloudflare preflight checks static assets-only configuration, identity and read access before the frozen checkout's install/build; it does not certify future write permission or public HTTP readiness. Stable execution belongs in the serialized managed GitHub workflow. Configure `commands.docs.sites` explicitly. See [documentation publication](/tasks/docs) for target fields, workflow setup, independent corrections, adapter outputs and recovery with the same deployment ID.

`deploy --json` keeps stdout to the result or safe failure report, streams child logs live to stderr and exits nonzero on failure. Reports include ordered stages, elapsed times, upload/reconcile and resumable phase; `GITHUB_STEP_SUMMARY` gets the same escaped report. Optional target `readiness` verifies the exact public manifest before current advances. A saved `verifying` retry skips frozen-source install/build/upload; the workflow still performs its bootstrap install. See [documentation publication](/tasks/docs) for configuration, receipt recovery, `DocsDeploymentError.report` and summary-write warnings.

## Main Entry

```bash
pnpm exec repo init
pnpm exec repo doctor
pnpm exec repo templates
pnpm exec repo new
pnpm exec repo check
```

Generated repositories also expose:

```bash
pnpm run repo:init
pnpm run repo:doctor
pnpm run repo:new
pnpm run repo:check
```

## `repo init`

```bash
repo init
repo init --yes
repo init --preset minimal
repo init --preset standard --force
repo init --overwrite
```

Use it to initialize recommended workspace defaults. It skips existing managed files by default, appends missing workspace patterns, and supports non-interactive CI usage with `--yes`.

## `repo doctor`

```bash
repo doctor
repo doctor --strict
repo doctor --json --out reports/doctor.json
repo doctor --markdown --redact --out reports/doctor.md
```

Use it to check root workspace files, Node compatibility, CLI dependency presence, `repo:*` root scripts, stale config files, and commit hooks.

`--strict` treats warnings as failures. `--redact` removes local absolute paths from shareable reports.

Text and Markdown include the stable rule ID, affected paths and manifest field when available. Identical findings share one explanation and fix, with every path and the original check count retained. For example, `[template-instance-drift]` with `path: apps/docs/astro.config.ts` can be inspected with `repo doctor --rules template-instance-drift`. Different reasons, fixes and suppressions remain separate. Grouping does not change warning/failure totals or suppression policy; JSON always contains the complete individual checks.

```bash
repo doctor --list-rules
repo doctor --rules root-scripts,package-manager --strict
repo doctor --rules root-scripts --fix --out plans/doctor-fix.json
repo doctor --apply plans/doctor-fix.json --json
```

`--rules` selects exact stable check IDs before execution; unknown IDs fail and list the available rules. The CLI replaces `commands.doctor.rules`; omitted rules run all checks, while an explicit empty config array runs none. Shared discovery and rule prerequisites still run. `manifest-health` is an aggregate over the static manifest checks. Workspace boundaries and dependency admission use stable `boundary-*` / `admission-*` IDs; selecting only `boundary-policy` or `admission-policy` preserves the actual aggregate failure status, and prerequisite configuration failures remain visible. Custom policy names appear only in diagnostic details.

Configure reasoned waivers under `commands.doctor.suppressions`. Each item needs `id` and a nonempty `reason`; optional `path` matches an exact workspace-relative finding path. Optional `expires` is an inclusive UTC date (`YYYY-MM-DD`). JSON retains the original finding status, `suppression`, `rawSummary`, and every waiver with its matched count. Only active waivers are excluded from effective `summary` and strict exit status; expired and unmatched waivers remain visible.

`--fix` previews JSON without modifying project files. Only missing `repo:init`, `repo:new`, `repo:check`, and `repo:doctor` keys in the root `package.json` are supported. Existing values, including empty/custom scripts, are preserved for manual review. An actively suppressed or unselected rule produces no fix. Review the additions, complete before/after content, hashes, risk, and diff before using `--apply`. Plans contain original manifest content and cannot be redacted or rendered as Markdown for execution.

Apply checks the canonical workspace and original file contents, rejects links and modified operations, reuses the staged file transaction with rollback, and reruns the root-script check without suppression. A changed input stops the fix; regenerate the plan. Reapplying an already applied plan is unchanged. Textual `fix` suggestions are never executed, and dependency installation or release workflow modification is outside this fixer.

Doctor fix application holds `.repoctl/doctor-fix.lock` from input validation through verification, rollback and cleanup, preventing overlapping writers from undoing a successful fix. After a crash, verify no writer remains and reconcile any retained backups before manually removing the lock.

## `repo env check`

```bash
repo env check
repo env check build test --json --strict
repo env check --markdown --no-framework-inference
```

This read-only check compares static `process.env.NAME`, `import.meta.env.NAME`, literal property reads and destructuring with Turbo environment declarations. It checks `build` by default and includes private packages. Each package/task report separates hashed variables, passthrough variables, inferred framework prefixes, framework built-ins, missing declarations and unresolved dynamic reads, with source locations. Comments and ordinary strings do not become references. Actual `.env*` and `.dev.vars*` contents are never read; example files contribute key names only. No values or source snippets appear in JSON, text or Markdown.

Root and package `turbo.json`/`turbo.jsonc` configurations support package-qualified tasks, ordered package inheritance, array replacement, `$TURBO_EXTENDS$` and task inheritance exclusions. Wildcards and negations follow Turbo environment syntax. Unsupported advanced `global` configuration and object-form inputs fail validation instead of guessing coverage. Environment files are checked against `globalDependencies`, task `inputs`, `$TURBO_ROOT$`, explicit exclusions and Git's default non-ignored paths. Merely finding an env file does not establish hash coverage. `passThroughEnv` makes a variable available without hashing its value; it is reported for review rather than automatically moved into `globalEnv`. A global `*` declaration receives a scope warning.

Configure `commands.env` in `repoctl.config`: `tasks`, package-relative `include`/`exclude` globs, `frameworkInference`, and `suppressions`. Each suppression requires a stable `rule` and nonempty `reason`, with optional `package`, `task`, `variable` and repository-relative `path` glob selectors. Suppressed findings remain visible, and unused suppressions produce a warning. Configuration failures exit 1; `--strict` also fails on warnings. `--dry-run` documents the always-read-only behavior. APIs are `checkEnvironmentCache(cwd, options)` and `formatEnvironmentCache(report, markdown?)`.

Static references are task candidates, not proof that a script executes that source. Scanning covers JS/TS and Vue/Svelte script blocks, skips links and files above 2 MiB, and does not resolve aliases, shadowed globals, templates, generated code or direct cross-package source imports. Framework inference is estimated from package dependencies; runtime flags, custom prefixes and variables introduced by shell scripts require review. Existing executable repoctl configuration must itself avoid side effects. The command does not run tasks, load real environment values, rewrite Turbo config or widen global cache inputs.

References: [Turbo environment variables](https://turborepo.com/docs/crafting-your-repository/using-environment-variables), [configuration](https://turborepo.com/docs/reference/configuration), and [package inheritance](https://turborepo.com/docs/reference/package-configurations).

## `repo templates`

```bash
repo templates
repo templates tsdown
repo templates --category library
repo templates --check
repo templates --json
repo templates --markdown --out docs/templates.md
```

Use it to discover built-in template keys, inspect metadata, verify template health, or generate machine-readable output.

## `repo new`

```bash
repo new
repo new sdk --template tsdown
repo new docs --template nimbus
repo new docs --template nimbus --dry-run
repo new docs --template nimbus --json --out plans/docs.json
```

Use it to create packages and apps. Explicit template keys are validated first; invalid keys fail with suggestions instead of silently falling back.

## `repo package check`

```bash
repo package check
repo package check --filter '@scope/*' --strict
repo package check --filter my-library --keep-temp --json
```

Build the selected workspace packages and their dependencies in dependency order, then validate real `pnpm pack` tarballs with publint 0.3.25 and ATTW 0.18.5. Build failure prevents all packing. Local development prerequisites are included in the build; private prerequisites can build without being packed or checked. Private packages are reported as skipped unless `--include-private` is supplied. Repeat `--filter` to combine pnpm selectors; `--build-script` changes the default `build` script. Packages without that script are treated as already authored artifacts.

Independent temporary consumers install the tarballs and their local runtime dependency tarballs, then exercise declared Node ESM/CJS entrypoints and TypeScript NodeNext consumption. Typed consumers install the source workspace's exact installed TypeScript version and run that isolated compiler with `skipLibCheck: false`; when the source has no TypeScript installation, they use ATTW's pinned compiler version as the default. The compiler and repoctl's controlled Node types use dedicated npm aliases that avoid all dependency names in the runtime closure, including required peers. A separate type root exposes the controlled Node declarations for verification, preserving the package's runtime TypeScript and Node peer requirements. JavaScript-only consumers do not install this type toolchain. Optional peer integrations declared in the tested runtime dependency closure are installed with the intersection of their peer ranges, including required peer constraints and npm aliases. Original range expressions are retained when they express the complete intersection. For complex npm alias intersections unsupported by pnpm 12, the consumer queries its configured registry through `pnpm view` and installs the highest published version satisfying the intersection as an exact alias. Queries use the consumer's package-manager configuration and appear in its command log; missing matching versions fail the check. Development dependencies and unrelated workspace integrations are not copied.

Undeclared module formats are not required. Browser-only and non-JavaScript asset exports receive manifest/type analysis rather than Node execution; JavaScript bins receive syntax checks, without invoking application commands. A JavaScript resource such as a Service Worker can explicitly declare an exact export subpath in its published `package.json`:

```json
{
  "repoctl": {
    "packageCheck": {
      "runtimeAssets": ["./worker.js"]
    }
  }
}
```

Each declared resource must be a packed JavaScript export. Consumers verify its export resolution, existence, package boundary and JavaScript syntax without executing browser globals. Missing paths, wildcard declarations, escaping links and invalid syntax fail. A resource does not need types merely because other exports have them; explicit or adjacent declarations attached to the resource are still checked. Other runtime exports and declaration checks remain enabled. Snapshot and published nightly consumers use the same contract; nightly derives optional integrations from checked tarballs after validating integrity and snapshot identity. Installation can contact the registry, while dependency install scripts are disabled. Workspace build and pack lifecycle scripts run normally.

Required peers that refer to workspace packages in the checked runtime closure are also installed explicitly from the current candidate tarballs or publication locators. This includes transitive peers and npm aliases, so automatic peer installation cannot substitute an older registry package. Their declared version ranges must still accept the checked package. External required peers retain the package manager's existing resolution behavior.

Some ESM exports require a particular execution context. Declare each exact export in the published `package.json`:

```json
{
  "peerDependencies": { "vitest": "^5.0.5" },
  "repoctl": {
    "packageCheck": {
      "runtimeContexts": {
        "./vitest/setup": "vitest",
        "./routes": {
          "kind": "expected-error",
          "name": "Error",
          "message": "Requires the build plugin."
        }
      }
    }
  }
}
```

The `vitest` context executes the export as a real setup file before a smoke test using Vitest installed inside the isolated consumer. Setup hooks must complete successfully. Vitest must be a dependency, optional dependency, or peer of the published package; a development dependency alone is insufficient. The consumer rejects a framework resolved outside its isolated directory.

The `expected-error` context actually imports an entry that is intentionally unavailable without its host or build plugin. It succeeds only if the import throws an `Error` whose name and complete message exactly match the declaration. An import that succeeds or throws any different error fails validation. Only `name: "Error"` is supported.

Contexts require existing packed ESM exports. Unknown paths, wildcard or noncanonical paths, missing files, type-only/browser-only exports, CommonJS or dual-format exports, and paths also declared in `runtimeAssets` are rejected. Ordinary entries retain their normal import checks, and declaration checks remain strict for contextual entries. Package check, snapshot, and published nightly consumers share this contract. TypeScript callers can use the exported `ConsumerRuntimeContext` and `PackageCheckManifestOptions` types when authoring manifest metadata.

JSON contains each package's file list, stable diagnostic source/code, original upstream details, and subprocess argument arrays. `--strict` also fails on warnings. `--keep-temp` preserves the tarballs, consumer manifests and command working directories for reproduction; otherwise temporary files are removed even after failure. The command never publishes, changes package versions, or writes release state.

To use it as a release gate, add a package script such as `"package:check": "repoctl package check --strict"` and reference `package:check` in `commands.release.hooks.verify`. Do not put this command in a build/prepack script, since it runs those stages itself.

## `repo check`

For explicitly enabled unused-code and dependency analysis, see [`repo check knip`](./knip.md).

```bash
repo check
repo check --staged
repo check --full
repo check --edit-file .git/COMMIT_EDITMSG
repo check --dry-run
repo check --json --out reports/check-plan.json
repo check --markdown --redact --out reports/check-plan.md
```

Use it to preview or run the recommended local verification flow. `--staged` is closer to pre-commit; `--full` is closer to pre-push.

## `repo upgrade`

For third-party dependency declarations, use `repo deps check`, create an explicit
read-only plan with `repo deps plan`, then apply reviewed JSON with `repo deps apply`.
See [Dependency consistency](./dependencies.md) for protocols, version groups and recovery.

```bash
repo upgrade
repo upgrade --yes
repo upgrade --overwrite
repo upgrade --no-overwrite
repo upgrade --core
repo upgrade -i
repo upgrade -s
repo upgrade --dry-run
repo upgrade --json > upgrade-plan.json
repo upgrade --markdown
repo upgrade --apply upgrade-plan.json
```

Use it to sync standard assets and scripts. `--core` skips GitHub-related assets. `--no-overwrite` preserves changed files.

`--dry-run`, `--json` and `--markdown` always preview without writes or prompts. Every selected asset has an `add`, `modify`, `delete`, `identical`, `skip` or `conflict` status and a reason. Package scripts/dependencies, workspace settings, AGENTS sections, gitignore rules, tooling references and legacy versioning migration all use the same plan. Text and Markdown show per-file unified diffs; binary files and text larger than 256 KiB combined are explicitly marked without a fabricated diff.

`--apply` applies every actionable entry in a reviewed JSON plan, using its exact bytes. The ordinary command retains interactive selection for semantic migrations; safe merges against a recorded upstream baseline and approved additions can run non-interactively. All approvals happen before the first write. `--no-overwrite` and `-s` also preserve legacy metadata. Custom release workflows remain protected unless `--overwrite-release` is explicit; existing licenses are preserved. A prerelease lane migration and its metadata deletion form one indivisible selection group. Unknown prerelease state stays on disk for manual migration.

Root managed assets use three-way merging: the previous upstream content, the current local file, and the newly installed template. Independent edits merge automatically; overlapping edits expose base/local/upstream regions and line positions in the plan. Binary divergence and text over 1 MiB combined remain conflicts. Existing semantic strategies for package/workspace configuration, AGENTS and gitignore stay in place. This does not upgrade generated app/package directories or run historical template code.

Baselines live in `.repoctl/baselines/root/<path-sha256>.json`; commit this directory to preserve upgrade history across clones. Each record contains the asset path, template package/version, source SHA-256, and upstream bytes/hash, never a customized merged output. Hashes check integrity and identify the locally installed source; they are not publisher signatures. A saved plan is the reviewed write payload: editing its contents and recalculating hashes creates a new payload to review, rather than proof of its author. A differing old file without a baseline is a `baseline-missing` conflict: review and use `--overwrite` to explicitly adopt the new template. `--yes` alone does not resolve conflicts. Identical files can safely acquire a baseline without rewriting the asset. Removing this directory loses historical merge information and returns the next upgrade to this conservative first-run behavior.

Locally deleted tracked files remain deleted, even with `--overwrite`; restore them manually to resume upgrades. Upstream deletion removes only an unchanged owned file, while customized files remain conflicts. A selected file and its reviewed baseline update share one transaction, including rollback and retry checks. JSON file entries include optional `baseline` operations with before/after hashes and exact content; partial selection never advances other baselines. Older saved plans without this field still apply without creating unreviewed records. Conflict files are never applied, and CLI preview/apply returns exit code 1 while any remain; API apply results list unresolved paths in `conflicts` even when other selected files were successfully applied.

New `pnpm-workspace.yaml` overrides are checked against dependency declarations in the **proposed** workspace membership, including `commands.deps.groups`, npm aliases and catalogs. A global override that expands an existing selector or escapes a matching declaration becomes a `workspace-override-policy` conflict; `--yes` and `--overwrite` cannot bypass it. JSON `workspacePolicy.findings` names the affected manifests, declarations and groups. Disjoint version selectors remain independent. This is an offline declaration check, not proof of every transitive resolution. Newly added parent-qualified selectors or non-semver replacements are `unverified`: the ordinary command requires explicit file selection, and automatic maintenance rejects them. A reviewed saved JSON plan may be applied explicitly. Existing identical override keys are not reported repeatedly.

During a recognized default Husky-to-Lefthook migration, unrelated unverified override additions are marked `deferred` and remain absent from the applied workspace. The automatic hook migration can finish without accepting them. Preview again afterwards to review those overrides as `unverified`; explicit selection or saved-plan apply can then accept them. A hard conflict or protected skip of a required file blocks the entire migration group, including explicit partial selection. This includes preset-owned targets and locally deleted tracked files. Automatic maintenance preparation and its independent publisher reject both `unverified` and `deferred`; complete the hook migration and review the overrides before retrying maintenance.

To retain one local override or its absence, add a reviewed `commands.upgrade.keep` entry, then **regenerate** the plan:

```ts
keep: [{
  file: 'pnpm-workspace.yaml',
  path: ['overrides', 'vite'],
  reason: 'Keep Taro Vite 4 and uni-app Vite 5 isolated.',
  upstreamHash: '<copy upstreamHash from the finding>',
  localHash: '<copy localHash from the finding>',
  expires: '2030-12-31', // Optional inclusive UTC date.
}]
```

Only exact `['overrides', selector]` paths in `pnpm-workspace.yaml` are supported; package names containing dots or slashes remain one array element. Commit the decisions in configuration. The SHA-256 fingerprints bind both upstream and local values, distinguishing an absent key from YAML `null`. Changed values, invalid dates, duplicate decisions and expired reviews require renewed review; an upstream upgrade cannot silently reuse an old decision. Other nonconflicting settings still merge. Saved-plan application verifies configuration, all inspected manifests and the proposed package set again, and rejects elapsed decision expiry. This complements existing file selection, root baselines and template-instance `excludedPaths`; it does not unmanage a whole file or suppress dependency diagnostics.

Versioned migrations appear in the plan's `migrations` report with stable IDs, version boundaries, selection reasons and affected files. The built-in `changesets-to-pnpm-versioning` migration crosses template version `1.1.0`, the release that introduced pnpm native versioning. The target is the exact installed template package version. If a repository has no history, `--from-version 1.0.15` can attest its exact previous template version; dependency ranges such as `^1.0.0` never establish that version. Unknown versions only adopt recognized legacy formats and report `adopt-detected-legacy-format`; malformed metadata and downgrades are blocked. Fresh projects without legacy metadata do not run or initialize old migrations.

Commit `.repoctl/migrations/ledger.json` once created. Its `evaluatedVersion` is a migration cursor, not a claim that every managed asset uses that template version. Dry runs write nothing. The completed ledger is reviewed as a normal file diff, while JSON includes the exact intermediate pending/failed contents. Migration files form an indivisible selection group; unselected or failed steps never advance the cursor. The pending record is saved before changes, and completed is written last in the migration transaction. A failure to write completed rolls back that transaction and records failed; if recording failure also fails, the pending journal remains for recovery. Independent selected assets apply after the migration group, so a later independent failure does not erase a completed migration.

After interruption, preview again. The journal retains reviewed outputs and before/after hashes; recovery shows which files already match the output and which still need writing. Any third state blocks recovery and preserves local edits plus original `*.repoctl-upgrade-<attempt-id>.bak` files for review. Recovery requires the original installed template version and unchanged other recorded inputs; it never executes historical scripts or performs network/publish actions. An exclusive local process lock prevents concurrent applications. A force-terminated process can leave `.repoctl/upgrade.lock`; confirm no writer is active and inspect pending backups before removing it, then preview again. Locks are not stolen by age, and normal cleanup verifies both the caller's token and filesystem identity. Older plans without migration metadata do not create unreviewed ledger records.

Plans record the original target, asset and local configuration hashes. Application holds `.repoctl/upgrade.lock` through input checks, no-op detection, writes, rollback and cleanup. It rejects concurrent writers or a changed workspace package set and treats a fully applied plan as a no-op. It creates original `.repoctl-upgrade-*.bak` backups before replacing files and rolls back a failed operation. Recovery files and created directories are removed only while their filesystem identity still belongs to the transaction; changed recovery bytes and colliding files are retained. When a concurrent edit prevents rollback, the error identifies retained originals. After a process interruption, verify that no writer is active, inspect backups and temporary files, restore originals as needed, then remove the lock and generate a new plan. Unrelated files and Git refs/index are untouched.

Each preview refreshes configuration entries, inherited configs and statically resolved local imports, including literal dynamic imports, in memory. These files join the input checks; module-relative paths remain intact. Installed packages, computed imports, environment variables and arbitrary filesystem/network reads are outside this tracked module set, so regenerate the plan when those runtime inputs change. Executable configuration must itself avoid side effects for a read-only preview.

Preview never generates missing template assets. An `assets-not-prepared` blocker means the package installation must be repaired first; source contributors can run `pnpm --filter @icebreakers/monorepo-templates sync:assets` explicitly. Plans belong to the same working directory, output directory and installed asset location. Public APIs are `planUpgrade(options)`, `formatUpgradePlan(plan, 'text' | 'markdown')`, `applyUpgradePlan(cwd, plan, { files? })` and `upgradeMonorepo({ dryRun: true })`; `UpgradePlan` includes base64 payloads for exact application. `repo workspace upgrade` and `repo ws up` share these options.

## Workspace Dependencies

```bash
repo workspace graph
repo workspace graph --json --redact
repo workspace graph --mermaid
repo workspace graph --package @acme/shared --type dependencies
repo workspace why @acme/web @acme/shared --json
repo workspace impact @acme/shared --direct --json
```

These read-only queries share a manifest dependency graph. Private apps are included by default; `--exclude-private` excludes them and `--include-root` adds the root package. Edges point from a consumer to its dependency. `--type` accepts `dependencies`, `devDependencies`, `peerDependencies`, or `optionalDependencies` and can be repeated. With no type filter, all four fields are included.

`graph --package <name-or-directory>` shows the selected packages and their direct incoming/outgoing relationships; repeat it to select several packages. `why <from> <to>` returns one deterministic shortest dependency path, including both endpoints; no path is a successful query with `found: false`. `impact <package>` returns direct and transitive consumers with minimum distance and one path per consumer. `--direct` limits it to immediate consumers. Cycles are safe and the target itself is excluded from its impact result.

Selectors accept exact package names or workspace-relative directories such as `./packages/shared`. Duplicate names produce diagnostics, and queries using an ambiguous name fail; use an explicit directory to disambiguate. Unnamed packages remain queryable by directory. Missing, ambiguous, invalid, and version-incompatible forced local references are included in `diagnostics` instead of becoming guessed edges.

The graph understands workspace ranges, workspace aliases (`workspace:@acme/shared@^1`), relative workspace paths, and local `link:`/`file:` directories. Every edge records `resolution`: `workspace` and `local` are explicit local references, while `semver` marks a matching local candidate for an ordinary range or `npm:` alias. These are manifest relationships, not proof of what a lockfile installed: registry tags, catalogs, remote URLs and source imports are not resolved. Catalog references and unsupported specifiers with a same-name local candidate produce `unresolved_specifier` diagnostics. Consumers must inspect diagnostics before treating the graph as complete; affected checks can fall back conservatively. Filtering private/root packages can also leave forced references unresolved.

JSON uses schema version `1`, directory-based node IDs and stable sorting; field names and diagnostic codes do not change with `--lang`. Mermaid uses the same nodes and edges, including isolated packages. Queries write only to stdout, so shell redirection can save an export. `--json` and `--mermaid` are mutually exclusive.

Programmatic users can call `getWorkspaceGraph(cwd, options)`, `filterWorkspaceGraph(graph, options)`, `whyWorkspaceDependency(graph, from, to, options)` and `getWorkspaceImpact(graph, package, options)`. Discovery refreshes its cache for each graph read. Query APIs accept the same public graph model without exposing pnpm implementation types.

## Grouped Commands

Inside a frozen GitHub workflow context, `repo release bootstrap --package @acme/new-library --version 0.1.0-alpha.0 --tag alpha --dry-run --json` plans a single public workspace package's preview release from the default-branch commit. The package name must match exactly, the version must be a SemVer prerelease and the tag must not select a stable release line. Without `--dry-run`, the default `prepare` stage builds and checks one tarball; it does not upload. Use managed `release.yml` with `mode=bootstrap` for the read-only preparation, OIDC publisher and isolated consumer verification, including a dry run dispatched from your local terminal. `verify-run-id` restores an original run's artifact and repeats verification without OIDC, rebuilding or uploading. See [single-package preview publishing](/tasks/release#publish-one-preview-and-validate-its-trusted-publisher) for workflow inputs, recovery and npm's initial trusted publisher validation deadline.

`repo release snapshot workflow --out .github/workflows --pnpm-version 12.21.0 --dry-run --json` previews the opt-in approved builder and trusted publisher pair. Remove `--dry-run` to create both files with conflict protection. The pnpm pin must match `packageManager`. `snapshot prepare --plan <frozen-plan.json> --output <external-directory>` builds a portable bundle; `snapshot publish-prepared --run-id <id> --run-attempt <attempt> --builder-sha256 <trusted-hash> --output <external-directory>` verifies a completed approved GitHub build and publishes only its checked tarballs. See [PR snapshot workflow setup and the API table](/tasks/release#publish-a-prepared-pr-snapshot-from-a-separate-trusted-workflow) for approval, OIDC, consumer isolation and retries.

For an optional root development environment, see the [Dev Container preset](./devcontainer.md): `repo tooling devcontainer --json --out ../plan.json`, then `repo tooling devcontainer --apply ../plan.json` after review.

Use [`repo workspace remove`](./removal.md) to preview removal of one exact package, inspect consumers and manual reference candidates, then explicitly apply a reviewed JSON plan. Preview does not delete anything; dependencies block removal unless their exact manifest fields are included with `--remove-references`.

```bash
repo ws ls
repo ws ls --json --out reports/workspaces.json
repo ws up
repo tg init --all
repo verify pre-commit
repo verify pre-push
repo env support --markdown --redact --out reports/support.md
repo config inspect
repo skills sync --codex
```

## Keep Reading

* [Add checks to CI](/tasks/ci)
* [Troubleshoot](/tasks/troubleshooting)
* [Command Aliases](./aliases.md)

### Public API baselines

`repoctl package api check [--package <selectors...>] [--json]` compares built public declarations with explicitly configured API Extractor reports. Set `tooling.apiReports` with package-relative declaration entries and workspace-relative `.api.md` baselines; install a local stable `@microsoft/api-extractor >=7.52.12 <8` and build first. `package api update --json` only previews; review its output, then pass it to `package api update --apply <plan.json>`. Updates revalidate inputs and use guarded transactions. Signature diffs and pending change intents are advisory; no complete SemVer inference or release is performed.

## `repo tooling references`

`check --json` checks existing references without opt-in. `plan` and `sync --dry-run` preview deterministic JSON without writes. With `tooling.projectReferences.enabled: true`, use `sync` or `apply <plan.json>` to maintain only registered references. Existing manual references and TypeScript/Vue validation scripts are preserved; incompatible compiler options, cycles, missing targets and stale plans block application. See [configuration](./config#typescript-project-references) for discovery, explicit compilation relationships, ownership and recovery.

### Incremental Playwright capability

Add browser tests to an existing Vue/React Vite application with `build` and `preview` scripts:

```sh
repo tooling capability list --json
repo tooling capability plan playwright --target web --route / --role button --name Increment --expect-text 'Count: 1' --json > e2e-plan.json
repo tooling capability apply e2e-plan.json --json
pnpm install
pnpm --filter @repoctl-e2e/web test:e2e:install
pnpm test:e2e
```

Use `--test-id` instead of `--role`/`--name` for a test-id locator. The route, click and expected text describe a real interaction in your application. The plan shows file diffs, dependencies, scripts, conflicts and next steps, without installing anything. Apply uses those exact reviewed bytes, rejects stale inputs and conflicts, and rolls back failed writes. A repeated unchanged apply has no effect. Choose an empty destination (`--directory`) for the new E2E workspace. Existing application sources and differing generated files are protected.

The capability creates an independent E2E workspace, headless Chromium tests, Turbo build dependencies, a dedicated CI workflow, HTML reports and failure traces. Browser installation is explicit. `--port` and `--ci-port` set distinct local and CI ports. CI never reuses a running service. `--reuse-existing-server` opts into local reuse; Playwright cleans up its own service after success, failure or interruption, and leaves a borrowed service running. Commit the lockfile after installation.

Public APIs: `listToolingCapabilities()`, `planToolingCapability(cwd, options)` and `applyToolingCapability(plan)`. JSON uses schema version 1 and stable English keys regardless of CLI language.

### Optional Storybook for a component library

`repo tooling capability plan storybook --target <exact-workspace> --framework vue|react --component <named-export> --example example.json --json` previews a separate `stories/<slug>` workspace. Apply the reviewed JSON with `repo tooling capability apply plan.json`. The first version supports Vue 3 and React 18/19 libraries with a build script, public entry and an explicit runtime version range. Install dependencies after applying and commit the resulting lockfile. Discovery and planning do not install Storybook or a browser.

A Vue prop-update example is `{"kind":"prop-update","prop":"msg","initial":"Hello Storybook","updated":"Updated component"}`. For a React counter use `{"kind":"click","args":{"initialCount":0},"alternateArgs":{"initialCount":4},"click":{"role":"button","name":"Increase"},"expectText":"1"}`. Component props must be JSON primitives; interaction assertions exercise the selected component. `Default`, `Alternate` and `Interaction` stories provide two states and a play test.

Run `pnpm build:storybook` for the static site, then `pnpm --filter @repoctl-stories/<slug> test:storybook:install` and `pnpm test:storybook` for headless Chromium tests. Turbo builds library dependencies first and records `storybook-static/**`; play tests run without caching and write a JUnit report. Use the generated workspace's `storybook` script for local development. Its independent Vitest and Vite configurations leave the library's existing tests, package exports, runtime dependencies and tarball contents unchanged. Existing stories and configuration are preserved; differing generated files block application and require a new review. No hosted visual testing service is enabled.

## Reuse release and hook automation

* `repo release auto-changeset --repository owner/repo --pr 123 --json` freezes GitHub revision data and previews an automatic intent; `--apply --expected plan.json` commits only in a trusted approved same-repository context. `--workflow --out <file>` exports the pinned opt-in recipe.
* `repo release validate-preparation --base <full SHA> --head <full SHA> --policy .github/release-validation.json --json` replays native pnpm versioning in inert metadata. Policy comes from the frozen base; only a valid result grants an ordinary intent-check exemption.
* `repo tooling hooks install --json` supplies a reusable `prepare` installer with user hooksPath protection, worktree support, CI skipping and native domain checks. Mixed root tooling and package staging runs each selected typecheck.
* `repo release snapshot publish-prepared --publisher-workflow .github/workflows/release.yml` selects the trusted publisher identity. `snapshot workflow` accepts `--environment`, `--builder-workflow`, `--publisher-workflow`, `--builder-name` and `--publisher-name`, generating the matching builder digest.

See [Reuse release and hook automation](/tasks/adoption) for APIs, policy, approval boundaries and migration instructions.
