getting started
installation
prepcli is a global CLI tool. Install it once and use it across all your projects.
Requires Node.js 18 or later. The script checks your Node version, installs prepcli globally, and prints next steps. Or install directly via npm:
After installation, prepcli --version should print the current version.
authentication
Authentication uses email OTP — no passwords. Run the login command and enter your email. A 6-digit code is sent to your inbox. Enter the code to authenticate.
The auth token is stored in ~/.prepcli/config.json with mode 0600. It is never committed, never synced, never included in any project file. Run prepcli auth logout to invalidate the session and delete the local token.
initialize a project
Run prepcli init inside your project directory. It scans your codebase (package.json, lock files, config files), detects the stack, creates a .prepclirc file, and pushes an initial project context to the cloud.
.prepclirc contains only a project_id UUID and the API URL — no secrets. It is safe to commit. Every team member who clones the repo connects to the same project context automatically.
install workflow files
Run prepcli install to copy the six workflow files to your AI tools. It auto-detects Claude Code, Cursor, Windsurf, and Antigravity based on config files present in your environment.
using slash commands
Once prepcli install completes, the six workflow files are registered as native slash commands in your AI tool. You invoke them directly in the chat or terminal interface — no extra terminal, no flags, no copy-paste.
In Claude Code, type the command in the chat panel or the in-terminal prompt. In Cursor, open the chat panel (⌘L) and type the slash command. In Windsurf, use the Cascade chat panel. In Antigravity, type it in the chat interface. The tool routes it to the installed workflow file, which silently loads your project context before the session starts.
Each session is tracked automatically. At git push, prepcli surfaces the accumulated turns and asks for a one-line summary before saving the decision to your project history.
commands reference
prepcli auth
prepcli init
Scans the current directory, detects the stack, creates .prepclirc, pushes initial context to cloud, creates the decision history branch, and installs the pre-push git hook.
Re-running prepcli init is safe. It never recreates or overwrites the decision history. It only updates the context snapshot and re-installs hooks if missing.
prepcli context
Fetch and display the current project context stored in the cloud.
prepcli install / update
prepcli session
Called by AI workflow files at the end of each task. Writes one session turn to the local .prepcli-session file. No network call. No auth required. Works offline.
At git push, the pre-push hook reads .prepcli-session, shows the accumulated turns, and asks for one final summary sentence before saving. Pressing Enter skips recording — the push is never blocked.
prepcli log
Browse decisions from your project's history.
prepcli record
Manually save a decision. Use this for decisions not tied to an AI session — architectural discoveries, dependency choices, security decisions.
how it works
context injection
Every workflow file begins with a silent context fetch. Before the AI asks the user a single question, it loads your project context from the cloud — stack, constraints, recent decisions, hard limits, and open questions.
The AI carries this context silently and operates as if it already knows the project. It does not announce what it read or summarize it back — it just uses it.
the decision history
Every AI work session is recorded as a structured decision — what was done, why, what was ruled out, what constraints were active. Records are linked to the commits they produced, travel with every clone of the repo, and are readable without a prepcli account.
decision records format
Each record is a structured Markdown file with YAML frontmatter. The frontmatter links it to the commit. The body contains the full narrative.
self-hosting
prepcli uses Supabase as its cloud backend. The schema is open — enterprise users can self-host on their own Supabase instance (or raw PostgreSQL with pgvector) with no code changes.
supabase setup
Create a Supabase project, enable the pgvector extension, and run the schema migrations. Then set SUPABASE_URL and SUPABASE_ANON_KEY in the prepcli environment.
environment variables
row level security
All tables have Row Level Security enabled. Users can only read and write data for projects they are members of. This isolation is enforced at the database level — bypassing it at the application layer is not possible.