clientcfg

package
v0.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package clientcfg persists client-side settings (things the CLI/TUI need that the daemon doesn't), stored at ~/.dejima/client.json. It is intentionally separate from per-island project configs and from daemon state.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Save

func Save(c Config) error

Save writes the client config.

Types

type Config

type Config struct {
	// RepoRoot is the directory the TUI repo picker scans for git repos.
	// Empty means the user hasn't chosen one yet (first-load prompt pending).
	RepoRoot string `json:"repo_root,omitempty"`

	// Profiles are saved connection targets (local + remote daemons), switchable
	// from the TUI. ActiveProfile records the last one selected.
	Profiles      []Profile `json:"profiles,omitempty"`
	ActiveProfile string    `json:"active_profile,omitempty"`

	// Editor is the CLI command for the user's preferred Remote-SSH editor
	// (e.g. "code", "cursor", "windsurf", "antigravity"). Empty means auto-detect
	// the first one on PATH. Set from the TUI settings (',').
	Editor string `json:"editor,omitempty"`
}

Config holds client-side preferences.

func Load

func Load() (Config, error)

Load reads the client config. A missing file yields a zero Config, no error.

func (Config) ActiveHost

func (c Config) ActiveHost() (host string, ok bool)

ActiveHost resolves the currently-active profile to its daemon host. ok is false when the active profile is the local socket, unset, or *dangling* — i.e. ActiveProfile names a profile that no longer exists (e.g. it was deleted while still selected). A dangling reference resolves to local rather than wedging the client on a target it can't look up.

type Profile

type Profile struct {
	Name string `json:"name"`
	Host string `json:"host,omitempty"`
}

Profile is a saved connection target. Host is "" for the local Unix socket, or "host:port" for a remote daemon reached over TCP.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL