agentleFS
KubementatKubementat/ai_agent_skills/skills/pi-cli/SKILL.md

pi-cli

Skill2 starsChanged 8 months agoMITView on GitHub

Expert control of the pi coding agent CLI. Use when the user wants to launch pi sessions, manage extensions/packages, switch models, configure tools, export sessions, resume conversations, or script pi non-interactively. Covers all flags, commands, environment variables, and usage patterns.

  • Reads credentials

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Default enabled tools: read, bash, edit, write

    line 85

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Pi CLI

pi is an AI coding assistant CLI exposing read, bash, edit, and write tools. This skill covers every aspect of controlling it from the command line.

Core Commands

# Interactive session (default)
pi

# Interactive with initial prompt
pi "Refactor the auth module"

# Non-interactive: process and exit
pi -p "List all .ts files in src/"

# Include files in prompt
pi @prompt.md @image.png "What does this do?"

# Multiple messages (interactive)
pi "Read package.json" "What dependencies do we have?"

Session Management

pi --continue              # Continue previous session (-c)
pi --resume                # Pick a past session to resume (-r)
pi --session <path>        # Use a specific session file
pi --fork <path|uuid>      # Fork a session into a new one
pi --session-dir <dir>     # Custom directory for session storage
pi --no-session            # Ephemeral session (nothing saved)
pi --export session.jsonl output.html  # Export session to HTML

Extension Management

pi install <source>        # Install extension source globally
pi install <source> -l     # Install locally (project-level)
pi remove <source>         # Remove extension source
pi uninstall <source>      # Alias for remove
pi update                  # Update all installed extensions
pi update <source>         # Update a specific extension
pi list                    # List installed extensions
pi config                  # Open TUI to enable/disable resources
pi <command> --help        # Help for any sub-command

Model & Provider Selection

# Default provider: google
pi --provider anthropic --model claude-sonnet-4 "..."

# Provider/model shorthand (no --provider needed)
pi --model openai/gpt-4o "..."
pi --model anthropic/claude-opus-4 "..."

# Fuzzy / glob matching
pi --model "*sonnet*" "..."

# With thinking level shorthand
pi --model sonnet:high "Solve this complex problem"
pi --thinking high "..."   # off | minimal | low | medium | high | xhigh | max

# Cycle through multiple models with Ctrl+P
pi --models claude-sonnet,claude-haiku,gpt-4o
pi --models "github-copilot/*"
pi --models sonnet:high,haiku:low

# Discover available models
pi --list-models
pi --list-models sonnet

Tool Configuration

Default enabled tools: read, bash, edit, write

# Full tool set
pi --tools read,bash,edit,write,grep,find,ls "..."

# Read-only (no file modifications)
pi --tools read,grep,find,ls -p "Review the code in src/"

# Disable all tools (built-in and extension)
pi --no-tools "..."

Available tools:

ToolDescriptionDefault
readRead file contents✅
bashExecute bash commands✅
editEdit files with find/replace✅
writeWrite files (creates/overwrites)✅
grepSearch file contents (read-only)❌
findFind files by glob (read-only)❌
lsList directory contents (read-only)❌

Skills, Extensions & Themes

# Load specific skill(s)
pi --skill /path/to/skill-dir "..."
pi --skill /path/to/skill1 --skill /path/to/skill2 "..."

# Disable automatic skill discovery
pi --no-skills "..."           # -ns shorthand

# Load extension(s) explicitly
pi --extension /path/to/ext.js "..."   # -e shorthand
pi -e ext1.js -e ext2.js "..."

# Disable automatic extension discovery
pi --no-extensions "..."       # -ne shorthand

# Load prompt template(s)
pi --prompt-template /path/to/template "..."

# Disable automatic prompt template discovery
pi --no-prompt-templates "..."  # -np shorthand

# Load theme(s)
pi --theme /path/to/theme "..."

# Disable automatic theme discovery
pi --no-themes "..."

System Prompt Control

pi --system-prompt "You are a Rust expert. ..."
pi --append-system-prompt "Always add tests for new code."
# Can also point to a file:
pi --append-system-prompt @extra-instructions.md

Output Modes

pi --mode text   # Default: human-readable output
pi --mode json   # JSON-structured output
pi --mode rpc    # RPC protocol (for tool integrations)

Misc Flags

pi --api-key <key>     # Override API key (defaults to env vars)
pi --verbose           # Force verbose startup output
pi --offline           # Disable startup network ops (same as PI_OFFLINE=1)
pi --version           # Show version number
pi --help              # Show full help

Extension-Specific Flags

Some extensions register their own flags to the pi CLI:

# Enable per-session control sockets
pi --session-control "..."

# Specify a custom MCP configuration file
pi --mcp-config /path/to/mcp-config.json "..."

Environment Variables

VariablePurpose
ANTHROPIC_AUTH_TOKENAnthropic bearer auth token
ANTHROPIC_API_KEYAnthropic Claude API key
ANTHROPIC_OAUTH_TOKENAnthropic OAuth token (alternative to API key)
OPENAI_API_KEYOpenAI GPT API key
AZURE_OPENAI_API_KEYAzure OpenAI API key
AZURE_OPENAI_BASE_URLAzure OpenAI base URL
AZURE_OPENAI_RESOURCE_NAMEAzure OpenAI resource name
AZURE_OPENAI_API_VERSIONAzure OpenAI API version (default: v1)
AZURE_OPENAI_DEPLOYMENT_NAME_MAPAzure OpenAI model=deployment map
GEMINI_API_KEYGoogle Gemini API key
GROQ_API_KEYGroq API key
CEREBRAS_API_KEYCerebras API key
OPENROUTER_API_KEYOpenRouter API key
XAI_API_KEYxAI Grok API key
MISTRAL_API_KEYMistral API key
MINIMAX_API_KEYMiniMax API key
OPENCODE_API_KEYOpenCode Zen/OpenCode Go API key
KIMI_API_KEYKimi For Coding API key
AI_GATEWAY_API_KEYVercel AI Gateway API key
ZAI_API_KEYZAI API key
AWS_PROFILE / AWS_REGIONAmazon Bedrock credentials
AWS_ACCESS_KEY_IDAmazon Bedrock Access Key
AWS_SECRET_ACCESS_KEYAmazon Bedrock Secret Key
AWS_BEARER_TOKEN_BEDROCKBedrock API key (bearer token)
PI_CODING_AGENT_DIRSession storage dir (default: ~/.pi/agent)
PI_PACKAGE_DIROverride package directory (Nix/Guix)
PI_OFFLINESet to 1/true/yes to disable network ops
PI_TELEMETRYOverride install telemetry (1/true or 0/false)
PI_SHARE_VIEWER_URLBase URL for /share command (default: https://pi.dev/session/)
PI_AI_ANTIGRAVITY_VERSIONOverride Antigravity User-Agent version

Common Patterns

Scripting / Automation

# Run a task and capture output (non-interactive)
pi -p --mode json "Summarize src/auth.ts" > summary.json

# Pipe a generated prompt
echo "Explain this error: $(cat error.log)" | xargs pi -p

# Combine with --no-session for isolated one-shots
pi -p --no-session "Generate a UUID"

Code Review Pipeline

# Read-only review, no mutations possible
pi --tools read,grep,find,ls -p @PR_DIFF.patch "Review this PR for security issues"

Locked-down Model Run

pi --model anthropic/claude-opus-4:high \
   --thinking high \
   --no-extensions \
   --no-skills \
   -p "Solve the following algorithm problem: ..."

Resuming & Branching Conversations

# Resume the most recent session and continue
pi -c "Now add unit tests for what we built"

# Fork a past session to explore a different direction
pi --fork abc123 "Try a different approach using Redis instead"

Export Session to HTML

pi --export ~/.pi/agent/sessions/my-session/session.jsonl
pi --export session.jsonl report.html

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.