Skip to content

Getting Started

Build the CLI from the api/ directory:

Terminal window
cd api
make build-cli

The compiled binary is written to:

api/bin/gaard

Run it directly:

Terminal window
./bin/gaard version

If you want gaard available on your PATH, install the built binary into a directory that is already on your shell path.

Authenticate against the default Gaard app:

Terminal window
./bin/gaard login

The command prompts for:

  • A browser sign-in flow

The CLI opens the browser automatically when possible. If it cannot, it prints a URL you can open manually.

After you approve the request in the browser, the CLI creates a personal access token and stores it in the active config file.

To log into a different environment explicitly:

Terminal window
./bin/gaard login --api http://127.0.0.1:8004 --name local

Check the current identity:

Terminal window
./bin/gaard whoami

List configured environments:

Terminal window
./bin/gaard ctx list

Print structured output for automation:

Terminal window
./bin/gaard whoami -o json

Most commands support these global flags:

  • -c, --context to override the context for a single command
  • -t, --tenant to override the tenant for a single command
  • -o, --output to choose table or json
  • --no-color to disable ANSI colors
  • -v, --verbose for verbose logging

The CLI ships with command help:

Terminal window
./bin/gaard --help
./bin/gaard login --help
./bin/gaard ctx --help
./bin/gaard tenant --help