English · 简体中文
Shared rules. Local context.
Inspect, compare, generate, and sync agent instruction files. Preview a shared baseline update while keeping the notes outside its block.
Quick start · Usage · Guide · Contribute
Find a conflict, fail the gate, and preview a recoverable baseline sync. Recording and reproduction.
Several tools can read different instruction files in the same repository. A shared rule drifts; a pasted update overwrites a local note. agentrc makes the files, exact differences, inferred commands, and sync plan available for review before a write.
Python 3.11+ on macOS or Linux. The demo uses temporary synthetic files and checks the expected failed conflict gate. Runtime dependencies are empty.
Clone the published source and install it in an isolated environment:
git clone --branch noah/agentrc https://github.com/LucasXlab/agentrc.git
cd agentrc
python3 -m venv .venv
. .venv/bin/activate
python -m pip install .
python scripts/demo.pyThe demo prints three operations: doctor exits 0, the deliberate TypeScript conflict makes check exit 1, and generate --stdout exits 0. The wrapper succeeds only when these results match.
For your first real check, replace /absolute/path/to/your/repo with your project directory:
agentrc doctor /absolute/path/to/your/repo
agentrc lint /absolute/path/to/your/repo
agentrc check /absolute/path/to/your/repoRead the detected file list and the specific lint explanations before changing rules. If there are no instruction files, review a scaffold with agentrc generate /absolute/path/to/your/repo --stdout. sync needs existing target files; an empty target directory returns exit 2 instead of reporting a successful update.
agentrc doctor ./project --json
agentrc diff ./first-checkout ./second-checkout --json
agentrc generate ./project --stdoutgenerate --stdout creates no file and does not execute inferred commands. A high file score does not cancel a recognized cross-file contradiction.
agentrc sync --baseline shared.md --target ./project --dry-run --jsonRead the plan before applying it. Sync preserves text outside the baseline block, creates raw-byte backups for changed files, and leaves an identical rerun unchanged. Multiple writes are not one filesystem transaction.
check exits 1 for a failed gate. Invalid or incomplete operations exit 2; reports such as doctor and diff do not fail solely because they found drift.
Linting, scoring, and cross-file conflict checks are finite heuristics. They do not prove that instructions are correct or safe. Filesystem reads are bounded; Windows is unsupported. Review filenames and remaining prose before sharing output.
See the usage guide for more examples, exact parameters, and technical boundaries.
Start with CONTRIBUTING.md. Use synthetic reproductions and report the validation you actually ran.
