promptarch
v1.1.0
Published
Generate and lint AI coding-agent context files (CLAUDE.md, AGENTS.md, Cursor rules) from your repo.
Maintainers
Readme
promptarch
Generate and lint AI coding-agent context files (CLAUDE.md, AGENTS.md, Cursor .mdc rules, GitHub Copilot instructions) straight from your repository.
Powered by the same deterministic linter and Context Pack exporters that run in the PromptArch web app and MCP server, bundled into the CLI, so there's nothing else to install.
lintis 100% offline and free: no account, no network. Great for CI.initextracts your repo's context and generates every agent format in one shot (this one calls the PromptArch API and uses credits).
Requirements
- Node.js ≥ 18
- A PromptArch account + API key only for
init(see Getting an API key).lintneeds neither.
Quick start
Lint an existing config without installing anything:
npx promptarch lint CLAUDE.mdOr install globally:
npm install -g promptarch
promptarch lint CLAUDE.md AGENTS.mdCommands
promptarch lint <files...>
Deterministic, offline lint of agent context files. Prints findings and exits non-zero when any error is found (add --strict to also fail on warnings), so it drops straight into CI.
promptarch lint CLAUDE.md
promptarch lint CLAUDE.md AGENTS.md .cursor/rules/*.mdc
promptarch lint CLAUDE.md --strict| Option | Description |
|--------|-------------|
| --strict | Treat warnings as failures too (not just errors) |
promptarch login
Store your API key (pk_…) in ~/.config/promptarch/config.json (written with 0600 permissions). Required before init.
promptarch login # paste the key when prompted
promptarch login --key pk_xxx # non-interactive (CI)| Option | Description |
|--------|-------------|
| --key <key> | Provide the key non-interactively (for CI) |
To point the CLI at a non-prod API (local dev / self-hosted), set the
PROMPTARCH_API_URLenv var.
promptarch init
Scan the current repository (stack manifest, build commands, directory tree, README, and any existing agent config), generate a canonical Context Pack via the API, and write every supported format (CLAUDE.md, AGENTS.md, Cursor .mdc, Copilot instructions).
Stack detection spans ecosystems, not just Node: package.json (JS/TS frameworks), Package.swift/.xcodeproj (Swift), pyproject.toml/requirements.txt (Python + FastAPI/Django/Flask), go.mod (Go), Cargo.toml (Rust), and Gemfile (Ruby/Rails). Commands are pulled from npm scripts, Makefile targets, and justfile recipes.
promptarch init --dry-run # print the extracted payload, no network call
promptarch init # generate + write files into the current directory
promptarch init --out ./generated # write to a specific directory| Option | Description |
|--------|-------------|
| --dry-run | Print the extracted payload without calling the API (no key needed) |
| --out <dir> | Output directory (default: current directory) |
| --force | Overwrite existing files without prompting |
If
initwould overwrite existing files (e.g. a hand-maintainedCLAUDE.md), it lists them and asks for confirmation first. In a non-interactive shell it aborts unless you pass--force. Use--outto write elsewhere.
initconsumes credits. The first generation on a new account is free.
Run promptarch --help (or promptarch <command> --help) and promptarch --version at any time.
Getting an API key
- Sign in at promptarch.ai.
- Go to your Profile → API keys, create a key (an optional label helps you track it), and copy the
pk_…value. It's shown once. promptarch login --key pk_…(or runpromptarch loginand paste it).
Keys are hashed at rest and can be revoked from the same page.
Configuration
Resolution order (first match wins):
| Setting | Env var | Config file | Default |
|---------|---------|-------------|---------|
| API key | PROMPTARCH_API_KEY | apiKey in ~/.config/promptarch/config.json | - |
| API URL | PROMPTARCH_API_URL | apiUrl in config | https://promptarch.ai |
Env vars are handy in CI:
PROMPTARCH_API_KEY=pk_xxx promptarch init --out ./generatedRelated
- PromptArch - the web app (prompt builder + Context Studio)
promptarch-mcp- MCP server exposinglint/generatetools to agents over Streamable HTTP
Develop
npm install
npm run build # tsup → dist/index.js
node dist/index.js lint ../CLAUDE.mdLicense
Proprietary. © PromptArch. All rights reserved. This CLI is provided for use with the PromptArch service; it is not open-source, and no rights to copy, modify, or redistribute the code are granted.
