Documentation
¶
Overview ¶
Package commands implements all CLI commands for the kiln secure environment variable management tool. It provides subcommands for initializing projects, editing encrypted files, running commands with decrypted environment variables, and managing encryption keys.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplyCmd ¶ added in v1.0.1
type ApplyCmd struct {
File string `short:"f" help:"Environment file from configuration" default:"default"`
Output string `short:"o" help:"Output file path (default: stdout)"`
Strict bool `help:"Fail if template variables are not found"`
LeftDelimiter string `help:"Left delimiter to use for template variables (default: ${ or $)"`
RightDelimiter string `help:"Right delimiter to use for template variables (default: } or empty)"`
Template string `arg:"" help:"Template file path" required:""`
}
ApplyCmd represents the apply command to safely apply variables to a template file.
type EditCmd ¶
type EditCmd struct {
File string `short:"f" help:"Environment file to edit" default:"default"`
Editor string `help:"Editor to use for editing the file, defaults to the EDITOR environment variable" placeholder:"EDITOR"`
}
EditCmd represents the edit command for modifying encrypted environment variables.
type ExitError ¶
type ExitError struct {
Code int
}
ExitError represents a command exit with a specific code.
type ExportCmd ¶
type ExportCmd struct {
File string `short:"f" help:"Environment file from the configuration to export" default:"default"`
Format string `help:"Output format" enum:"shell,json,yaml" default:"shell" placeholder:"[shell|json|yaml]"`
}
ExportCmd represents the export command for outputting environment variables.
type GetCmd ¶
type GetCmd struct {
Name string `arg:"" help:"Environment variable name"`
File string `short:"f" help:"Environment file to read from" default:"default"`
Format string `help:"Output format" enum:"value,json" default:"value"`
}
GetCmd represents the get command for retrieving a single environment variable.
type InfoCmd ¶
type InfoCmd struct {
File string `short:"f" help:"Show info for specific file"`
Verify bool `help:"Verify file decryption capability" default:"false"`
}
InfoCmd represents the info command for displaying project and file information.
type InitCmd ¶
type InitCmd struct {
Key *InitKeyCmd `cmd:"" help:"Generate encryption key"`
Config *InitConfigCmd `cmd:"" help:"Generate configuration file"`
}
InitCmd represents the init command for initializing kiln projects.
type InitConfigCmd ¶
type InitConfigCmd struct {
Path string `help:"Path for config file" default:"kiln.toml"`
Recipients map[string]string `help:"Named recipients in format 'name=key'" type:"agepubkey"`
Force bool `help:"Overwrite existing config"`
}
InitConfigCmd represents the config generation subcommand of init.
func (*InitConfigCmd) Run ¶
func (c *InitConfigCmd) Run(rt *Runtime) error
Run executes the init config command, creating a new configuration file.
type InitKeyCmd ¶
type InitKeyCmd struct {
Path string `help:"Path for private key" default:"~/.kiln/kiln.key" type:"path"`
Encrypt bool `help:"Save key with passphrase protection"`
Force bool `help:"Overwrite existing key (dangerous!)"`
}
InitKeyCmd represents the key generation subcommand of init.
func (*InitKeyCmd) Run ¶
func (c *InitKeyCmd) Run(rt *Runtime) error
Run executes the init key command, generating a new encryption key pair.
type RekeyCmd ¶
type RekeyCmd struct {
File string `short:"f" help:"Environment file to rekey" required:"true"`
AddRecipient []string `help:"Add new named recipients in format 'name=key'" placeholder:"name=age-pub-key"`
Force bool `help:"Force rekey without confirmation"`
}
RekeyCmd represents the rekey command for rotating encryption keys.
type RunCmd ¶
type RunCmd struct {
File string `short:"f" help:"Environment file to use" default:"default"`
DryRun bool `help:"Show environment variables without running command"`
Timeout time.Duration `help:"Timeout for command execution" placeholder:"[10s]"`
WorkDir string `help:"Working directory for command execution" placeholder:"[path]"`
Shell bool `help:"Run command through shell"`
Command []string `arg:"" help:"Command and arguments to run"`
}
RunCmd represents the run command for executing programs with encrypted environment variables.
type Runtime ¶
Runtime contains shared configuration and provides lazy loading for commands
func NewRuntime ¶
NewRuntime creates a new context with configured logger
func (*Runtime) ConfigPath ¶
ConfigPath returns the configuration file path
type SetCmd ¶
type SetCmd struct {
Name string `arg:"" help:"Environment variable name" optional:""`
Value string `arg:"" help:"Environment variable value (if not provided, will prompt for input)" optional:""`
File string `short:"f" help:"Environment file to modify" default:"default"`
FromFile string `help:"JSON file containing environment variables to set" type:"path"`
}
SetCmd represents the set command for adding or updating environment variables.