Stakpak CLI
Unified Configuration (Profiles + Autopilot)
This guide explains the current configuration model.
TL;DR
~/.stakpak/config.tomlis the source of truth for behavior profiles.~/.stakpak/autopilot.tomlis for runtime wiring (schedules/channels/service settings).- Schedules/channels should reference profiles using
profile = "name". - Runtime fields transported per-run are:
modelauto_approvesystem_promptmax_turns
- Inline channel
model/auto_approvestill work for compatibility, but are deprecated.
Autopilot deployment readiness
Autopilot now has a shared readiness/probe system used by both:
stakpak up— fail-fast startup checksstakpak autopilot doctor— fuller deployment-readiness report
What stakpak up checks before startup
Blocking failures:
- credentials configured
- Docker installed
- Docker accessible to the current user
- clearly unsafe memory conditions
Warnings:
- bind-port conflicts
- disabled systemd linger
- low memory headroom
What stakpak autopilot doctor checks
In addition to the startup probes, doctor also reports:
- disk space headroom
- critical sandbox mount readability hints
- channel config validity
- schedule config validity
- service installation status
- server health reachability
- tool approval posture
Important behavior notes
stakpak upnow runs preflight checks before image pull/service start- sandbox permission issues are addressed by mapping the host UID/GID into the container runtime when possible
- secret/config files should not be made world-readable as a workaround
Sandbox mode
Autopilot spawns a Docker-based sandbox container to isolate subagent tool calls. The sandbox_mode field in [server] controls the container lifecycle:
[]
= "127.0.0.1:4096"
= "ephemeral" # or "persistent" (default)
| Mode | Behavior | Startup requirement |
|---|---|---|
persistent (default) |
Single container spawned at startup, reused for all sessions. If the container fails to start, autopilot refuses to start. | Docker + working image for host arch |
ephemeral |
Container spawned per-session only when sandbox: true is requested. The sandbox image is still pulled/validated at startup so Docker progress is visible. |
Docker + working image for host arch |
Common probe meanings
| Probe | Meaning | Typical fix |
|---|---|---|
docker_installed |
Docker binary missing | Install Docker |
docker_accessible |
User cannot talk to daemon | Add user to docker group / start daemon |
memory |
Host is too small or borderline | Use 2GB+ RAM or add swap |
disk_space |
Low free space for image pulls/logs | Free space or expand volume |
bind_port |
Listen address unavailable | stakpak down or change bind |
systemd_linger |
User service may stop after logout | sudo loginctl enable-linger $USER |
sandbox_mount_inputs |
Critical mounted inputs may be unreadable | Fix invoking-user readability; do not loosen secret perms globally |
Use stakpak autopilot doctor as the canonical deployment-readiness and remediation entrypoint.
File ownership
1) ~/.stakpak/config.toml (behavior profiles)
Use this for profile behavior and credentials.
[]
= "sk-..."
= "anthropic/claude-sonnet-4-5"
= ["view", "search_docs", "run_command"]
= ["view", "search_docs"]
= "You are the production reliability assistant."
= 64
[]
= "anthropic/claude-haiku-4-5"
= ["view", "search_docs"]
= ["view", "search_docs"]
= "Monitor and report only. Never make changes."
= 16
[]
= "anthropic/claude-sonnet-4-5"
= ["view", "search_docs", "run_command", "create", "str_replace"]
= ["view", "search_docs", "run_command"]
= 64
2) ~/.stakpak/autopilot.toml (runtime wiring)
Use this for schedules/channels and runtime config.
[]
= "127.0.0.1:4096"
[[]]
= "health-check"
= "*/5 * * * *"
= "Check production health"
= "monitoring"
[]
= "xoxb-..."
= "xapp-..."
= "ops"
CLI workflow
Add schedules with profile
check script paths support ~, which resolves against the HOME of the user running autopilot.
For systemd/launchd/container deployments, prefer absolute paths (for example, /home/ec2-user/.stakpak/checks/endpoints.sh).
Add channels with profile
Both commands validate that profile names exist in config.toml.
Runtime resolution path
- Caller selects a profile (schedule/channel/API caller).
- Profile is resolved from
config.toml. - Runtime fields are converted to
RunOverrides. - Server merges
RunOverrideswithAppStatedefaults to build per-runRunConfig.
This keeps server runtime stateless while allowing per-run behavior.
Backward compatibility
- Channel inline overrides are still supported:
channels.<type>.modelchannels.<type>.auto_approve
- If both
profileand inline values are set, profile-based run overrides take precedence. - Gateway emits deprecation warnings to help migration.
Validation limits
Profile validation enforces:
max_turnsin1..=256system_promptup to32KB(characters)
Invalid profile values fail at profile resolution time.
Recommended migration
- Move channel inline
modelandauto_approveinto named profiles inconfig.toml. - Set
profile = "..."on channels and schedules. - Use
stakpak autopilot doctorto detect deprecated inline channel fields. - Keep
autopilot.tomlfocused on runtime wiring only.