Documentation
¶
Overview ¶
Package config holds hopsesh's user configuration and state locations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dir ¶
func Dir() string
Dir is the configuration directory: $XDG_CONFIG_HOME/hopsesh or ~/.config/hopsesh on macOS and Linux, %APPDATA%\hopsesh on Windows.
Types ¶
type Config ¶
type Config struct {
ReposDir string `toml:"repos_dir"` // where clones go; default ~/git
Layout string `toml:"layout"` // flat | ghq
LivePolicy string `toml:"live_policy"` // handoff | fork
RemoteCtl bool `toml:"remote_control"`
// UpdateCheck is "on" or "off" once the person has answered whether the app may
// look for new releases once a day ("" = not asked yet).
UpdateCheck string `toml:"update_check,omitempty"`
// Round trips. MarkMoved and SyncCode default to on (nil); PushSource to off.
MarkMoved *bool `toml:"mark_moved,omitempty"` // title the copy left behind "↪ moved to …"
SyncCode *bool `toml:"sync_code,omitempty"` // fetch and fast-forward the checkout here
PushSource bool `toml:"push_source,omitempty"` // push unpushed commits on the source first
// SkillPrompt remembers the answer to "let Claude Code use hopsesh?": "" (not asked),
// "declined", or the skill revision last offered.
SkillPrompt string `toml:"skill_prompt,omitempty"`
// CLIPrompt is "declined" once the user said not now to linking the command-line tool
// from the app.
CLIPrompt string `toml:"cli_prompt,omitempty"`
Hosts []Host `toml:"hosts"`
}
Config is the user's configuration file.
func (Config) MarkMovedOn ¶ added in v0.2.0
MarkMovedOn reports whether copies left behind are marked (default on).
func (Config) SyncCodeOn ¶ added in v0.2.0
SyncCodeOn reports whether the checkout is brought to the session's commit (default on).
func (*Config) UpsertHost ¶
UpsertHost adds or updates a host by name, keeping consent unless explicitly changed.
type Host ¶
type Host struct {
Name string `toml:"name"` // label shown to the user, e.g. "studio"
Destination string `toml:"destination"` // what to pass to ssh: alias, user@host or host
Via string `toml:"via"` // tailscale | ssh-config | manual (or a "+" combination)
Allowed bool `toml:"allowed"` // the user consented to hopsesh connecting
OS string `toml:"os,omitempty"`
// TailscaleName is the machine's MagicDNS name, used when Destination's own host
// name does not resolve (e.g. an alias pointing at a .local name on another network).
TailscaleName string `toml:"tailscale_name,omitempty"`
Helper bool `toml:"helper,omitempty"` // the user allowed deploying the remote helper
// HelperSHA256 pins the helper binary hopsesh uploaded; a helper that no longer
// matches is not run.
HelperSHA256 string `toml:"helper_sha256,omitempty"`
// Auth is "password" for a machine that logs in with a password (asked for, never
// stored in this file); "" means keys or the SSH agent.
Auth string `toml:"auth,omitempty"`
// Keychain: remember this machine's password in the macOS Keychain.
Keychain bool `toml:"keychain,omitempty"`
}
Host is one machine hopsesh knows about.
func (Host) UsesPassword ¶ added in v0.2.0
UsesPassword reports whether the machine logs in with a password.