wmao

module
v0.0.0-...-689de95 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: Apache-2.0

README

wmao

Work my ass off. Manage multiple coding agents.

  • Backend is in Go, frontend in SolidJS.
  • Expects md to be in $PATH.
  • Requires docker to be installed.

Architecture

Each task runs Claude Code inside an isolated md container. A Python relay process inside the container owns Claude's stdin/stdout and persists across SSH disconnects, so the server can restart without killing the agent or losing messages.

HOST (wmao server)              CONTAINER (md)
──────────────────              ───────────────────────────────
                                relay.py (setsid, survives SSH)
┌─────────┐   SSH stdin/stdout  ┌────────┐     ┌──────────────┐
│ Session │◄═══════════════════►│ attach │◄═══►│ Unix socket  │
│ (Go)    │     NDJSON bidir    └────────┘     │              │
└─────────┘                                    │ relay server │
                                output.jsonl ◄─┤ ┌────────┐   │
                                (append-only)  │ │ claude │   │
                                               │ │ code   │   │
                                               │ └────────┘   │
                                               └──────────────┘

Normal operation: The server connects via SSH to the relay's attach command. NDJSON messages flow bidirectionally through a Unix socket to the Claude process. All output is appended to output.jsonl inside the container.

Server restart: The relay keeps Claude alive (it is setsid'd and independent of the SSH session). On restart the server:

  1. Discovers running containers via md list
  2. Checks if the relay is still alive (Unix socket exists)
  3. Reads output.jsonl from the container to restore full conversation history
  4. Re-attaches to the relay from the last byte offset — no messages are lost

Relay dead (Claude crashed): Falls back to host-side JSONL logs and claude --resume to start a new session continuing the conversation.

Installation

go install github.com/maruel/wmao/backend/cmd/wmao@latest
systemd user service

Install the unit file and enable it:

mkdir -p ~/.config/systemd/user
cp contrib/wmao.service ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now wmao

Edit ~/.config/systemd/user/wmao.service to adjust -root and -http

View logs:

journalctl --user -u wmao -f

Serving over Tailscale

Safely expose wmao on your Tailscale network using tailscale serve. This provides secure access from any device on your tailnet without opening ports or configuring firewalls.

# Expose wmao on your tailnet at https://<hostname>.<tailnet>.ts.net
tailscale serve --bg 8080

HTTPS: Tailscale serve provides HTTPS automatically via Let's Encrypt TLS certificates.

Do not use tailscale funnel.

Directories

Path Synopsis
backend
cmd/wmao command
frontend
Package frontend embeds the built frontend assets.
Package frontend embeds the built frontend assets.
internal/agent
Package agent manages Claude Code processes via the streaming JSON protocol.
Package agent manages Claude Code processes via the streaming JSON protocol.
internal/agent/relay
Package relay embeds the Python relay script used inside containers.
Package relay embeds the Python relay script used inside containers.
internal/cmd/gen-api-client command
Generates a typed TypeScript API client from the Go route declarations.
Generates a typed TypeScript API client from the Go route declarations.
internal/container
Package container wraps md container lifecycle operations.
Package container wraps md container lifecycle operations.
internal/gitutil
Package gitutil provides git operations for branch management and pushing.
Package gitutil provides git operations for branch management and pushing.
internal/server
Response compression middleware for API endpoints.
Response compression middleware for API endpoints.
internal/server/dto
Structured API error types and constructors.
Structured API error types and constructors.
internal/task
Package task orchestrates a single coding agent task: branch creation, container lifecycle, agent execution, and git integration.
Package task orchestrates a single coding agent task: branch creation, container lifecycle, agent execution, and git integration.

Jump to

Keyboard shortcuts

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