| name | autoship-setup |
| description | Interactive setup wizard for AutoShip on OpenCode โ model selection, tool detection, concurrency tuning |
| platform | opencode |
| tools | ["Bash","question","Write"] |
AutoShip Setup Wizard โ OpenCode Port
Guide users through model selection and configuration on first run.
Usage
Interactive Mode (default)
/autoship-setup
Non-Interactive Mode (--no-tui)
/autoship-setup --no-tui \
--max-agents 10 \
--labels "agent:ready,autoship:in-progress" \
--refresh-models \
--orchestrator-model provider/model-a \
--reviewer-model provider/model-b
Flow Overview
- Runtime Detection โ Check for OpenCode CLI
- GitHub Auth โ Verify
gh auth status
- Model Discovery โ List models from
opencode models
- Model Selection โ Role prompts plus free-first or custom worker routing
- Concurrency โ How many agents?
- Labels โ Which labels to monitor?
- Refresh Behavior โ Auto-refresh model inventory?
- Summary โ Ready to go
Step 1: Runtime Detection
command -v opencode >/dev/null 2>&1 && opencode --version
Ask user: "OpenCode not found. Install it first."
Step 2: GitHub Auth
gh auth status
Ask user if not authenticated:
GitHub authentication required.
Run: gh auth login
Or set GH_TOKEN environment variable.
Step 3: Model Discovery
opencode models
Step 4: Model Configuration
Ask the user:
Which model configuration?
โ Choose orchestrator and reviewer role models
โ They can be the same model or different models
โ Prefer capable free or OpenCode Go Kimi/Kimmy/Ling 2.6-family models when available
โ Free-first OpenCode
โ Prefer configured free OpenCode models
โ Do not include paid models by default
โฏ Custom OpenCode models
โ Operator chooses model IDs from the current `opencode models` output
โ Writes `.autoship/model-routing.json`
โ Explicitly selected non-free models are allowed
Step 5: Concurrency
Ask:
How many concurrent agents?
โ Conservative (5 agents)
โ Lowest cost, good for testing
โฏ Standard (10 agents)
โ Balanced throughput/cost
โฏ Aggressive (15 agents)
โ Higher parallelism for trusted queues
Step 6: Labels
Ask:
Which labels should AutoShip monitor for issues?
โ agent:ready (default)
โ Standard AutoShip queue label
โฏ Custom labels (comma-separated)
โ e.g., "agent:ready,needs-triage"
Step 7: Refresh Behavior
Ask:
How often should AutoShip refresh model inventory?
โ Auto-refresh on startup
โ Checks for new models each time AutoShip starts
โฏ Manual only
โ Only refreshes when AUTOSHIP_REFRESH_MODELS=1 is set
Step 8: Generate Config
AUTOSHIP_HOME="${OPENCODE_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/opencode}/.autoship"
bash "$AUTOSHIP_HOME/hooks/opencode/setup.sh"
bash "$AUTOSHIP_HOME/hooks/opencode/setup.sh" --no-tui \
--max-agents 10 \
--labels "agent:ready" \
--refresh-models \
--orchestrator-model provider/model-a \
--reviewer-model provider/model-b
Setup preserves existing .autoship/model-routing.json by default so operators can edit it manually. Use AUTOSHIP_REFRESH_MODELS=1 or --refresh-models to regenerate free defaults from the current OpenCode model inventory.
Step 9: Summary
โ AutoShip configured!
Runtime: OpenCode
GitHub: Authenticated
Models: <free discovered models or explicit operator selection>
Concurrency: <N> agents
Labels: <configured labels>
Refresh: <auto/manual>
Next: Run /autoship to start
Non-Interactive Flags (--no-tui)
| Flag | Description | Default |
|---|
--max-agents N | Set max concurrent agents | 15 |
--labels LABEL1,LABEL2 | Comma-separated labels to monitor | agent:ready |
--refresh-models | Force refresh model inventory | false |
--planner-model MODEL | Set planner/coordinator/orchestrator/reviewer/lead model | best available role model |
--orchestrator-model MODEL | Set orchestrator model | prompted on first run |
--reviewer-model MODEL | Set reviewer model | prompted on first run |
--worker-models MODEL1,MODEL2 | Comma-separated worker models | auto-detect free models |
Error Recovery
| Error | Recovery |
|---|
| OpenCode not found | Install OpenCode before starting workers |
| GitHub not authenticated | Run gh auth login or set GH_TOKEN |
| Config write fails | Check file permissions |
| No free models found | Use --worker-models to specify explicitly |
Reconfiguration
rm .autoship/.onboarded
/autoship-setup --no-tui --max-agents 10 --refresh-models