flaude¶
On-demand Claude Code execution on Fly.io machines.
Spin up ephemeral VMs, run Claude Code prompts against your repos, stream the output back, and auto-destroy the machines when done. No persistent infrastructure required.
How it works¶
Your code Fly.io
─────── ──────
MachineConfig ──► create VM ──► clone repos
│
run Claude Code
│
◄── stream logs ◄─ stdout/stderr
│
destroy VM ◄──── exit
- A Docker container with Claude Code, git, and gh CLI pre-installed boots on Fly.io
- The entrypoint clones your specified repos into
/workspace - Claude Code runs your prompt in print mode (
-p) - Logs stream back to your process via HTTP log drains (NDJSON)
- The machine is always destroyed after completion (guaranteed via
try/finally)
Install¶
Requires Python 3.11+. The only runtime dependency is httpx.
Quick start¶
import asyncio
from flaude import MachineConfig, ensure_app, run_and_destroy
async def main():
app = await ensure_app("my-flaude-app")
config = MachineConfig(
claude_code_oauth_token="sk-ant-oat-...",
github_username="you",
github_token="ghp_...",
prompt="Find and fix any type errors in src/",
repos=["https://github.com/you/your-repo"],
)
result = await run_and_destroy(app.name, config)
print(f"Exit code: {result.exit_code}")
asyncio.run(main())
Tip
Use run_with_logs for real-time output — see Streaming Logs.
Navigation¶
- Overview — why flaude exists and what you can build with it
- Getting Started — prerequisites and first-run tutorial
- Streaming Logs — real-time log streaming with
run_with_logs - Concurrent Execution — run many prompts in parallel
- Error Handling — handle failures and timeouts
- Private Repositories — authenticate with GitHub
- Docker Image — build and customize the base image
- Building on flaude — advanced integration patterns
- Architecture — how the pieces fit together
- Log Drain Infrastructure — the log streaming internals
- API Reference — full API documentation
- Changelog