Documentation
¶
Overview ¶
Package initcmd implements `sf init` — one-shot per-project onboarding that wires sf up for a project's coding agents: a managed block in AGENTS.md, the sf-context skill, the PreToolUse hook, and MCP server registration — for both Claude Code and Codex CLI, each gated on its own detection. Steps beyond the AGENTS.md block are gated on whether Claude Code and/or Codex are detected on the machine (and/or, for Claude, in the project), and --corporate skips all of them for locked-down environments where only instruction files are writable.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCommand ¶
NewCommand returns the `init` Cobra command (`sf init`).
Types ¶
type Item ¶
type Item struct {
Name string `json:"name"`
Status string `json:"status"`
Detail string `json:"detail"`
}
Item is one onboarding step's outcome — same shape as doctor.Check, same voice: a short Status plus a sentence of Detail.
type Options ¶
type Options struct {
Project string
Corporate bool
Force bool
Check bool
Revert bool
Format string
}
Options carries flag state.
type Result ¶
type Result struct {
ClaudeOnMachine bool `json:"claude_on_machine"`
ClaudeInProject bool `json:"claude_in_project"`
CodexOnMachine bool `json:"codex_on_machine"`
Check bool `json:"check,omitempty"`
Revert bool `json:"revert,omitempty"`
Items []Item `json:"items"`
}
Result is the full report: what was detected, and what each step did.