cli

package
v0.15.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: 25 Imported by: 0

Documentation

Overview

Package cli builds the master Cobra command tree for the `sf` binary. Every Agentic Tool / Context Provider in the repo plugs in here so that `sf <namespace> <tool>` is the single entry point for users and AI agents.

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "sf",
	Short: "SF (Sophia Foundation) — structural, auditable context for LLM coding agents",
	Long: `SF (Sophia Foundation / Source Fabric) — a single fast binary for scanning a
project's code and assembling compact, structural context for an LLM agent.`,
	Version:      version.Version,
	SilenceUsage: true,

	SilenceErrors: true,

	Run: func(cmd *cobra.Command, args []string) {
		fmt.Fprintf(cmd.OutOrStdout(), "sf version %s\n\n", version.Version)
		_ = cmd.Help()
	},
}

RootCmd is the master `sf` Cobra command. Subcommands attach in init() so consumers (cmd/sf/main.go) just call RootCmd.Execute().

Functions

func AttachPlugins added in v0.2.0

func AttachPlugins()

AttachPlugins grafts discovered, enabled plugins onto RootCmd as shim commands and tells calllog which plugin groups to keep out of its central fallback. It is called once from main() before Execute — deliberately not in init(), so importing this package for tests never touches the developer's real ~/.local/share/sofia cache.

Discovery reads the cached metadata index (plugin.Load), so this costs one file read, not one fork per plugin — `sf --help` never execs a plugin just to build the tree.

Types

This section is empty.

Jump to

Keyboard shortcuts

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