Documentation
¶
Overview ¶
Package cli provides internal CLI wiring and command construction for the pulse binary.
Index ¶
- func APICommand() *cli.Command
- func CohortCommand() *cli.Command
- func ConvertCommand() *cli.Command
- func DedupCommand() *cli.Command
- func ErrorsCommand() *cli.Command
- func ExamplesCommand() *cli.Command
- func ExportCommand() *cli.Command
- func FeaturesCommand() *cli.Command
- func ImportCommand() *cli.Command
- func IndexCommand() *cli.Command
- func MCPCommand(version string) *cli.Command
- func ProfileCommand() *cli.Command
- func SchemaCommand() *cli.Command
- func ShardCommand() *cli.Command
- func SkillsCommand() *cli.Command
- func SynthCommand() *cli.Command
- func VersionCommand() *cli.Command
- func WidenCommand() *cli.Command
- func WriteJSONPublic(w io.Writer, data any) error
- type VersionInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CohortCommand ¶
CohortCommand returns the cohort command group.
func ConvertCommand ¶
ConvertCommand returns the convert command.
func DedupCommand ¶ added in v0.39.0
DedupCommand returns the `pulse dedup` leaf: retro-dedup an EXISTING single-file cohort into a grouped (format 0x02) cohort — the existing-cohort twin of `pulse import <fmt> --group`.
It is its own top-level leaf, beside `pulse widen`, for the reasons widen is: `.pulse` is never a convert SOURCE, so there is no `.pulse` → `.pulse` conversion for it to be a mode of, and an in-place rewrite earns a name a reader cannot mistake for a read. It is not an import mode either — import reads a tabular SOURCE, and the point of retro-dedup is that the source may be gone.
All behaviour is pulse.Dedup; this leaf parses flags, calls it once and formats the report.
func ErrorsCommand ¶ added in v0.5.0
ErrorsCommand returns the errors command group. Two leaves:
- `pulse errors lookup CODE [--json]`
- `pulse errors list [--domain D] [--query Q] [--json]`
Both wrap the errors-package lookup surface. CODE detail (Message + Fixup hints) lives behind the lookup tool rather than the bootstrap manifest, so per-session context stays lean.
func ExamplesCommand ¶ added in v0.5.0
ExamplesCommand returns the examples command group. Two leaves:
- `pulse examples search [--query Q] [--tag T] [--category C] [--json]`
- `pulse examples show NAME [--json]`
Both wrap the embedded request-example library (examples package).
func ExportCommand ¶
ExportCommand returns the export command group.
func FeaturesCommand ¶
FeaturesCommand returns the `pulse features` group: thin adapters over the root feature-profile tooling (pulse.InitFeatureProfile, CheckFeatureProfile, DiffFeatureProfile, DescribeFeatureProfile). They describe the binary, not an instance, and hold no logic of their own.
A fatal error exits non-zero on both paths; under --json the envelope is written first, with the error's own code in errors[0].
func ImportCommand ¶
ImportCommand returns the import command group.
func IndexCommand ¶ added in v0.27.0
IndexCommand returns the `pulse index` command group covering point-lookup sidecar index management: `build`, `list`, `verify`, `drop` — mirroring the `pulse shard` subcommand tree's leaf shape.
func MCPCommand ¶ added in v0.2.0
MCPCommand returns the mcp command leaf. Running it serves the MCP protocol over stdio so AI clients (Claude Desktop, Claude Code, etc.) can discover and call Pulse tools. version is the build identity, threaded into both the advertised server Implementation.Version and the adapter Config.
func ProfileCommand ¶ added in v0.2.0
ProfileCommand returns the `pulse profile` command group.
func SchemaCommand ¶ added in v0.23.0
SchemaCommand returns the schema command. It prints the bundled JSON Schema (draft 2020-12) describing every public Pulse payload — the request envelopes and the universal output Envelope. The artifact is a self-contained JSON Schema document (it carries its own $schema/$id), so it is emitted raw rather than wrapped in the descriptor Envelope.
This is the offline equivalent of fetching the published file at the $id URL or the pulse://schema MCP resource. CLI is a thin adapter: the schema is the default instance's (Pulse.PayloadSchema), which without a feature profile is the full-registry schema the docs site publishes.
func ShardCommand ¶ added in v0.8.0
ShardCommand returns the `pulse shard` command group covering archive create / add / remove / list / compact / verify / extract. Shard mutations use the atomic temp+rename pattern so partial writes never appear at the canonical archive path.
func SkillsCommand ¶
SkillsCommand returns the skills command group.
func SynthCommand ¶ added in v0.2.0
SynthCommand returns the `pulse synth` command group.
func VersionCommand ¶
VersionCommand returns the `pulse version` leaf. Plain output is `pulse <version>`; --json wraps a VersionInfo in the standard envelope.
func WidenCommand ¶ added in v0.38.0
WidenCommand returns the `pulse widen` leaf: widen one set column of a single-file cohort to a wider set rung, rewriting the cohort in place.
It is its own top-level leaf rather than a mode of `pulse convert` because `.pulse` is reserved on the import side — a legal convert TARGET, never a convert SOURCE (io.Formats()) — so there is no `.pulse` → `.pulse` conversion for a widen to ride on. It is also not a `pulse cohort` subcommand for the same reason `pulse index` is not: this mutates the cohort file itself, and a destructive in-place rewrite earns a name a reader cannot mistake for a read.
All of the behaviour is pulse.WidenSetField: layout dispatch, the refusal policy and the atomic temp/fsync/rename rewrite. This leaf parses three flags, calls it once, and formats the report.
Types ¶
type VersionInfo ¶
type VersionInfo struct {
PulseVersion string `json:"pulse_version"`
GoVersion string `json:"go_version"`
Commit string `json:"commit,omitempty"`
CommitTime string `json:"commit_time,omitempty"`
FormatVersion string `json:"format_version"`
}
VersionInfo is the `data` payload of `pulse version --json`. Every field is read from pulse.Version() or the internal/buildinfo helpers; the CLI only assembles them. Commit and CommitTime are omitted when the binary carries no VCS metadata.