Pathrule CLI
The terminal first surface for Pathrule. Scriptable, SSH friendly, and a full local runtime for agents you drive from a shell.
Pathrule CLI is the terminal first surface. It hosts the same MCP server and hook supervisor as Pathrule Studio, but lives entirely in your shell. It is the right surface if you work over SSH, on a headless box, or just prefer the terminal.
It is a first class runtime, not a fallback. The same content, the same hooks, the same AI client integrations, all driven from pathrule <command>.
What Pathrule CLI owns
- Auth. Two flows: a browser based PKCE flow for desktops, and a device code flow that works over SSH or on any headless machine.
- Workspace attach. Bind a workspace to a local directory so the runtime can resolve your AI session's working directory.
- AI client install and sync. Writes Claude Code, Cursor, and Codex CLI configs and keeps them in sync when content changes.
- MCP server. Runs locally and is the surface your assistant speaks to.
- Hook supervisor. Same path scoped injection model as Pathrule Studio.
- Doctor. A single command that audits cache, MCP server, hook registration, and AI client integration.
- Scripting. Every command supports
--jsonfor stable, machine readable output.
Happy path
pathrule login
pathrule org use my-team
pathrule workspace create my-project
pathrule workspace attach --path ~/repos/my-project
pathrule install claude
pathrule install cursor
pathrule sync
pathrule start
pathrule doctor
After this, opening Claude Code or Cursor in ~/repos/my-project will see the Pathrule context section before the first tool call.
Output modes
The CLI has two output modes that you switch between with --json.
- Human mode (default): Structured sections, progress spinners, clear next command suggestions. Designed for someone reading the output.
- JSON mode: Stable schema for scripts, CI runners, and automation. Every command documents its JSON shape.
pathrule workspace list # human
pathrule workspace list --json # machine readable
Commands that open the browser
A few flows are cloud only and open Pathrule Web in your default browser rather than reimplementing the UI in the terminal.
pathrule billing
pathrule team
pathrule org open
pathrule workspace open
Each one prints the URL it opened so you can copy it for a remote shell.
When to use Pathrule CLI
Use Pathrule CLI when you work over SSH, when you want to script Pathrule into a CI runner, or when you simply live in the terminal. For a full graphical workbench on macOS, use Pathrule Studio, which bundles the same runtime.
What to read next
- Install for install paths and the sign in flows in detail.
- Pathrule Studio for the macOS app that bundles the same runtime.
- How hooks work for what the runtime hands to your assistant.