Usage

ubc features explorative help pages. Add -h/--help to any command to see the available options. Many commands directly show the help page when executed without any options and arguments.

The following sections show all available (sub-)commands.

Somes notes upfront:

  • ubc check shows warnings for individual files while ubc build index reports warnings for the whole project, so it can also consider needs graph problems, such as duplicate IDs across multiple files.

  • ubc build index builds a project index including caches just like ubCode . Therefore it makes sense to keep ubCode and ubc versions in sync.

ubc

ubc Usage: ubc [OPTIONS] COMMAND [ARGS]... CLI for the ubcode project ╭─ Options ─────────────────────────────────────────────────────────────────────────╮ --versionShow the version and exit --install-completionInstall completion for the current shell. --show-completionShow completion for the current shell, to copy it   or customize the installation.                      --helpShow this message and exit. ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ Commands ────────────────────────────────────────────────────────────────────────╮ check      Run linting checks on individual files or directories.               clean      Clear any caches in the directory and any subdirectories             config     Show the nearest configuration in JSON format, resolving any extends and defaults.                                                        script     Run a script defined in ubproject.toml.                              quickstart Create an example ubcode project.                                    ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ Sub-menus ───────────────────────────────────────────────────────────────────────╮ build      Commands for building projects                                       license    Commands for managing licenses                                       ╰───────────────────────────────────────────────────────────────────────────────────╯

check

check Usage: ubc check [OPTIONS] FILES... Run linting checks on individual files or directories. Each file file will be processed against its nearest configuration file, or the  default configuration if no configuration file is found. ╭─ Arguments ───────────────────────────────────────────────────────────────────────╮ *filesFILES...Files or directories to run checks on[required] ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ Options ─────────────────────────────────────────────────────────────────────────╮ --helpShow this message and exit. ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ Config Overrides ────────────────────────────────────────────────────────────────╮ --extend-ignoreComma-separatedComma-separated list of additional        diagnostic codes to ignore                ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ Configuration ───────────────────────────────────────────────────────────────────╮ --isolatedDo not read any configuration files, use only the default configuration                                             --configPATHThe path to a specific configuration file to use for all  files                                                     ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ Processing ──────────────────────────────────────────────────────────────────────╮ --parallel--no-parallelParallel process, if it might be     faster.                              [default: parallel]                  --force-parallel--no-force-parallelForce parallel processing.   [default: no-force-parallel] ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ License ─────────────────────────────────────────────────────────────────────────╮ --license-keyTEXT    Use a specific license key.   [env var: UBCODE_LICENSE_KEY] --license-userTEXT    Use a specific license user.   [env var: UBCODE_LICENSE_USER] --license-stageprod|devUse a specific license stage    [env var: UBCODE_LICENSE_STAGE] ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ Logging ─────────────────────────────────────────────────────────────────────────╮ --verbose-vShow debug information --quiet-qOnly show errors and warnings ╰───────────────────────────────────────────────────────────────────────────────────╯

clean

clean Usage: ubc clean [OPTIONS] [PATH] Clear any caches in the directory and any subdirectories ╭─ Arguments ───────────────────────────────────────────────────────────────────────╮ path[PATH]The path to the directory to clean ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ Options ─────────────────────────────────────────────────────────────────────────╮ --helpShow this message and exit. ╰───────────────────────────────────────────────────────────────────────────────────╯

config

config Usage: ubc config [OPTIONS] [PATH] Show the nearest configuration in JSON format, resolving any extends and defaults. ╭─ Arguments ───────────────────────────────────────────────────────────────────────╮ path[PATH]The path to start the config search from. ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ Options ─────────────────────────────────────────────────────────────────────────╮ --indent-iINTEGERNumber of spaces to indent JSON. [default: 0]                     --default--no-defaultShow the default configuration instead. [default: no-default]                   --schema--no-schemaShow the configuration schema instead. [default: no-schema]                   --helpShow this message and exit. ╰───────────────────────────────────────────────────────────────────────────────────╯

script

script Usage: ubc script [OPTIONS] KEY Run a script defined in ubproject.toml. ╭─ Arguments ───────────────────────────────────────────────────────────────────────╮ *keyTEXTThe script key to execute.[default: None][required] ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ Options ─────────────────────────────────────────────────────────────────────────╮ --pathPATHThe path to the project root --helpShow this message and exit. ╰───────────────────────────────────────────────────────────────────────────────────╯

quickstart

quickstart Usage: ubc quickstart [OPTIONS] [PATH] Create an example ubcode project. ╭─ Arguments ───────────────────────────────────────────────────────────────────────╮ path[PATH]The path to write to ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ Options ─────────────────────────────────────────────────────────────────────────╮ --overwrite-oOverwrite existing files --helpShow this message and exit. ╰───────────────────────────────────────────────────────────────────────────────────╯

build

build Usage: ubc build [OPTIONS] COMMAND [ARGS]... Commands for building projects ╭─ Options ─────────────────────────────────────────────────────────────────────────╮ --helpShow this message and exit. ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ Commands ────────────────────────────────────────────────────────────────────────╮ index         Index the project and report warnings.                            needs         Build the needs index and output to a file.                       validate-json Validate a needs.json file.                                       json-to-kuzu  Convert a needs.json file to a Kuzu database.                     ╰───────────────────────────────────────────────────────────────────────────────────╯

index

index Usage: ubc build index [OPTIONS] [PATH] Index the project and report warnings. Returns a non-zero exit code if warnings are found. ╭─ Arguments ───────────────────────────────────────────────────────────────────────╮ path[PATH]The path to the project root ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ Options ─────────────────────────────────────────────────────────────────────────╮ --show-warnings-wShow warnings during the build process --helpShow this message and exit. ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ Config Overrides ────────────────────────────────────────────────────────────────╮ --lint-extend-ignoreComma-separatedComma-separated list of additional   diagnostic codes to ignore           ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ Processing ──────────────────────────────────────────────────────────────────────╮ --parallel--no-parallelParallel process, if it might be     faster.                              [default: parallel]                  --force-parallel--no-force-parallelForce parallel processing.   [default: no-force-parallel] --cache--no-cacheUse on-disk cache reads [default: cache]        ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ License ─────────────────────────────────────────────────────────────────────────╮ --license-keyTEXT    Use a specific license key.   [env var: UBCODE_LICENSE_KEY] --license-userTEXT    Use a specific license user.   [env var: UBCODE_LICENSE_USER] --license-stageprod|devUse a specific license stage    [env var: UBCODE_LICENSE_STAGE] ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ Logging ─────────────────────────────────────────────────────────────────────────╮ --verbose-vShow debug information --quiet-qOnly show errors and warnings ╰───────────────────────────────────────────────────────────────────────────────────╯

needs

needs Usage: ubc build needs [OPTIONS] [PATH] Build the needs index and output to a file. ╭─ Arguments ───────────────────────────────────────────────────────────────────────╮ path[PATH]The path to the project root ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ Options ─────────────────────────────────────────────────────────────────────────╮ --format-f[json|parquet|kuzu]The output format [default: json]   --outpath-oPATH               The path to the       output file           --source-maps--no-source-mapsInclude source map    information for each  need                  [default:             source-maps]          --helpShow this message and exit.                 ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ Processing ──────────────────────────────────────────────────────────────────────╮ --parallel--no-parallelParallel process, if it might be     faster.                              [default: parallel]                  --force-parallel--no-force-parallelForce parallel processing.   [default: no-force-parallel] --cache--no-cacheUse on-disk cache reads [default: cache]        ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ License ─────────────────────────────────────────────────────────────────────────╮ --license-keyTEXT    Use a specific license key.   [env var: UBCODE_LICENSE_KEY] --license-userTEXT    Use a specific license user.   [env var: UBCODE_LICENSE_USER] --license-stageprod|devUse a specific license stage    [env var: UBCODE_LICENSE_STAGE] ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ Logging ─────────────────────────────────────────────────────────────────────────╮ --verbose-vShow debug information --quiet-qOnly show errors and warnings ╰───────────────────────────────────────────────────────────────────────────────────╯

validate-json

validate-json Usage: ubc build validate-json [OPTIONS] PATH [ID]... Validate a needs.json file. ╭─ Arguments ───────────────────────────────────────────────────────────────────────╮ *pathPATH   The path to the needs.json file[required] ids [ID]...Only validate certain need IDs ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ Options ─────────────────────────────────────────────────────────────────────────╮ --helpShow this message and exit. ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ Logging ─────────────────────────────────────────────────────────────────────────╮ --verbose-vShow debug information ╰───────────────────────────────────────────────────────────────────────────────────╯

json-to-kuzu

json-to-kuzu Usage: ubc build json-to-kuzu [OPTIONS] INPUT Convert a needs.json file to a Kuzu database. Note this requires a new-style needs.json, that includes a needs_schema. ╭─ Arguments ───────────────────────────────────────────────────────────────────────╮ *inputPATHThe path to the needs.json file[required] ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ Options ─────────────────────────────────────────────────────────────────────────╮ --output-oPATHThe path to the output Kuzu DB directory [default: needs.kuzu]                    --overwrite--no-overwrite[default: no-overwrite] --helpShow this message and exit. ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ Logging ─────────────────────────────────────────────────────────────────────────╮ --verbose-vShow debug information ╰───────────────────────────────────────────────────────────────────────────────────╯

license

license Usage: ubc license [OPTIONS] COMMAND [ARGS]... Commands for managing licenses ╭─ Options ─────────────────────────────────────────────────────────────────────────╮ --helpShow this message and exit. ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ Commands ────────────────────────────────────────────────────────────────────────╮ activate Activate the current license.                                          clean    Clear the ublicense cache.                                             hash     Show hash for a given user e-mail.                                     show     Show information for the current license.                              ╰───────────────────────────────────────────────────────────────────────────────────╯

activate

activate Usage: ubc license activate [OPTIONS] Activate the current license. ╭─ Options ─────────────────────────────────────────────────────────────────────────╮ --key-kTEXTThe license key to activate, otherwise look in      configuration.                                      [env var: UBCODE_LICENSE_KEY]                       --user-uTEXTThe license user to activate, otherwise look in     configuration.                                      [env var: UBCODE_LICENSE_USER]                      --dev--no-devUse the development product --helpShow this message and exit. ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ Logging ─────────────────────────────────────────────────────────────────────────╮ --verbose-vShow debug information --quiet-qOnly show errors and warnings ╰───────────────────────────────────────────────────────────────────────────────────╯

clean

clean Usage: ubc license clean [OPTIONS] Clear the ublicense cache. This is useful to refresh the license activation before going offline for a while. ╭─ Options ─────────────────────────────────────────────────────────────────────────╮ --helpShow this message and exit. ╰───────────────────────────────────────────────────────────────────────────────────╯

hash

hash Usage: ubc license hash [OPTIONS] Show hash for a given user e-mail. ╭─ Options ─────────────────────────────────────────────────────────────────────────╮ --user-uTEXTUser e-mail to hash. If not provided, look in               configuration.                                              [env var: UBCODE_LICENSE_USER]                              --helpShow this message and exit. ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ Logging ─────────────────────────────────────────────────────────────────────────╮ --verbose-vShow debug information --quiet-qOnly show errors and warnings ╰───────────────────────────────────────────────────────────────────────────────────╯

show

show Usage: ubc license show [OPTIONS] Show information for the current license. ╭─ Options ─────────────────────────────────────────────────────────────────────────╮ --key-kTEXTThe license key to show        information for, otherwise     look in configuration.         [env var: UBCODE_LICENSE_KEY]  --dev--no-devUse the development product --json--no-jsonPrint output as JSON. Implies  --quiet.                       --show-activated--no-show-activatedShow activated machines --helpShow this message and exit. ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─ Logging ─────────────────────────────────────────────────────────────────────────╮ --verbose-vShow debug information --quiet-qOnly show errors and warnings ╰───────────────────────────────────────────────────────────────────────────────────╯