Command line
pisharp takes the same command line as Pi v1.2.0. Run pisharp --help for the exact list in your build. Pi’s Command Line reference applies; this page covers the common cases and what PiSharp adds.
pisharp [options] [--] [@files...] [messages...]pisharp install <source> [-l]pisharp remove <source> [-l]pisharp update [source|self|pi] [--extensions|--models|--all]pisharp listpisharp config [-l]pisharp auth <check|print-api-key|print-bearer-token>pisharp mcp <add|remove|list|login|logout>pisharp durable [--continue] # experimental, PiSharp-only| Command | What it does |
|---|---|
pisharp |
Opens the terminal UI. |
pisharp "message" |
Opens the terminal UI with a first prompt. |
pisharp -p "message" |
Runs the prompt, prints the final answer and exits. |
pisharp --mode json "message" |
Runs the prompt and writes Pi’s JSONL events to stdout. |
pisharp --mode rpc |
Speaks Pi’s RPC protocol over stdin and stdout. |
pisharp --export <file> [output] |
Writes a session file as HTML and exits. |
When stdin or stdout is redirected, PiSharp uses print mode, as Pi does. Automatic compaction runs in every mode; in print mode a “prompt is too long” error compacts the session and retries, as in Pi. @path arguments add a text file or image to the first prompt. Piped stdin is added in front of the first prompt.
Common options
Section titled “Common options”| Option | Meaning |
|---|---|
--model <pattern> |
Model by id, provider/id or fuzzy match, with an optional :thinking suffix. |
--models <patterns> |
Models for Ctrl+P cycling. Globs and fuzzy matches work. |
--thinking <level> |
off, minimal, low, medium, high, xhigh or max. |
--list-models [search] |
Lists the models you can use, then exits. |
-c, --continue |
Continues the latest session for this folder. |
-r, --resume |
Opens the session picker. |
--session <path|id> |
Opens a session file or id. |
--fork <path|id> |
Forks a session into a new one. |
--no-session |
Keeps the session in memory only. |
-t, --tools <list> |
Tool allowlist. +name and -name change the defaults instead. |
-xt, --exclude-tools <list> |
Tools to turn off, MCP tools included. |
-e, --extension <path> |
Loads an extension or package for this run, with its skills, prompt templates and themes. -e builtin:<name> loads a built-in extension. Repeatable. |
-ne, --no-extensions |
Turns off discovered and built-in extensions. -e still works. |
--no-mcp |
No MCP servers and no MCP tools: the mcp built-in extension stays out. |
-a, --approve / -na, --no-approve |
Trusts, or ignores, project files for this run. |
--offline |
No startup network use. Same as PI_OFFLINE=1. |
-v, --version |
Prints the PiSharp version. |
Skills, prompt templates, themes and context files have their own --skill, --prompt-template, --theme, --use-theme, --no-skills, --no-prompt-templates, --no-themes and --no-context-files options, as in Pi.
PiSharp additions
Section titled “PiSharp additions”--tool-policy pi|explicitsets how far the built-in tools reach. See Tool policy.pisharp session <verb>keeps PiSharp’s earlier explicit-path commands (create,prompt,resume,rpc,terminal,copy,migrateand more). They use theexplicittool policy and their--allow-*grants. New scripts should use the Pi options above.pisharp durable [--continue]runs the experimental durable agent, whose sessions survive a crash. See Pi Durable.
pisharp --help lists these three additions with Pi’s commands and options; Pi’s help has none of them.
Packages
Section titled “Packages”install, remove (or uninstall), list and config work as in Pi. See Packages.
pisharp update --extensions updates installed packages and pisharp update --models refreshes the model catalogs. pisharp update on its own would update Pi itself. PiSharp can’t update itself that way and says so. Update the tool with:
dotnet tool update -g PiSharp.CliCredentials and MCP
Section titled “Credentials and MCP”pisharp auth check, print-api-key and print-bearer-token resolve credentials as Pi does. pisharp mcp add|remove|list|login|logout change the same mcp.json and mcp-auth.json that Pi uses. See Providers and MCP.
Environment variables
Section titled “Environment variables”PiSharp reads Pi’s variables: provider keys such as ANTHROPIC_API_KEY and OPENAI_API_KEY, PI_CODING_AGENT_DIR, PI_CODING_AGENT_SESSION_DIR, PI_OFFLINE and the rest. pisharp --help lists them. PI_TELEMETRY is accepted and ignored: PiSharp sends no install telemetry.