cli

package
v0.0.0-...-42c8315 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const ShellPWD = "WS_ORIGIN_PWD"

ShellPWD is the directory the shell wrapper was standing in when it invoked us. The wrapper sets it for commands that step the shell out of the way before running (see `workspace shell-init`), so cwd-based resolution still reflects where the user actually is.

Variables

This section is empty.

Functions

func ClearContextOverride

func ClearContextOverride()

func NewRootCmd

func NewRootCmd(version string) *cobra.Command

func SetContextOverride

func SetContextOverride(ctx *Context)

Types

type Context

type Context struct {
	Config *config.Config
	WS     *workspace.Workspace
	GitHub github.Client
}

Context bridges config and the core workspace for CLI commands.

func LoadContext

func LoadContext() (*Context, error)

LoadContext discovers config from the current working directory and builds a workspace.

func LoadContextFromDir

func LoadContextFromDir(dir string) (*Context, error)

LoadContextFromDir discovers config from the given directory and builds a workspace.

func (*Context) ResolveCapsule

func (c *Context) ResolveCapsule(repo, arg string) (string, error)

ResolveCapsule figures out which capsule the user means within a repo. Does exact match, then fuzzy match. Single fuzzy match is used directly; multiple matches prompt an interactive picker; zero matches return an error.

func (*Context) ResolveRepo

func (c *Context) ResolveRepo(arg string) (string, error)

ResolveRepo figures out which repo the user means. "." means infer from cwd (error if not in a repo). "" means try cwd, fall back to interactive picker. Anything else is a repo name lookup.

type PromptData

type PromptData struct {
	WorkspaceDisplayName string `json:"workspace_display_name"`
	RepoName             string `json:"repo_name"`
	RepoDisplayName      string `json:"repo_display_name"`
	RepoColor            string `json:"repo_color"`
	CapsuleName          string `json:"capsule_name"`
	IsCapsuleBoarded     bool   `json:"is_capsule_boarded"`
}

PromptData holds the context available to prompt templates and JSON output.

Jump to

Keyboard shortcuts

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