initcmd

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

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

func NewCommand() *cobra.Command

NewCommand returns the `init` Cobra command (`sf init`).

func Run

func Run(opts Options, w io.Writer) error

Run executes the onboarding (or its revert), renders the report, and logs the call.

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.

Jump to

Keyboard shortcuts

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