You can use Tolmo in any CI/CD pipeline without interactive login by setting environment variables. This guide shows how to install the CLI, authenticate with a token, and run commands in automated workflows.Documentation Index
Fetch the complete documentation index at: https://docs.tolmo.com/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before setting up Tolmo in a pipeline, make sure you have:- A Tolmo API token (from your organization settings)
- Your organization slug (shown by
tolmo org list)
Install in CI
Add the following one-liner to your pipeline’s setup step to install the Tolmo CLI:~/.local/bin is not already on your PATH, add it explicitly before invoking tolmo:
Authenticate with Environment Variables
Instead of runningtolmo auth login interactively, set two environment variables and the CLI will authenticate automatically:
| Variable | Description |
|---|---|
TOLMO_API_TOKEN | Your API token — skips interactive login |
TOLMO_ORG_SLUG | Your organization slug — required when using a token |
GitHub Actions Example
The workflow below installs the CLI, adds it to the runner’sPATH via $GITHUB_PATH, and queries open critical findings on every push and pull request.
.github/workflows/security.yml
TOLMO_API_TOKEN and TOLMO_ORG_SLUG as repository or organization secrets in your GitHub settings before running this workflow.
GitLab CI Example
The job below runs the same check inside an Ubuntu image. Variables defined in thevariables block are populated from your GitLab CI/CD variable settings.
.gitlab-ci.yml
TOLMO_API_TOKEN and TOLMO_ORG_SLUG in your GitLab project’s Settings → CI/CD → Variables panel and mark them as masked.
Automation Rules
Follow these rules when running Tolmo commands in automated scripts and pipelines:- Always use
--jsonfor machine-readable output when you need to parse results programmatically. - Use
--org <slug>to override the active organization on a per-command basis without changing global state. - Use
TOLMO_API_TOKENandTOLMO_ORG_SLUGinstead of interactive login — profiles are not available in headless environments. - For
tolmo query -- ghandtolmo query -- aws, the--separator is mandatory. Without it, flags like--regionand--repoare stripped before they reach the underlying CLI.