Documentation
¶
Overview ¶
Package context implements the `bitbottle context` command — a single one-call orientation primitive that returns the current host, project, slug, branch, default branch, ahead/behind counts vs the default branch, authenticated user, and backend type. This collapses what previously required three independent calls (auth status / repo view / git status) into a single structured response, principally for AI-agent integrations that pay a per-round-trip latency cost.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
Build assembles a backend.Context from config, git state, and the backend (current user + branch list when inside a repo). Exposed so the MCP `get_context` handler returns the exact same shape as the CLI.
Outside a git repository, BaseRepo() returns a non-nil error. That branch yields an empty Project / Slug / Branch / DefaultBranch / Ahead / Behind while still resolving Host, User, and Backend.
func NewCmdContext ¶
NewCmdContext builds the cobra command. The command has no subcommands and takes no positional arguments — the entire shape is resolved from config, git state, and one backend round-trip (current user + branch list when inside a repo).
Types ¶
This section is empty.