Documentation
¶
Overview ¶
Package pigdocs materializes the reference documentation embedded in Stock Pig under the user's config root (`~/.pig/docs` by default).
Pig ships as a standalone binary. Unlike upstream Pi, which installs package documentation beside its npm entry point, Pig cannot assume that a source checkout exists. The embedded bundle lets the running agent inspect the exact extension, Package, and Piglet contracts that its binary implements.
The docs sync is idempotent and content-addressed. Users can also force a sync or read the bundle through `pig docs`. This is stock distribution infrastructure; it does not activate an extension or optional Piglet.
Output layout
~/.pig/docs/ README.md index commands.md slash commands + CLI verbs concepts.md how pig fits together: resources, packages, piglets config.md settings, env vars, paths divergences.md pig vs upstream pi extension-api.md subprocess SDK host API surface extensions.md extension model, manifest, lifecycle models.md model selection, cycling, thinking packages.md packages: shareable resource bundles installed with pig install piglets.md Piglet schema, carriers, component closure, and environments providers.md provider list, auth, env runtime-cells.md packed-cell runtime mechanics skills.md SKILL.md skills: format, loading, discovery
Index ¶
Constants ¶
const (
// SubDir is the docs directory name under the pig config root.
SubDir = "docs"
)
Variables ¶
This section is empty.
Functions ¶
func EnsureSynced ¶
EnsureSynced is the idempotent startup helper. It writes embedded docs only when the on-disk digest differs, so warm starts do no writable filesystem work. All errors are returned to the caller; Pig core should treat any failure as non-fatal (logs a warning at most).
func List ¶
func List() []string
List returns the embedded doc filenames in stable alphabetical order. It is the canonical source for `pig docs list` and for any caller that needs to enumerate available topics.
func Read ¶
Read returns the embedded bytes of a single doc file. Names may be given with or without the .md suffix; ".." and absolute paths are rejected so this is safe to drive from CLI input.
func RunCommand ¶
RunCommand implements the stock pre-session `pig docs` command. It returns -1 when the arguments target another command.
pig docs sync + summary (default) pig docs sync force re-sync embedded docs pig docs path print docs dir pig docs list list available doc files pig docs show <name> print one doc to stdout
Types ¶
This section is empty.