Documentation
¶
Index ¶
- func ContainerName(provider, dir string) string
- func Launch(cmd *exec.Cmd, providerName, dir, sessionMgr, shell, envPrefix string) error
- func LaunchInContainer(cmd *exec.Cmd, providerName, dir, shell, envPrefix string, opts ContainerOpts) error
- func TmuxSessionName(provider, dir string) string
- type ContainerOpts
- type LaunchOpts
- type LaunchResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainerName ¶ added in v0.11.0
ContainerName returns the container name for a given provider and directory.
func Launch ¶
Launch runs a pre-built exec.Cmd in the specified session manager (tmux or iTerm2). The provider name and directory are used to derive the tmux session name. The shell parameter specifies the login shell to use (e.g., "/bin/zsh"); use config.ResolveShell(). The envPrefix is prepended to the command (e.g., OTEL env vars).
func LaunchInContainer ¶ added in v0.11.0
func LaunchInContainer(cmd *exec.Cmd, providerName, dir, shell, envPrefix string, opts ContainerOpts) error
LaunchInContainer creates a container, then launches the agent inside it via tmux. The container runs `sleep infinity` and the agent command is executed inside it via `podman exec`. The tmux session wraps the podman exec so the user can attach/detach normally.
Flow: podman create → podman start → tmux new-session "podman exec ... agent"
func TmuxSessionName ¶
TmuxSessionName returns the tmux session name for a given provider and directory. Format: aimux-<provider>-<basename(dir)> with spaces replaced by hyphens.
Types ¶
type ContainerOpts ¶ added in v0.11.0
type ContainerOpts struct {
Engine string // "podman" or "docker", defaults to "podman"
Image string // container image, defaults to "fedora:41"
}
ContainerOpts configures container-based agent launch.
type LaunchOpts ¶ added in v0.11.0
type LaunchOpts struct {
Provider string // which agent: claude, codex, gemini
Dir string // working directory
Model string // model override
Mode string // permission mode
Prompt string // initial prompt
Runtime string // "local" or "container"
Execution string // "local" or "hybrid"
Shell string // e.g. "/bin/zsh"
SessionManager string // "tmux" or "direct"
OTELEnabled bool // whether to inject OTEL env vars
OTELEndpoint string // for building env prefix
ContainerOpts ContainerOpts // container engine/image if Runtime == "container"
}
LaunchOpts carries all axes needed to launch an agent session. Zero values for new fields default to safe values: Runtime="local", Execution="local", Shell=$SHELL, SessionManager="tmux".
type LaunchResult ¶ added in v0.11.0
type LaunchResult struct {
TmuxSession string `json:"tmux_session,omitempty"`
PID int `json:"pid,omitempty"`
}
LaunchResult carries information about a successfully launched session.