initcmd

package
v0.26.2 Latest Latest
Warning

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

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

Documentation

Overview

Package initcmd implements the `aiwf init` verb (per-verb subpackage of M-0116; directory and package are `initcmd` because `init` is a special Go function name).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmd

func NewCmd() *cobra.Command

NewCmd builds `aiwf init`: writes aiwf.yaml, scaffolds entity directories, materializes skills, appends to .gitignore, writes a CLAUDE.md template, and installs the pre-push hook. No commit.

--dry-run reports the would-be ledger without touching disk. --skip-hook performs every other step but omits hook installation.

func Run

func Run(root, actor string, dryRun, skipHook, statusline bool, scope string, wireSettings, allowUntagged bool, enableHooks []string, hooks []skills.HookDef) int

Run executes `aiwf init`. Returns one of the cliutil.Exit* codes. When `statusline` is true, also scaffolds the aiwf-aware Claude Code statusline (scope-appropriate destination; scaffold-if-absent, never clobbers a pre-existing copy). The scaffold action runs after the main init pipeline succeeds; a `--dry-run` init reports without scaffolding.

hooks is the shipped hook registry (ADR-0032); the production call site passes skills.ShippedHooks, and tests inject a synthetic registry to exercise the consent-gating step independent of the real registry's current contents. Every registry hook is gated (enableHooks bypasses the interactive prompt for the named ones) and the resulting decisions are baked into the freshly-written aiwf.yaml, after the main init pipeline succeeds — a `--dry-run` init skips gating entirely, same as the statusline scaffold.

Types

This section is empty.

Jump to

Keyboard shortcuts

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