Example

Basic CLI

Helix Console Basic CLI Example
Group
CLI
Path
examples/cli/basic-cli

Overview

Helix Console Basic CLI Example

Run this example from the shared examples build:

Run

Run this example from the shared examples build


./gradlew -p examples runExample -Pexample=cli/basic-cli --init-script "$(pwd)/helix.init.gradle"

What It Shows

  • Helix Console Basic CLI Example

Development

Building the Application

Run the following command to build the application:

Command

Building the Application


./gradlew build --init-script "$(pwd)/helix.init.gradle"

Testing the Application

Run the following command to run the application tests:

Command

Testing the Application


./gradlew test integration --init-script "$(pwd)/helix.init.gradle"

Trying the CLI

Run the full walkthrough with the progress bar:

Run a deterministic non-interactive version that is easy to inspect in CI or tests:

Show the generated help:

Use --prompt-for-name in an interactive terminal to see Prompt, and add --open-docs to let the CLI try to launch the helix-console documentation in your default browser. If you leave off --open-docs in an interactive terminal, the example now also uses Prompt to ask whether it should open the docs for you before it exits.

Command

Trying the CLI


./gradlew run \
  --args="--workspace-name payments-hub --owner developer-experience --profile ENTERPRISE" \
  --init-script "$(pwd)/helix.init.gradle"

Command

Trying the CLI


./gradlew run \
  --args="--workspace-name payments-hub --owner developer-experience --profile ENTERPRISE --color NEVER --skip-progress --prompt-for-name" \
  --init-script "$(pwd)/helix.init.gradle"

Command

Trying the CLI


./gradlew run \
  --args="--help" \
  --init-script "$(pwd)/helix.init.gradle"