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