Troubleshoot
When To Use
Use this task when initialization, checks, templates, or automation stop with an unexpected result.
Prerequisites
- Run the command from the repository root.
- Keep the original error and the repository revision available.
- Remove secrets before sharing command output.
Smallest Command
repo doctor --markdown --redact --out reports/doctor.mdExpected Output
The report identifies the repository root, package manager, workspace configuration, tooling, and the first failing check.
Common Branches
- The command is run from a child directory: change to the workspace root.
- A config file conflicts with a managed asset: inspect the plan before overwriting.
- A template key is unknown: list templates with
repo templates.
repoctl focuses on reports that can be reproduced, saved, and shared.
Start With Doctor
repo doctor
repo doctor --strictdoctor checks:
- Current directory and repository root.
- Node.js version.
pnpm-workspace.yaml.- The
repoctlCLI dependency. - Recommended root scripts.
- Conflicting config files.
- Husky and lint-staged wiring.
Save A Diagnostic Report
repo doctor --json --out reports/doctor.json
repo doctor --markdown --redact --out reports/doctor.mdMarkdown reports are useful in issues and PRs. --redact removes local absolute paths.
Inspect The Verification Plan
repo check --dry-run
repo check --json --out reports/check-plan.json
repo check --markdown --redact --out reports/check-plan.mdUse this when you need to understand why a file triggers a workspace typecheck or which tasks pre-push would run.
Collect Environment Information
repo env info
repo env support --markdown --redact --out reports/support.md
repo env snapshot --json --out reports/snapshot.json
repo env paths --markdown --redact --out reports/paths.mdThese commands help compare local, CI, Git, Node, pnpm, and workspace differences.
Common Fixes
Not At Repository Root
Change into the directory that contains pnpm-workspace.yaml and the root package.json, then run:
repo doctorConflicting Config Files
Keep only:
repoctl.config.tsmonorepo.config.ts is no longer loaded at runtime; rename it to repoctl.config.ts.
Unknown Template Key
List available templates:
repo templatesExplicit --template values are validated first. Invalid keys fail with suggestions.
Automation Should Not Prompt
Use non-interactive options:
repo init --yes
repo upgrade --no-overwrite
repo check --json --out reports/check-plan.json