1pub fn print_usage() {
3 println!(
4 r#"Usage: start [options] [--] <command> [args...]
5 start <command> [args...]
6 start --status <uuid> [--output-format <format>]
7 start --list [--output-format <format>]
8 start --upload-log <uuid-or-session-name>
9 start --stop <uuid-or-session-name>
10 start --terminate <uuid-or-session-name>
11
12Options:
13 --isolated, --isolation, -i <env> Run in isolated environment (screen, tmux, docker, ssh)
14 --attached, -a Run in attached mode (foreground)
15 --detached, -d Run in detached mode (background)
16 --session, -s <name> Session name for isolation
17 --session-id <uuid> Session UUID for tracking (auto-generated if not provided)
18 --session-name <uuid> Alias for --session-id
19 --image <image> Docker image (optional, defaults to OS-matched image)
20 --volume, -v <spec> Docker bind mount/volume host:container[:mode] (repeatable, docker only)
21 --mount <spec> Docker --mount spec (repeatable, docker only)
22 --env, -e <KEY=VALUE> Environment variable for docker container (repeatable, docker only)
23 --privileged Run docker container in privileged mode (docker only)
24 --network <name> Connect docker container to a named network (docker only)
25 --network-alias <alias> Add network-scoped alias (repeatable, docker only)
26 --endpoint <endpoint> SSH endpoint (required for ssh isolation, e.g., user@host)
27 --isolated-user, -u [name] Create isolated user with same permissions
28 --keep-user Keep isolated user after command completes
29 --keep-alive, -k Keep isolation environment alive after command exits
30 --auto-remove-docker-container Always remove docker container after exit (compatibility alias)
31 --always-cleanup-container Always remove docker container after exit
32 --keep-container Keep docker container filesystem after exit
33 --keep-container-on-fail Remove successful docker containers, keep failed or OOM-killed ones
34 --shell <shell> Shell to use in isolation environments: auto, bash, zsh, sh (default: auto)
35 --use-command-stream Use command-stream library for execution (experimental)
36 --status <id> Show status of execution by UUID or session name (--output-format: links-notation|json|text)
37 --list List all tracked executions (--output-format: links-notation|json|text)
38 --upload-log <id> Upload the stored log for an execution UUID or session name
39 --stop <id> Ask a detached isolated execution to stop gracefully
40 --terminate <id> Terminate a detached isolated execution immediately
41 --cleanup Clean up stale "executing" records (crashed/killed processes)
42 --cleanup-dry-run Show stale records that would be cleaned up (without cleaning)
43 --version, -v Show version information
44
45Examples:
46 start echo "Hello World"
47 start bun test
48 start --isolated tmux -- bun start
49 start -i screen -d bun start
50 start --isolated docker -- echo 'hi' # uses OS-matched default image
51 start --isolated docker --image oven/bun:latest -- bun install
52 start -i docker -v ~/.config/gh:/root/.config/gh -e TOKEN=abc -- gh repo list
53 start -i docker --image konard/hive-mind-dind:latest --privileged -- solve ...
54 start --isolated ssh --endpoint user@remote.server -- ls -la
55 start --isolated-user -- npm test
56 start -u myuser -- npm start
57 start -i screen --isolated-user -- npm test
58 start --status a1b2c3d4-e5f6-7890-abcd-ef1234567890
59 start --status a1b2c3d4 --output-format json
60 start --list
61 start --list --output-format json
62 start --upload-log my-screen-session
63 start --stop my-screen-session
64 start --terminate my-screen-session
65 start --cleanup-dry-run
66 start --cleanup
67
68Features:
69 - Logs all output to temporary directory
70 - Displays timestamps and exit codes
71 - Auto-reports failures for NPM packages (when gh is available)
72 - Natural language command aliases (via substitutions.lino)
73 - Process isolation via screen, tmux, or docker"#
74 );
75}