Skip to main content

start_command/
usage.rs

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