Help Reference

Help Reference

spaces --help
Usage: spaces [OPTIONS] <COMMAND>

Commands:
  checkout     
               Executes the checkout rules in the specified scripts.
  sync         Runs checkout rules within an existing workspace. This is experimental. Don't use it
  run          
               Runs a spaces run rule.
               - `spaces run`: Run all non-optional rules with dependencies
               - `spaces run my-target`: Run a single target plus dependencies
               - `spaces run my-target -- --some-arg --some-other-arg`: pass additional arguments to a rule
  inspect      
               Inspect all the scripts in the workspace without running any rules.
               - `spaces inspect`: show the rules that have `help` entries: 
               - `spaces inspect <target-name>`: show target plus dependencies
               - `spaces --verbosity=message inspect`: show all rules
               - `spaces --verbosity=debug inspect`: show all rules in detail
  completions  Generates shell completions for the spaces command
  docs         Shows the documentation for spaces starlark modules
  help         Print this message or the help of the given subcommand(s)

Options:
  -v, --verbosity <VERBOSITY>  The verbosity level of the output [default: app] [possible values: trace, debug, message, info, app, warning, error]
      --hide-progress-bars     Dont show progress bars
      --show-elapsed-time      Show elapsed time - use with --verbosity=debug to instrument spaces performance
      --ci                     If this is passed, info.is_ci() returns true in scripts
      --rescan                 Rescan the workspace for *spaces.star files
  -h, --help                   Print help
  -V, --version                Print version

Checkout Help

spaces checkout --help
Executes the checkout rules in the specified scripts.

Usage: spaces checkout [OPTIONS] --name <NAME>

Options:
      --name <NAME>              The name of the workspace to create
      --env <ENV>                Environment variables to add to the checked out workspace. Use `--env=VAR=VALUE`. Makes workspace not reproducible
      --new-branch <NEW_BRANCH>  Use --new-branch=<rule> to have spaces create a new branch for the rule. Branch name will match the workspace name
      --script <SCRIPT>          The path(s) to the `spaces.star`` file containing checkout rules. Paths are processed in order
      --workflow <WORKFLOW>      Scripts to process in the format of `--workflow=<directory>:<script>,<script>,...`.
                                 `--script` is processed before `--workflow`. 
                                 
                                 If <directory> has `workflows.spaces.toml`, it will be parsed for shortcuts if only one <script> is passed.
                                 - `spaces checkout --workflow=workflows:my-shortcut --name=workspace-name`
                                   - run scripts listed in `my-shortcut` in `workflows/workflows.spaces.toml`
                                 - `spaces checkout --workflow=workflows:preload,my-shortcut --name=workspace-name`
                                   - run `workflows/preload.spaces.star` then `workflows/my-shortcut.spaces.star`
                                 
                                 ```toml
                                 my-shortcut = ["preload", "my-shortcut"]
                                 ```
                                 
      --wf <WF>                  Shortcut for --workflow
      --create-lock-file         Create a lock file for the workspace. This file can be passed on the next checkout as a script to re-create the exact workspace
      --force-install-tools      Force install the tools spaces needs to run
  -h, --help                     Print help

Run Help

spaces run --help
Runs a spaces run rule.
- `spaces run`: Run all non-optional rules with dependencies
- `spaces run my-target`: Run a single target plus dependencies
- `spaces run my-target -- --some-arg --some-other-arg`: pass additional arguments to a rule

Usage: spaces run [OPTIONS] [TARGET] [EXTRA_RULE_ARGS]...

Arguments:
  [TARGET]              The name of the target to run (default is all targets)
  [EXTRA_RULE_ARGS]...  Extra arguments to pass to the rule (passed after `--`)

Options:
      --forget-inputs  Forces rules to run even if input globs are the same as last time
      --env <ENV>      Environment variables to override during the run. Use `--env=VAR=VALUE`
  -h, --help           Print help

Inspect Help

spaces inspect --help
Inspect all the scripts in the workspace without running any rules.
- `spaces inspect`: show the rules that have `help` entries: 
- `spaces inspect <target-name>`: show target plus dependencies
- `spaces --verbosity=message inspect`: show all rules
- `spaces --verbosity=debug inspect`: show all rules in detail

Usage: spaces inspect [OPTIONS] [TARGET]

Arguments:
  [TARGET]  The name of the target to evaluate (default is all targets)

Options:
      --filter <FILTER>      Filter targets with a glob (e.g. `--filter=**/my-target`)
      --has-help             Only show rules with the help entry populated
      --markdown <MARKDOWN>  Write the output of the inspect command to a markdown file
      --stardoc <STARDOC>    Write the starlark documentation to the specified path
  -h, --help                 Print help