You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# flout
2
2
3
-
Manage persistent AI agent sessions with tmux. Start, stop, join, and restart long-running Claude Code sessions from the command line — locally or in container sandboxes (Docker, Podman, or containerd via Colima).
3
+
Manage persistent AI agent sessions with tmux. Start, stop, join, and restart long-running coding-agent sessions (Claude Code or opencode) from the command line — locally or in container sandboxes (Docker, Podman, or containerd via Colima).
flout defaults to Claude Code. Pass `--agent opencode` (or set `FLOUT_AGENT=opencode`) to use [opencode](https://opencode.ai) instead. opencode does not have a remote-control mode, so `flout remote` and `flout restart` only work with Claude.
41
+
42
+
```bash
43
+
flout setup --agent opencode # one-time setup for opencode
44
+
flout start myproject --agent opencode # start an opencode session
45
+
```
46
+
47
+
opencode ships with built-in models that work without an API key, so `flout status --agent opencode` is happy as soon as the `opencode` binary is on your `PATH`. Run `opencode auth login` only if you want to register additional providers.
48
+
38
49
### Remote sessions
39
50
40
51
Remote sessions auto-restart if the agent exits, so they stay running unattended.
src/engine.ts Engine detection (Docker, Podman, nerdctl) and abstraction
20
23
src/colima.ts Colima VM lifecycle management
@@ -35,22 +38,24 @@ interface Agent {
35
38
name:string;
36
39
binary:string;
37
40
installHint?:string;
38
-
remoteCommand(sessionName:string):string;
41
+
remoteCommand?(sessionName:string):string;// optional — omit if no remote-control mode
39
42
startCommand():string;
40
43
loginCommand():string;
41
-
setupTokenCommand():string;
44
+
setupTokenCommand?():string;// optional — omit if login is sufficient
42
45
isAuthenticated():boolean;
43
46
isTrusted(dir:string):boolean;
44
47
trustCommand():string;
45
48
encodePath(dir:string):string;
46
49
}
47
50
```
48
51
52
+
`remoteCommand` and `setupTokenCommand` are optional. When `remoteCommand` is missing, `flout remote` and `flout restart` exit with an error for that agent.
53
+
49
54
## Adding a new agent
50
55
51
56
1. Create a new package `packages/<name>/` with `src/index.ts` exporting an object satisfying `Agent`
52
-
2. Add it as a workspace dependency in `packages/cli/package.json`
53
-
3.Wire it up in `packages/cli/src/cli.ts`
57
+
2. Add it as a workspace dependency in `packages/cli/package.json` and a tsconfig reference in `packages/cli/tsconfig.json` and the root `tsconfig.json`
58
+
3.Register it in the `AGENTS` map in `packages/cli/src/cli.ts` so it can be selected via `--agent <name>` (or `FLOUT_AGENT=<name>`)
54
59
55
60
## Container sandbox
56
61
@@ -76,6 +81,16 @@ npm test # runs tests across all workspaces
76
81
77
82
Tests use `node:test` and `node:assert`. Integration tests use a real bash-based agent and real tmux sessions — no mocks.
78
83
84
+
### E2E tests
85
+
86
+
E2E suites live in `packages/cli/test/e2e/` and run real flout commands end-to-end:
87
+
88
+
-`sessions.e2e.ts` — exercises the Claude path. Uses `@flout/claude-mock-api` (HTTP mock) and a fake `claude` binary that just sleeps, so the suite needs no external services.
89
+
-`opencode.e2e.ts` — exercises the opencode path. Runs the **real**`opencode` binary (no mock), since opencode ships with built-in models that work without any external API key. The suite skips itself when `opencode` is not in `PATH`, so local devs don't have to install it.
Run a single suite with `npx tsx --test packages/cli/test/e2e/<file>.e2e.ts`. CI installs opencode via `npm i -g opencode-ai` and runs the opencode suite as part of the standard build-lint-test job.
93
+
79
94
## Constraints
80
95
81
96
- Minimal dependencies — only TypeScript and @types/node as dev deps
0 commit comments