Documentation
¶
Overview ¶
Package cli is ovdb's command-line presentation of the onboarding and configuration capabilities: `ovdb server …`, `ovdb open`, `ovdb config …` and the preview `ovdb status`. Commands resolve environment-dependent inputs, call the local server (or the pure reads in internal/setup) and render the resulting documents; --json prints those documents unchanged.
Every new command is hidden unless OVDB_PREVIEW=1, exits 0 on success and 1 on any failure, and reports failures in the shared error envelope.
Index ¶
Constants ¶
const EnvStartFault = "OVDB_TEST_START_FAULT"
EnvStartFault is a hidden test-only variable: a server started with it set to "1" exits before readiness, so start fails with server_start_failed.
Variables ¶
This section is empty.
Functions ¶
func Render ¶
Render prints err when it is an envelope error and reports whether it did: the JSON document on stdout when args ask for --json, otherwise the problem pattern on stderr (first-run-onboarding#REQ:problem-pattern). main calls it before fang's own error output, so legacy commands keep theirs. args are the raw arguments, because a flag error happens before --json itself is parsed.
Types ¶
type App ¶
type App struct {
Version string
Getenv paths.Getenv // os.Getenv when nil
// Executable runs the detached server; os.Executable() when empty.
Executable string
// ChildEnv is appended to the detached server's environment (tests).
ChildEnv []string
// OpenBrowser launches a URL; browser.Opener{}.Open when nil.
OpenBrowser func(url string) error
}
App carries what every command needs from the process.
func (*App) AddCommands ¶
AddCommands registers the new commands on root, hidden without the gate.