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 lighter terminal first surface. It hosts the same MCP server, local cache and hook supervisor as Pathrule Studio, but lives entirely in your shell. It is the supported integration route for Cursor, Windsurf and GitHub Copilot, and it also fits SSH, headless and standalone terminal workflows.
It is a first class runtime, not a fallback. The content and MCP contract stay shared, while delivery follows the strongest channel each client exposes: native hooks for Claude Code, Codex, Cursor and GitHub Copilot, and a generated companion file plus MCP for Windsurf.
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 Cursor, Windsurf and GitHub Copilot configs, and can also wire standalone Claude Code and Codex CLI outside Studio.
- Pathrule Intelligence. The same local model install Studio uses, in the same place under your Pathrule home. The CLI does not keep a second copy, and it drives the same resident server. See the local model.
- Compilation and delivery. The same understanding, compilation and task-scoped Agent IR as Studio. The CLI is a different way in, not a reduced intelligence layer.
- MCP server. Runs locally and is the surface your assistant speaks to.
- Hook supervisor. Registers the native event profile for hook-capable clients and keeps the same path-scoped selection model as 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.