pig

command
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 80 Imported by: 0

Documentation

Overview

Command pig provides the PiG coding agent CLI.

pig divergence (D2): refuse the `pi` name to protect Pi's command identity.

pig: Go-native port of pi-coding-agent.

Distinct binary name and config root from upstream pi to avoid PATH collisions and shared-config corruption. See codingagent.ConfigRoot() for the on-disk layout (defaults to ~/.pig, override with $PIG_HOME).

Usage:

pig [options] [prompt]

Options:

--model <provider/model>    Model to use (default: from settings)
--agent <name>              Agent definition to load from <config>/agents/
--print <prompt>            Print mode: send prompt and print response, then exit
--no-extensions             Disable all extensions
-e <path>                   Load extension (can be repeated)
--skill <name>              Load a skill
--cwd <dir>                 Working directory (default: current dir)
--agent-dir <dir>           Agent config directory (default: <config>/agent)
--version                   Print version and exit

Ports packages/coding-agent/src/core/resource-loader.ts

Ports packages/coding-agent/src/modes/rpc/rpc-mode.ts

Ports packages/coding-agent/src/modes/rpc/rpc-mode.ts

Ports packages/coding-agent/src/modes/json-event.ts.

Ports packages/coding-agent/src/modes/rpc/rpc-mode.ts

Startup timing instrumentation for pig.

Activated by setting PIG_STARTUP_TRACE=1. Prints structured timing to stderr showing wall-clock elapsed from process start for each startup. Uses Go's monotonic clock via time.Since.

Usage:

PIG_STARTUP_TRACE=1 pig --model github-copilot/gpt-5-mini

Output:

[startup] flags-parsed          0ms
[startup] services-init         2ms
[startup] model-resolved        3ms
[startup] extensions-loaded    25ms
[startup] session-created      28ms
[startup] interactive-ready   130ms

This is the official profiling mechanism. Do NOT add ad-hoc fmt.Fprintf timing to main.go or interactive.go: use this.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL