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