Documentation
¶
Overview ¶
Package cli implements the local `akerdock` client subcommands (ADR-031, ADR-032, ADR-033, spec docs/specs/cli.md). It talks only to the manager over HTTPS and never opens a listening network port.
`akerdock mcp` (ADR-043): speaks MCP over stdio and forwards each JSON-RPC message to the instance's /mcp endpoint. A local assistant (desktop app, IDE) configures one command instead of an OAuth flow: the credential is the CLI context it already has in ~/.akerdock/, or an explicit token.
The CLI implements no protocol logic — it is a transport adapter. Tools, schemas and authorization all live on the server, so a client using stdio and one using HTTP see exactly the same MCP server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCommands ¶
AddCommands registers the client subcommands on the root command (ADR-033).
func IsUsageError ¶
IsUsageError reports whether err is a usage failure, so the entry point can exit 2. Cobra does not type its own parse failures, so the two it produces before any of our code runs — an unknown command, and flag errors routed through SetFlagErrorFunc in AddCommands — are recognised by prefix here.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a thin authenticated HTTP client for one context. It only ever targets the context URL (the manager), over its scheme/port — no other destination (spec §2).
type Config ¶
type Config struct {
CurrentContext string `yaml:"current_context"`
Contexts map[string]Context `yaml:"contexts"`
}
Config is the non-secret part of the client state.
func LoadConfig ¶
LoadConfig reads ~/.akerdock/config.yaml, returning an empty config when it does not exist yet.
type Context ¶
type Context struct {
URL string `yaml:"url"` // base URL, e.g. https://manager.ad.kedric.fr
Fqdn string `yaml:"fqdn,omitempty"` // convenience copy of the host
TeamUUID string `yaml:"team_uuid,omitempty"` // active team; empty = server default
}
Context is one instance + active team the client talks to.
type DirConfig ¶
type DirConfig struct {
Context string `yaml:"context,omitempty"` // a global context name (instance + token)
Team string `yaml:"team,omitempty"` // team uuid or name, overrides the context's
Project string `yaml:"project,omitempty"` // default project
Application string `yaml:"application,omitempty"` // default application (target)
Environment string `yaml:"environment,omitempty"` // default environment
Component string `yaml:"component,omitempty"` // default component (e.g. a compose service)
}
DirConfig is a .akerdock file: non-secret CLI defaults for a directory tree. It never holds tokens — those stay in ~/.akerdock/credentials.yaml — so it is safe to commit. Every field is optional; an empty one falls through to the global config (spec §4).
type Settings ¶
type Settings struct {
ContextName string
Team string
Project string
Application string
Environment string
Component string
}
Settings is the fully-resolved CLI configuration for one invocation, layering (highest priority first) flags, AKERDOCK_* env, the nearest .akerdock, then the global ~/.akerdock config (spec §4).