Documentation
¶
Index ¶
- Variables
- func NewArchiveCmd(deps *Deps) *cobra.Command
- func NewArchiveExportCmd(deps *Deps) *cobra.Command
- func NewArchiveImportCmd(deps *Deps) *cobra.Command
- func NewAuthCmd(deps *Deps) *cobra.Command
- func NewBacklinksCmd(deps *Deps) *cobra.Command
- func NewBootstrapCmd(deps *Deps) *cobra.Command
- func NewCatCmd(deps *Deps) *cobra.Command
- func NewConfigCmd(deps *Deps) *cobra.Command
- func NewConfigEditCmd(deps *Deps) *cobra.Command
- func NewConfigTemplateCmd(deps *Deps) *cobra.Command
- func NewCreateCmd(deps *Deps) *cobra.Command
- func NewDocsCmd(deps *Deps) *cobra.Command
- func NewDoctorCmd(deps *Deps) *cobra.Command
- func NewEditCmd(deps *Deps) *cobra.Command
- func NewFileCmd(deps *Deps) *cobra.Command
- func NewFlightCmd(deps *Deps) *cobra.Command
- func NewGraphCmd(deps *Deps) *cobra.Command
- func NewGrepCmd(deps *Deps) *cobra.Command
- func NewHookCmd(deps *Deps) *cobra.Command
- func NewHubCmd(deps *Deps) *cobra.Command
- func NewImageCmd(deps *Deps) *cobra.Command
- func NewImportCmd(deps *Deps) *cobra.Command
- func NewIndexCmd(deps *Deps) *cobra.Command
- func NewInfoCmd(deps *Deps) *cobra.Command
- func NewIntegrateCmd(deps *Deps) *cobra.Command
- func NewKegCmd(deps *Deps) *cobra.Command
- func NewLinksCmd(deps *Deps) *cobra.Command
- func NewListCmd(deps *Deps) *cobra.Command
- func NewLockCmd(deps *Deps) *cobra.Command
- func NewMcpCmd(deps *Deps) *cobra.Command
- func NewMetaCmd(deps *Deps) *cobra.Command
- func NewMoveCmd(deps *Deps) *cobra.Command
- func NewNamespaceCmd(deps *Deps) *cobra.Command
- func NewOrientCmd(deps *Deps) *cobra.Command
- func NewRemoveCmd(deps *Deps) *cobra.Command
- func NewRootCmd(deps *Deps) *cobra.Command
- func NewSchemaCmd(deps *Deps) *cobra.Command
- func NewSnapshotCmd(deps *Deps) *cobra.Command
- func NewSnapshotCreateCmd(deps *Deps) *cobra.Command
- func NewSnapshotHistoryCmd(deps *Deps) *cobra.Command
- func NewSnapshotRestoreCmd(deps *Deps) *cobra.Command
- func NewSnapshotViewCmd(deps *Deps) *cobra.Command
- func NewStatsCmd(deps *Deps) *cobra.Command
- func NewTagsCmd(deps *Deps) *cobra.Command
- func NewUseCmd(deps *Deps) *cobra.Command
- func NewValidateCmd(deps *Deps) *cobra.Command
- func NewVersionCmd(deps *Deps) *cobra.Command
- func NewWatchCmd(deps *Deps) *cobra.Command
- func Run(ctx context.Context, rt *toolkit.Runtime, args []string) (int, error)
- func RunCompletion(ctx context.Context, rt *toolkit.Runtime, args []string) (int, error)
- func RunCompletionWithProfile(ctx context.Context, rt *toolkit.Runtime, args []string, profile Profile) (int, error)
- func RunWithProfile(ctx context.Context, rt *toolkit.Runtime, args []string, profile Profile) (int, error)
- func WithTestDepsHook(ctx context.Context, hook func(*Deps)) context.Context
- type AuthPrompter
- type BootstrapPrompter
- type Deps
- type Profile
- type UserMessager
Constants ¶
This section is empty.
Variables ¶
var ( Version string = "dev" LicenseText string )
Functions ¶
func NewArchiveCmd ¶ added in v0.4.0
func NewArchiveExportCmd ¶ added in v0.4.0
func NewArchiveImportCmd ¶ added in v0.4.0
func NewAuthCmd ¶ added in v0.20.0
NewAuthCmd builds the `auth` parent. Parent with no RunE would show "unknown command" noise; returning cmd.Help() is what every other two-level command tree in this repo does (see cmd_repo.go / cmd_config.go).
func NewBacklinksCmd ¶
func NewBootstrapCmd ¶ added in v0.23.0
NewBootstrapCmd returns the `tap bootstrap` cobra command.
Usage examples:
tap bootstrap # interactive on a TTY tap bootstrap --kind local # local filesystem hub only tap bootstrap --kind cloud # atlas.foldwise.ai tap bootstrap --kind enterprise --endpoint https://keg.acme.com
func NewCatCmd ¶
NewCatCmd returns the `cat` cobra command.
Usage examples:
tap cat 0 tap cat 0 1 2 tap cat --query "fire and not archived" tap cat 0 --keg myalias
func NewConfigCmd ¶
NewConfigCmd returns the `config` cobra command.
Usage examples:
tap config tap config --project tap config --user tap config --explain defaultKeg tap config --show-sources tap config template user tap config template project tap config edit tap config edit --project
func NewConfigEditCmd ¶ added in v0.4.0
NewConfigEditCmd returns the `config edit` cobra subcommand.
Usage examples:
tap config edit tap config edit --user
func NewConfigTemplateCmd ¶ added in v0.23.0
NewConfigTemplateCmd returns the `config template` cobra subcommand.
func NewCreateCmd ¶
NewCreateCmd constructs the `create` subcommand.
Usage examples:
Tap create --title "My note" --lead "one-line summary" Tap create --title "Note" --tags tag1 --tags tag2 --attrs foo=bar --attrs x=1
func NewDocsCmd ¶ added in v0.5.0
func NewDoctorCmd ¶ added in v0.5.0
func NewEditCmd ¶
NewEditCmd returns the `edit` cobra command.
func NewFileCmd ¶ added in v0.2.0
func NewFlightCmd ¶ added in v0.23.0
NewFlightCmd returns the `flight` cobra command group. A flight carries MCP cover caps, capabilities, and agent instructions.
tap flight list tap flight show <name> tap flight create @ns/+slug --cover @ns/keg=viewer
func NewGraphCmd ¶ added in v0.4.0
NewGraphCmd returns the `graph` cobra command.
Usage examples:
tap graph tap graph --keg pub --output graph.html
func NewGrepCmd ¶
func NewHookCmd ¶ added in v0.30.0
NewHookCmd builds the hidden protocol used by the native Codex and Claude plugins. It is intentionally host-facing rather than a public user workflow.
func NewHubCmd ¶ added in v0.23.0
NewHubCmd returns the `hub` command group: manage hub *connections* (the user-config `hubs:` map) and inspect a hub. Listing the kegs on a hub lives under `tap keg list`.
tap hub list tap hub status tap hub add work --url https://hub.example tap hub remove work tap hub set-default atlas
func NewImageCmd ¶ added in v0.2.0
func NewImportCmd ¶ added in v0.4.0
func NewIndexCmd ¶
NewIndexCmd returns the `index` cobra command group.
Usage examples:
tap index list tap index get changes.md tap index get -k work nodes.tsv tap index rebuild
func NewInfoCmd ¶
NewInfoCmd returns the `info` cobra command.
Usage examples:
tap info tap info --keg myalias
func NewIntegrateCmd ¶ added in v0.19.0
NewIntegrateCmd builds the `tap integrate` command. It installs the embedded native marketplace and installs through the requested host CLI.
func NewKegCmd ¶ added in v0.23.0
NewKegCmd returns the `keg` command group: hub-side keg administration (listing, creating, ACL grants, visibility) plus the keg's own settings.
tap keg list tap keg create @ns/blog tap keg grant @ns/blog @alice editor tap keg grants @ns/blog tap keg revoke @ns/blog @alice tap keg visibility @ns/blog public tap keg rename @ns/blog docs tap keg settings
func NewLinksCmd ¶ added in v0.5.0
func NewListCmd ¶
func NewLockCmd ¶ added in v0.11.0
func NewMetaCmd ¶
func NewMoveCmd ¶
func NewNamespaceCmd ¶ added in v0.23.0
NewNamespaceCmd returns the `namespace` command group: namespace discovery, membership/role management, and org-namespace creation.
tap namespace list tap namespace members @acme tap namespace add-member @acme @alice admin tap namespace set-role @acme @alice member tap namespace remove-member @acme @alice tap namespace create acme
func NewOrientCmd ¶ added in v0.19.0
NewOrientCmd builds the `tap orient` command. It is the CLI mirror of the MCP orient tool: the same payload bytes reach a shell user as reach an MCP-speaking agent, because both surfaces call Tap.Orient.
func NewRemoveCmd ¶
func NewRootCmd ¶
func NewSchemaCmd ¶ added in v0.25.0
func NewSnapshotCmd ¶ added in v0.4.0
func NewSnapshotCreateCmd ¶ added in v0.4.0
func NewSnapshotHistoryCmd ¶ added in v0.4.0
func NewSnapshotRestoreCmd ¶ added in v0.4.0
func NewSnapshotViewCmd ¶ added in v0.23.0
func NewStatsCmd ¶
NewStatsCmd returns the `stats` cobra command.
func NewTagsCmd ¶
func NewUseCmd ¶ added in v0.23.0
NewUseCmd returns the `use` command: record which keg (and flight) a project resolves, or a user-wide fallback keg.
Usage examples:
tap use @work/dev # project keg (defaultKeg) tap use +plan # project flight tap use @work/dev --flight @work/+plan tap use @me/notes --user # user-wide fallback (fallbackKeg) tap use --flight @work/+plan # set/replace just the project flight tap use --clear # unset the scope's slot(s) tap use # show the resolved keg + flight + fallback
func NewValidateCmd ¶ added in v0.25.0
func NewVersionCmd ¶ added in v0.9.0
func NewWatchCmd ¶ added in v0.23.0
NewWatchCmd returns the `watch` cobra command.
func RunCompletion ¶ added in v0.4.0
func RunCompletionWithProfile ¶ added in v0.4.0
func RunWithProfile ¶
func WithTestDepsHook ¶ added in v0.20.0
WithTestDepsHook returns a context carrying a per-invocation hook that Run will apply to the freshly-constructed Deps. Parallel tests attach their own hook to their own ctx, so there is no shared state for the race detector to flag.
Exported so tests in this package (and sibling test packages in pkg/cli_test) can drive the seam without reaching into unexported state. Production callers must not use it — wiring AuthLoginDeviceFn into Deps directly is the intended seam for non-test callers.
Types ¶
type AuthPrompter ¶ added in v0.23.0
type AuthPrompter interface {
// SelectHub presents choices and returns the selected one.
SelectHub(choices []hubChoice) (hubChoice, error)
// SelectMethod asks browser-vs-token.
SelectMethod() (loginMethod, error)
// PromptEndpointURL collects a hub base URL for the "Other endpoint" path.
PromptEndpointURL() (string, error)
// PromptToken collects a pasted API token with masked echo.
PromptToken() (string, error)
// ConfirmOpenBrowser gates the device-flow browser open. It returns true
// to open the browser (the default — pressing Enter), false when the user
// would rather copy the URL themselves. It takes a context so the device
// flow can tear the prompt down once the token arrives (the user approved
// before answering): a cancelled ctx ends the prompt without an answer.
ConfirmOpenBrowser(ctx context.Context, host string) (bool, error)
}
AuthPrompter is the interactive surface of `tap auth login`. It is an interface so tests inject a scripted fake and never touch a TTY; the production implementation renders huh menus on the controlling terminal.
type BootstrapPrompter ¶ added in v0.23.0
type BootstrapPrompter interface {
// SelectBootstrapKind chooses the cloud, local, or enterprise bootstrap path.
SelectBootstrapKind() (string, error)
// PromptBootstrapEndpoint collects the enterprise hub endpoint URL.
PromptBootstrapEndpoint() (string, error)
// ConfirmBootstrapLogin reports whether the user wants to log in to host.
ConfirmBootstrapLogin(host string) (bool, error)
// SelectDefaultKeg chooses an available keg or a create, manual, or skip action.
SelectDefaultKeg(available []string) (bootstrapDefaultKegSelection, error)
// SelectFlight chooses an available MCP flight, preserving current as the
// default selection when possible.
SelectFlight(available []string, current string) (string, error)
// PromptManualDefaultKeg collects a keg reference not present in the picker.
PromptManualDefaultKeg() (string, error)
// PromptNewKegName collects and validates the alias for a new keg.
PromptNewKegName() (string, error)
}
BootstrapPrompter is the interactive surface of `tap bootstrap`.
type Deps ¶
type Deps struct {
Root string
Shutdown func()
Runtime *toolkit.Runtime
Profile Profile
KegTargetOptions tapper.KegTargetOptions
ConfigPath string
LogFile string
LogLevel string
LogJSON bool
Strict bool
Tap *tapper.Tap
Err error
// AuthLoginDeviceFn is the seam through which `tap auth login` drives the
// RFC 8628 device authorization grant — the single browser-based login
// flow. Tests set their own function before NewRootCmd runs (via Run's
// testDepsHook or by constructing Deps directly) so the real browser
// opener and hub polling are never invoked. A nil value is lazy-defaulted
// to tapper.AuthLoginDevice in NewRootCmd so production callers need not
// populate it.
AuthLoginDeviceFn func(ctx context.Context, rt *toolkit.Runtime, opts tapper.AuthLoginDeviceOptions) (*tapper.AuthEntry, error)
// AuthValidateTokenFn backs the "paste an authentication token" login
// path: it checks a pasted bearer token against the hub's whoami probe
// before the token is written to the AuthStore. Nil is lazy-defaulted to
// tapper.ValidateToken; tests inject a stub to avoid the network call.
AuthValidateTokenFn func(ctx context.Context, rt *toolkit.Runtime, hubURL, token string) (*tapper.WhoAmI, error)
// AuthPrompter renders the interactive hub / method / URL / token prompts
// for `tap auth login`. Nil is lazy-defaulted to the huh-backed prompter;
// tests inject a scripted fake so the command logic runs without a TTY.
AuthPrompter AuthPrompter
// BootstrapPrompter renders the interactive setup prompts for
// `tap bootstrap`. It shares the huh-backed production implementation with
// AuthPrompter but stays separate so tests can assert each flow's prompts.
BootstrapPrompter BootstrapPrompter
InvocationReporter tapper.InvocationReporter
// contains filtered or unexported fields
}
type Profile ¶
type Profile struct {
// Use is the root command name shown in help.
Use string
// ForceProjectResolution makes node operations resolve only against
// project-local kegs.
ForceProjectResolution bool
// AllowKegAliasFlags enables alias-based selection flags such as --keg.
AllowKegAliasFlags bool
// IncludeConfigCommand enables the config command tree.
IncludeConfigCommand bool
// IncludeRepoCommand enables the repo command tree.
IncludeRepoCommand bool
// IncludeIntegrations enables host plugin installation and the hidden
// host-facing hook protocol. These commands belong only to the full tap
// binary because installed plugins invoke tap directly.
IncludeIntegrations bool
}
Profile configures CLI behavior for a specific binary.
func KegProfile ¶ added in v0.8.0
func KegProfile() Profile
func TapProfile ¶
func TapProfile() Profile
type UserMessager ¶ added in v0.13.0
type UserMessager interface {
// UserMessage returns the message appropriate for the caller's debug mode.
UserMessage(debug bool) string
}
UserMessager is implemented by error types that can produce a user-facing message tailored to the current CLI context (e.g. log level). New error types should implement this interface instead of adding branches to renderUserError.
Source Files
¶
- assets.go
- auth_prompt.go
- bootstrap_prompt.go
- cli.go
- cmd_archive.go
- cmd_auth.go
- cmd_backlinks.go
- cmd_bootstrap.go
- cmd_cat.go
- cmd_config.go
- cmd_config_edit.go
- cmd_config_template.go
- cmd_create.go
- cmd_docs.go
- cmd_doctor.go
- cmd_edit.go
- cmd_file.go
- cmd_flight.go
- cmd_graph.go
- cmd_grep.go
- cmd_hook.go
- cmd_hub.go
- cmd_image.go
- cmd_import.go
- cmd_index.go
- cmd_info.go
- cmd_init.go
- cmd_integrate.go
- cmd_keg.go
- cmd_links.go
- cmd_list.go
- cmd_lock.go
- cmd_mcp.go
- cmd_meta.go
- cmd_mv.go
- cmd_namespace.go
- cmd_orient.go
- cmd_rm.go
- cmd_root.go
- cmd_schema.go
- cmd_snapshot.go
- cmd_stats.go
- cmd_tags.go
- cmd_use.go
- cmd_validate.go
- cmd_version.go
- cmd_watch.go
- constants.go
- error_render.go
- keg_target_flags.go
- multi_handler.go
- profile.go