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 --endpoint <endpoint> SSH endpoint (required for ssh isolation, e.g., user@host)
25 --isolated-user, -u [name] Create isolated user with same permissions
26 --keep-user Keep isolated user after command completes
27 --keep-alive, -k Keep isolation environment alive after command exits
28 --auto-remove-docker-container Always remove docker container after exit (compatibility alias)
29 --always-cleanup-container Always remove docker container after exit (default)
30 --keep-container Keep docker container filesystem after exit
31 --keep-container-on-fail Remove successful docker containers, keep failed ones
32 --shell <shell> Shell to use in isolation environments: auto, bash, zsh, sh (default: auto)
33 --use-command-stream Use command-stream library for execution (experimental)
34 --status <id> Show status of execution by UUID or session name (--output-format: links-notation|json|text)
35 --list List all tracked executions (--output-format: links-notation|json|text)
36 --upload-log <id> Upload the stored log for an execution UUID or session name
37 --stop <id> Send CTRL+C/SIGINT to a detached isolated execution
38 --terminate <id> Terminate a detached isolated execution immediately
39 --cleanup Clean up stale "executing" records (crashed/killed processes)
40 --cleanup-dry-run Show stale records that would be cleaned up (without cleaning)
41 --version, -v Show version information
42
43Examples:
44 start echo "Hello World"
45 start bun test
46 start --isolated tmux -- bun start
47 start -i screen -d bun start
48 start --isolated docker -- echo 'hi' # uses OS-matched default image
49 start --isolated docker --image oven/bun:latest -- bun install
50 start -i docker -v ~/.config/gh:/root/.config/gh -e TOKEN=abc -- gh repo list
51 start -i docker --image konard/hive-mind-dind:latest --privileged -- solve ...
52 start --isolated ssh --endpoint user@remote.server -- ls -la
53 start --isolated-user -- npm test
54 start -u myuser -- npm start
55 start -i screen --isolated-user -- npm test
56 start --status a1b2c3d4-e5f6-7890-abcd-ef1234567890
57 start --status a1b2c3d4 --output-format json
58 start --list
59 start --list --output-format json
60 start --upload-log my-screen-session
61 start --stop my-screen-session
62 start --terminate my-screen-session
63 start --cleanup-dry-run
64 start --cleanup
65
66Features:
67 - Logs all output to temporary directory
68 - Displays timestamps and exit codes
69 - Auto-reports failures for NPM packages (when gh is available)
70 - Natural language command aliases (via substitutions.lino)
71 - Process isolation via screen, tmux, or docker"#
72 );
73}