Skip to content

Instantly share code, notes, and snippets.

@nazt
Created May 2, 2026 03:04
Show Gist options
  • Select an option

  • Save nazt/ef515f765541b553b0e0721a5a6b232b to your computer and use it in GitHub Desktop.

Select an option

Save nazt/ef515f765541b553b0e0721a5a6b232b to your computer and use it in GitHub Desktop.
maw CLI smoke tests — maw preflight, team lifecycle, engine flag
#!/usr/bin/env bash
set -euo pipefail
echo ""
echo " maw engine test"
echo ""
# Check config.commands
echo " engines in config:"
cat ~/.config/maw/maw.config.json | grep -A5 '"commands"' | grep -v default | grep ':' | sed 's/[",]//g; s/^/ /'
echo ""
# Test buildCommand resolution (via --version as proxy)
echo " testing maw wake --codex on a dead pane..."
echo " (kill an agent first: tmux send-keys -t <pane> C-c C-c)"
echo " then run: maw wake <oracle> --codex"
echo ""
echo " or test swarm:"
echo " maw swarm --count 2"
echo " maw swarm codex claude"
echo ""
#!/usr/bin/env bash
set -euo pipefail
GREEN='\033[32m'
RED='\033[31m'
GRAY='\033[90m'
CYAN='\033[36m'
RESET='\033[0m'
pass=0
fail=0
total=0
run() {
local label="$1"; shift
total=$((total + 1))
printf " ${GRAY}%-40s${RESET} " "$label"
if output=$("$@" 2>&1); then
lines=$(echo "$output" | wc -l | tr -d ' ')
printf "${GREEN}✓${RESET} ${GRAY}(%s lines)${RESET}\n" "$lines"
pass=$((pass + 1))
else
code=$?
printf "${RED}✗${RESET} ${GRAY}(exit %d)${RESET}\n" "$code"
fail=$((fail + 1))
fi
}
echo ""
echo " ${CYAN}maw smoke test${RESET}"
echo ""
# Core
run "maw --version" maw --version
run "maw preflight" maw preflight
run "maw ls" maw ls
run "maw ls -v" maw ls -v
run "maw oracle ls --json" maw oracle ls --json
run "maw oracle search maw" maw oracle search maw
run "maw fleet ls" maw fleet ls
run "maw doctor --smoke" maw doctor --smoke
# Team (create → spawn → ls → shutdown → delete)
if [ "${1:-}" = "--team" ]; then
echo ""
echo " ${CYAN}team lifecycle${RESET}"
echo ""
run "team create" maw team create smoke-test --description "automated smoke"
sleep 1
run "team ls" maw team ls
run "team shutdown" maw team shutdown smoke-test
run "team delete" maw team delete smoke-test
fi
echo ""
icon="✓"
[ "$fail" -gt 0 ] && icon="⚠"
printf " ${icon} ${GREEN}%d${RESET} pass, ${RED}%d${RESET} fail / %d total\n\n" "$pass" "$fail" "$total"
[ "$fail" -eq 0 ]

maw CLI Test Commands

Quick Health Check

maw --version
maw preflight
maw doctor --smoke

Session Management

maw ls
maw ls -v
maw oracle ls
maw oracle search maw
maw fleet ls

Team Lifecycle

maw team create test-smoke --description "smoke test team"
maw team spawn test-smoke scout --prompt "say hello"
maw team spawn test-smoke builder --prompt "list files"
maw team ls
maw team status
maw team peek scout
maw team broadcast test-smoke "ping"
maw team shutdown test-smoke
maw team delete test-smoke

Wake + Engine

maw wake <oracle> --codex
maw wake <oracle> -e codex
maw wake <oracle>

Swarm

maw swarm --count 2
maw swarm codex claude

Cleanup

maw preflight --fix
maw cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment