Documentation
¶
Overview ¶
Package cli implements the `backyard` command line (SPEC §13): the server entry points (serve, gateway, dev), the developer workflow (init, deploy, login, sites, open, pull, token, skill), the MCP server for agents, and `backyard cloudflare setup|domain|access|status` for the Workers edition.
NewRootCommand builds the cobra command tree; every side effect (process execution, browser launch, templates, the embedded skill, the server runtime) goes through an injectable dependency so commands are testable end to end against a fake gateway.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Execute ¶
Execute runs the command line args with streams and returns the process exit code. The first SIGINT/SIGTERM cancels the command's context (so servers shut down gracefully and transfers stop cleanly); a second one terminates the process with the default signal behaviour.
func NewRootCommand ¶
NewRootCommand builds the `backyard` command tree writing to streams.
Types ¶
type Command ¶
type Command struct {
Name string
Args []string
// Dir is the working directory ("" = current).
Dir string
// Env holds extra KEY=VALUE pairs added to the inherited environment.
Env []string
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
}
Command is an external process invocation.
type IOStreams ¶
IOStreams are the standard streams of a command invocation.
func StdStreams ¶
func StdStreams() IOStreams
StdStreams returns the process's stdin, stdout and stderr.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package clitest provides an in-memory fake of a Backyard server's client surface (the deploy gateway protocol of SPEC §7, the CLI login handoff of §8.3 and POST /__backyard/api/tokens) for testing the CLI and the MCP server without running the real server.
|
Package clitest provides an in-memory fake of a Backyard server's client surface (the deploy gateway protocol of SPEC §7, the CLI login handoff of §8.3 and POST /__backyard/api/tokens) for testing the CLI and the MCP server without running the real server. |
|
Package scaffold writes the files of a new Backyard project (`backyard init` and the MCP tool backyard_init) and provides SafeJoin, the path guard used whenever the CLI writes files whose names come from elsewhere (templates, `backyard pull`).
|
Package scaffold writes the files of a new Backyard project (`backyard init` and the MCP tool backyard_init) and provides SafeJoin, the path guard used whenever the CLI writes files whose names come from elsewhere (templates, `backyard pull`). |