Perseus CLI quickstart
About Perseus CLI#
The Perseus CLI is the fastest way to connect a real checkout to Perseus. It indexes the code you are editing, including uncommitted files, and then answers questions with ranked path:line hits. Agents can call the same commands, so their repo search goes through Perseus instead of generic file exploration.
Prerequisites#
Install the CLI for your machine.
curl -fsSL https://perseus.computer/install.sh | shirm https://perseus.computer/install.ps1 | iexSign in. On a laptop this opens a browser. On an SSH box, use the device flow.
perseus loginperseus login --deviceUseful login flags: --timeout changes how long the CLI waits for approval, --port chooses the loopback callback port, and --website points login at a non-production web origin.
Index a repository#
Indexing makes a repo searchable. Run it from the checkout agents will work in.
cd /path/to/your/repo
perseus indexPass a local path to index another checkout, or pass owner/repo / a GitHub URL to index GitHub's copy server-side.
perseus index ../other-checkout
perseus index efficientsystemsinc/perseus--forcerebuilds from scratch instead of sending an incremental delta.--jsonprints one parseable success record to stdout.--no-progressremoves the live progress UI for CI logs.--approve-allinstalls agent rules during indexing without prompting.--statusshows the latest ready index instead of starting a job.
Keep the index fresh
During active work, run watch once and let it sync edits in the background. Queries use the last ready index while the fresh one lands.
perseus watch
# stop after a fixed window
perseus watch --for 10m--no-initialwaits for a file change before indexing.--onceruns one sync decision and exits.--statusprints watch state; use it for diagnosis, not as a readiness gate.--change-limitlimits changed paths printed in status/change logs.--forcesyncs on startup even if watch thinks the tree is fresh.
Search code#
Use query for one focused location, route, symbol, or error path. Write short noun phrases, not broad questions.
perseus query --no-summary --json "auth enforcement on query route"
perseus query --no-summary --json "PlanCheckoutButtons billing route"Good queries name the rare thing: a route, visible UI label, function, table, error string, or command surface. Avoid one-word searches like handler, config, or service.
--no-summaryskips answer synthesis and prints ranked locations only.--jsonputs structured JSON on stdout and status on stderr.--files-onlyprints bare path:line results for piping; implies --no-summary.-k, --top-kraises or lowers the maximum number of hits returned.--indexqueries an explicit index id or owner/repo instead of the current checkout.--diffadds explicit git diff context such as main...HEAD.--diff-modechooses changed, impacted, or regression search over the diff.
Research packets#
Use research when several different questions belong together. It returns per-question hits plus a combined reading list.
perseus research "checkout billing route" "pricing plan catalog" "billing tests for plan limits"QUESTION...requires 2-8 distinct questions, not synonyms for one search.-k, --top-ksets hits per question.--files-onlyprints only the combined reading list.--jsonprints the raw packet.--indexruns against an explicit index id or owner/repo.
Review a change#
Before editing a shared symbol, ask what rides on it. Before shipping a diff, ask what the diff puts at risk.
perseus impact BillingPlan --print-tests
perseus impact perseus/core/billing.py --run-tests
perseus eval --print-tests
perseus eval --run-tests
perseus eval --diff main...HEAD --print-tests--print-testsprints the test command(s) Perseus derives from the impact packet.--run-testsruns those commands and exits with the failing test status.--test-commandoverrides the test runner prefix when auto is not enough.--files-onlyprints the verify-order as path:line entries.--jsonprints the raw packet for automation.
Trace code flow
Use path when you know two endpoints and need the symbol graph between them.
perseus path post_query persist_run
perseus path routes/billing.py BillingPlan --max-depth 8--max-depth, -dsets the maximum hops on a path.--paths, -ksets how many shortest paths to return.--files-onlyprints path steps as path:line blocks.--jsonprints the raw PathResult.
Workspace commands#
These commands explain identity, inventory, and plan state. They are useful when choosing a non-current index or debugging access.
perseus status
perseus indexes -n 50
perseus billingstatus --jsonprints account, org, repo, branch/worktree, index, and billing state.indexes --jsonprints indexed contexts exactly as the API returns them.billing --jsonprints plan, usage, entitlement caps, and Stripe setup state.
Agents and feedback#
Install the Perseus skill for coding agents. It teaches them to use Perseus commands for repo search instead of harness-wide file exploration.
npx skills add efficientsystemsinc/perseus-skillperseus rules add and perseus update run this for you (and clean up the old built-in skill). If npx is missing they offer to install Node.js on the spot, so a manual install is rarely needed.
For repository-local rules, use perseus rules.
perseus rules add
perseus rules status
perseus rules update
perseus rules removeSend feedback when retrieval helped, missed, looked stale, or when CLI output/docs were confusing. Traces are optional.
perseus feedback --agent "top hit nailed it - BillingPlan was in perseus/core/billing.py"
perseus feedback --agent "docs gap: query flags need clearer examples"--agenttags source=agent and links the latest local Perseus session when one exists.--metadata, -madds key=value metadata; repeat for multiple fields.--trace-fileattaches a trace file after user approval.--send-traceconfirms trace upload without an interactive prompt.
Command reference#
Use perseus --help or man perseus for the terminal reference. The common commands are:
| login | Sign in and store the local CLI token. |
|---|---|
| index | Upload and index the current checkout, a local path, or GitHub repo. |
| watch | Keep a checkout fresh while you work. |
| query | Find code for one focused question. |
| research | Answer 2-8 linked questions as one reading packet. |
| impact | Show blast radius for symbols or files before changing them. |
| eval | Show blast radius for a git diff. |
| path | Trace how one symbol or file reaches another. |
| status | Show account, org, repo, branch, index, and billing state. |
| indexes | List indexed repo, branch, and worktree contexts. |
| billing | Show plan, usage, caps, and Stripe state. |
| feedback | Send retrieval, docs, CLI, or product feedback. |
| rules | Install or remove repo-local agent instructions. |