Skip to content
Pathrule

docs

Command reference

Every Pathrule CLI command, what it does and the options that matter, from sign-in and workspace setup to knowledge, diagnostics and account-free local use.

On this page

Every command in Pathrule CLI, grouped the way pathrule help groups them. Each entry says what the command does and which options matter. For a first setup, start with Install.

pathrule <command> [subcommand] [arguments] [options]
pathrule help

Global options

OptionWhat it does
--jsonPrints one machine-readable JSON object instead of human output. It also turns off color, prompts and browser windows.
--yesAccepts the confirmation that setup and cache prune ask for before they change anything.
--no-openNever opens a browser. A command that would open one prints the URL instead.
--no-colorPrints plain output with no color. Setting the NO_COLOR environment variable to 1 does the same.
--localRuns init, setup, sync, search and the memory, rule and skill commands against an account-free local store. See Work without an account.
--help, -hPrints the command list.
--version, -vPrints the CLI version.

When the CI environment variable is true, the CLI also skips prompts and browser windows, so a command never waits for input on a runner.

Options a command does not know

The CLI does not reject an option it does not recognise. Most commands read it as a plain argument, which makes the command fail or act on the wrong target. pathrule workspace attach --path ~/repos/app looks for a workspace named --path, and pathrule install --client cursor stops because --client is not a client name. setup, invite, team, and memory add, rule add and skill add check their own options and stop with an error on one they do not know. Use the options on this page or in pathrule help.

JSON output

With --json, every reply is one JSON object with ok, command and cwd, plus data when the command succeeded, or error with a code and a message when it did not. Some replies add next_steps with the commands to run next. --json is available on commands that advertise it in --help. snapshot and eject do not support it, so run that one without it. Sign in with plain pathrule login, since the sign-in flow needs to show you a code.

Exit codes

0 means the command did what you asked. Most usage errors, such as a missing argument or an unknown client name, exit with 64. Any other failure exits with 1, and pathrule doctor exits with 1 when a check fails. On a Node.js version older than 20.11.1, every command stops with 78 before it does anything.

Get started

CommandWhat it does
pathrule setupConnects the current folder in one guided run. It signs you in if needed, suggests the workspaces in your organization that match this folder (the same git remote, for example), attaches the one you pick or creates one named after the folder, asks which AI clients to connect, installs them, writes the files they read, and offers to start a first project scan in one of them. On an Apple Silicon Mac it finally offers the optional on-device model.
pathrule init [name]Creates a workspace in your current organization, named after the folder unless you give a name, and attaches the current folder to it.

Without a terminal to prompt in, pathrule setup only prints a plan: the organization, the matching workspaces, and the command that would attach the best one. These options make it act, and acting needs --yes:

  • --workspace <name-or-id> attaches an existing workspace. --workspace-id is the same option.
  • --create-workspace creates a workspace named after the folder. Add --workspace-name <name> to name it yourself.
  • --select-workspace <name-or-id> makes a workspace current without attaching this folder.
  • --org <slug-or-id> switches organization first.
  • --target <client> installs the MCP entry for claude, cursor, codex, windsurf, copilot or all.
pathrule setup --workspace my-project --target all --yes

pathrule setup bootstrap --rerun scans the repository's docs and commit history again and prepares fresh memory and rule candidates for the current workspace's first project scan.

Account and context

CommandWhat it does
pathrule loginSigns in with a one-time code. The CLI prints the code and opens the approval page in your browser with the code filled in, or prints the URL to open on any device when there is no browser. --no-open never opens a browser. --browser-callback signs in with GitHub in a browser on this machine and returns over a local callback, and falls back to the code when that is not possible. --device-code is accepted and runs the default code flow.
pathrule logoutSigns Pathrule CLI out on this machine. --all also signs out the other Pathrule surfaces on this machine, such as the VS Code extension.
pathrule whoamiShows the signed-in account and when the session expires.
pathrule org listLists your organizations with your role, and marks the current one with *. Plain pathrule org does the same.
pathrule org currentShows the current organization and your role in it.
pathrule org use <slug-or-id>Switches the current organization.
pathrule workspace listLists the workspaces in the current organization and marks the current one with *. Plain pathrule workspace does the same.
pathrule workspace currentShows the current workspace.
pathrule workspace use <name-or-id>Makes a workspace current without attaching a folder.
pathrule workspace create <name>Creates a workspace and attaches the current folder to it.
pathrule workspace attach [name-or-id]Attaches the current folder to an existing workspace, matched by its exact name or its id. With no argument it attaches the current workspace. There is no path option: run it inside the folder.
pathrule workspace detach [name-or-id]Removes the workspace's folder attachment on this machine. The workspace and its content stay in Pathrule.
pathrule workspace inspectShows the current workspace in detail: its organization and plan, where it is attached, its git remote, how many memories, rules and skills it holds, plan usage, which AI clients are set up, and recent activity.

Attaching, creating, init and workspace use also make that workspace current. Commands such as memory, rule, skill, search and sync work on the current workspace.

Workspace setup

CommandWhat it does
pathrule attach [name-or-id]The same as workspace attach.
pathrule detach [name-or-id]The same as workspace detach.
pathrule install [client]Writes Pathrule's MCP server entry into an AI client's own user-level configuration and leaves every other server in it alone. The client is claude (or claude-code), cursor, codex, windsurf, copilot (or github-copilot), or all, which is the default. GitHub Copilot gets two entries, one for the Copilot CLI and one for VS Code.
pathrule uninstall [client]Removes Pathrule's MCP entry from that client's configuration, or from all five.
pathrule syncWrites the files your AI clients read into the repository: instruction files, hook configuration and the local hook index. Run it in the folder the workspace is attached to. --skills syncs only the workspace's skills into your clients' skill folders. --local syncs an account-free workspace.
pathrule mcp runStarts Pathrule's local MCP server over standard input and output. This is the command the MCP entry written by pathrule install launches, so your AI client runs it and you do not need to.

pathrule sync writes files for the AI clients chosen for this workspace in pathrule setup. When none are chosen, it writes for the clients whose Pathrule files are already in the repository, and for Claude Code when there are none. Claude Code's CLAUDE.md and hook entry are refreshed on every sync. Install lists each file. To take Pathrule back out of a repository, see Remove Pathrule from a project.

Knowledge

CommandWhat it does
pathrule search <query>Searches memories, rules and skills in the current workspace. --type memory,rule narrows the kinds, --path /apps/api narrows to a path, and --limit <n> caps the results.
pathrule memory listLists memories. --path or a leading path narrows the list, so pathrule memory list /apps/api and pathrule /apps/api memory list are the same. --limit <n> caps it.
pathrule memory read <id-or-title>Prints a memory. Pass --print to print long content in full in the terminal.
pathrule memory addWrites a memory with --path </node/path> --title <title>. The body comes from --body, from standard input, or from your editor (VISUAL or EDITOR) when you give neither. --allow-duplicate skips the duplicate check.
pathrule rule list, read, addThe same for rules. rule add takes --name instead of --title, plus --priority (high, medium or low, default medium) and --scope (project, folder or file_type, default project).
pathrule skill list, read, addThe same for skills. skill add takes --name and an optional --description.
pathrule refresh listLists the open refresh tasks, the requests to update knowledge that has gone stale. --include-in-progress adds the claimed ones, and --limit <n> caps the list.
pathrule refresh claim [id]Claims a refresh task, the next open one when you give no id, and prints its brief.
pathrule refresh resolve <id> --status appliedCloses a refresh task as applied or rejected. --note "<text>" records why.
pathrule snapshotCaptures an inventory of the current folder, with its file tree, manifests and short docs samples, git branch and recent history, and uploads it to the workspace. It reads no other file contents. --dry-run prints it without uploading, and --notes "<text>" attaches a note.
pathrule snapshot list [n]Lists the workspace's most recent snapshots.

Your working preferences and the local model

CommandWhat it does
pathrule me listLists what User Intelligence holds about how you work, both what is in use and what is not yet. Plain pathrule me does the same.
pathrule me teach "<sentence>"Teaches a preference in your own words. It needs the optional on-device model.
pathrule me explain <id>Shows one preference with the evidence behind it. The id is the short id me list prints.
pathrule me scope <id>Keeps a preference to the workspace you run it in. --everywhere lets it apply in every workspace.
pathrule me forget <id>Stops using a preference and keeps it as rejected, so the same evidence does not bring it back. --delete removes it entirely.
pathrule me context "<task>"Prints what an agent would receive for that task, and which preferences were held back and why.
pathrule intelligence statusShows whether the on-device model is installed, its version, and whether an update is available. Plain pathrule intelligence does the same.
pathrule intelligence installSets up the local runtime the model needs, then downloads the model and verifies its checksum before it becomes active. It needs an Apple Silicon Mac.
pathrule intelligence updateInstalls a newer model when one is available. If the update fails, the model you had stays in place.
pathrule intelligence removeRemoves the model. Everything that does not need it keeps working as before.

Local Console and agent integrations

CommandWhat it does
pathrule uiOpens the accountless Local Console for knowledge, activity and Local Signals. --port, --no-open and --json control how it opens.
pathrule integrationsInteractive setup for Claude Code and Codex. Outside an interactive terminal, lists the setup.
pathrule integrations add claude codex --local --dry-runPreviews a native integration without writing. Choose --cloud for Cloud mode.
pathrule integrations listLists detected agents and recorded integrations.
pathrule integrations doctorRead-only checks of the installed integration.
pathrule integrations repairReapplies recorded Pathrule integrations.
pathrule integrations remove <agent>Removes the recorded integration.
pathrule telemetryShows the telemetry preference and whether this CLI can send.
pathrule telemetry enableOpts a signed-in managed CLI into anonymous usage events.
pathrule telemetry disableTurns them off.

See Local Console and Native agent integrations.

Remove project integration

pathrule eject shows a read-only plan for removing the files and managed regions Pathrule owns in the current repository. pathrule eject --apply carries it out after you review it. Eject does not have a --json form. Native plugins are removed through pathrule integrations remove <agent>.

Diagnostics and maintenance

CommandWhat it does
pathrule statusShows the signed-in account, the current organization and plan, the current workspace, and whether this folder is attached.
pathrule doctorRuns read-only checks: sign-in, organization, workspace, whether this folder is attached, whether each AI client has Pathrule's MCP entry, and the files Pathrule manages in this folder with the surface and version that wrote each one. It names the next command when something needs attention. With --json the report also covers the Node.js version and flags an MCP entry whose launch command is out of date. --bundle writes a support file with credentials and local paths redacted.
pathrule repairRewrites out-of-date Pathrule MCP entries in your AI client configurations, leaving other servers alone, writes the repository files again, and reports what changed.
pathrule preflight <action>Checks whether your plan allows an action before you try it. The action is create_workspace, write_memory, write_rule, write_skill, sync_agents or materialize_skills.
pathrule cache pruneLists stale local cache folders without removing them. --yes removes them.
pathrule config get <key>Reads a preference: update.policy, telemetry.enabled or telemetry.id.
pathrule config set <key> <value>update.policy manual stops the daily update check, while notify and auto keep it. telemetry.enabled false turns the anonymous usage telemetry off. Setting the NO_TELEMETRY environment variable to 1 does the same for one run or shell.
pathrule config reset telemetry-idReplaces the telemetry id with a new one.
pathrule updateChecks for a newer CLI and prints the command that installs it. It never installs anything itself.

Once a day, an interactive run also checks for a newer CLI and prints a one line notice with the upgrade command. It only names a version that is newer than yours.

The standalone local CLI sends no telemetry. A signed-in managed CLI sends anonymous usage events only after you opt in with pathrule telemetry enable. Events carry no code, paths, prompts, knowledge, email or account and workspace ids. Turn them off with pathrule telemetry disable; NO_TELEMETRY=1, DO_NOT_TRACK=1 and CI keep them off.

Team and billing

CommandWhat it does
pathrule teamLists the members and pending invites of the current organization, or of --org <slug-or-id>. pathrule team open opens Pathrule Web, where members are managed.
pathrule invite <email>Invites a teammate to the current organization as an editor. --role sets admin, editor or viewer, and --org and --workspace set the organization and workspace. It reports whether the invite email went out and how the invite affects your seats.
pathrule billingOpens the organization's billing in Pathrule Web.
pathrule upgradeOpens billing to pick a plan.

Help and version

CommandWhat it does
pathrule helpPrints the command list.
pathrule versionPrints the CLI version, the same as --version.

Work without an account

Pathrule CLI runs on a local store with no account and no cloud. Run these inside the project:

cd ~/repos/my-project
pathrule init --local
pathrule setup --local

pathrule init --local [name] creates a local workspace for the current folder, kept on this machine, and reuses the one that already covers the folder if there is one. pathrule setup --local does the same and then installs the local MCP entry for every AI client, or for one with --target <client>, installs the hooks and writes the repository files, all without signing in. --workspace-name <name> names a new workspace. Options that need an account, such as --org or --workspace, stop with an error.

In a local workspace your AI agent writes memories, rules and skills through Pathrule's MCP tools. From the terminal you read and search them with --local:

pathrule memory list --local
pathrule rule read "No service key in browser code" --local
pathrule search "migrations" --local
pathrule sync --local

memory add, rule add and skill add need an account. With --local they say so and change nothing. See Open source core for what the local edition includes.

  • Install for the first setup, what Pathrule writes into a repository, and how to remove it.
  • Pathrule CLI for what the CLI owns and when to use it.
  • User Intelligence for what pathrule me manages.