![]() |
Official command-line interface for the Lerian platform. One binary, lerian, to sign in to the Lerian platform and to deploy AWS infrastructure from the Lerian Terraform templates, with an interactive session for people and plain flags for pipelines.
Status: beta. Command names and flags can still change. See
CHANGELOG.mdfor what moved.
- Purpose β what this is for
- What it does (today) β the command groups, and the safety properties
- How it works β captured output: the session, the preflight, the plan
- Directory layout
- Install β one command, plus packages,
go installand completions - Upgrade β move to the current release in place
- Usage β flags, authentication, infrastructure, the agent, configuration
- Troubleshooting
- Testing & operations
- Development β building, trying a change, commits
- References
Give every Lerian operator one tool for the repeatable parts of running the platform. It replaces the separate lerian-infra binary and the deploy.sh script behind it. It prompts when run in a terminal and never prompts in CI, so the same command works for a person and for a pipeline.
| Command group | What it does | Reference |
|---|---|---|
lerian (no arguments) |
Opens an interactive session: pick a command, run it, pick the next one | docs/interactive-session.md |
lerian auth |
Signs in to the Lerian platform (not AWS) with a named profile | Authentication |
lerian infra |
Drives the Terraform roots of lerian-terraform-foundation on AWS, from bootstrap to per-product services | docs/infra.md |
lerian agent |
Installs and manages the Lerian agent in a Kubernetes cluster, over Helm | docs/agent.md |
lerian config |
Shows or resets what the CLI remembers on this machine; points kubectl at a cluster, signs in to GitHub | docs/infra.md |
lerian config repo |
Copies what you configured into a repository of your own, with a Makefile and a README | docs/infra.md |
lerian version |
Prints build information | β |
Safety properties worth knowing before you run infra:
- Account guard. Three checks run before anything touches AWS, with no flag to bypass them.
- Dry run.
--dry-runresolves and prints the whole execution plan without a single AWS call. - CI-safe. Outside a terminal nothing is ever asked; a missing flag is named in the error.
- Yours to leave.
lerian config repowrites everything you configured into a repository of your own β a copy, not a link, that the CLI never comes back to.
Output captured from a build of develop, trimmed and with paths shortened. Account ids and addresses are placeholders. The account picker is copied from docs/infra.md, not captured.
lerian with nothing after it, in a terminal, opens a session: it offers the commands, runs the one you pick, and asks again when it is done. q closes it. Piped, redirected or in CI it prints its help instead, so scripts never wait on a prompt. More in docs/interactive-session.md.
βββ βββββββββββββββ βββ ββββββ ββββ βββ ββββββββββ βββ
βββ ββββββββββββββββββββββββββββββββ βββ βββββββββββ βββ
βββ ββββββ βββββββββββββββββββββββββ βββ βββββββββ βββ βββ
βββ ββββββ βββββββββββββββββββββββββββββ βββββββββ βββ βββ
βββββββββββββββββββ βββββββββ ββββββ ββββββ βββββββββββββββββββ
βββββββββββββββββββ βββββββββ ββββββ βββββ ββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββ development build
What do you want to do?
ββ move Β· enter choose Β· r back Β· q cancel
β― auth Sign in to the Lerian platform (not AWS)
config Show or reset what this tool remembers
infra Deploy the AWS stacks of lerian-terraform-foundation
version Print version information
lerian config reads files only and makes no AWS call, so it works offline. It groups what it finds by who owns it: this tool, the templates checkout, AWS, and the tools it shells out to.
$ lerian auth login --api-url https://api.lerian.studio --api-key $KEY --tenant-id $TENANT
Successfully logged in to profile 'default'
$ lerian config
==> This tool
config ~/.lerian/config.yaml
profile default (Lerian platform, not AWS)
logins default
==> Templates
checkout none found β lerian infra init --clone
==> AWS
config ~/.aws/config
profiles none β aws configure sso, or credentials in the environment
whether they work is an AWS call: lerian infra check makes it
==> Tools
terraform /usr/local/bin/terraform
aws /usr/bin/aws
git /usr/bin/git
lerian infra check reports every missing dependency in one pass, without touching AWS, so it doubles as a CI gate.
$ lerian infra check --repo ~/lerian-terraform-foundation
==> Environment check
ok aws /usr/bin/aws
ok terraform /usr/local/bin/terraform
ok git /usr/bin/git
ok templates ~/lerian-terraform-foundation @ untagged (--repo)
4 checks, all ok. No AWS call was made.
lerian infra init writes the files a fresh checkout needs. In a terminal it asks for what it cannot discover; in CI every answer is a flag. --dry-run shows what would be written and writes nothing.
$ lerian infra init --repo ~/lerian-terraform-foundation --env dev --profile '' --region us-east-2 --account 123456789012 \
--targets infra-base --api-cidr 203.0.113.7 --dry-run
==> Configuration
environment dev
account 123456789012
profile <ambient credentials>
region us-east-2
api access 203.0.113.7/32
datastores dedicated
==> Files
FILE ACTION WHAT IT IS
examples/aws/environments.conf created which AWS account this environment may touch
examples/aws/infra-base/vpc/envs/dev.tfvars created foundation
examples/aws/infra-base/eks/envs/dev.tfvars created foundation
examples/aws/bootstrap/envs/dev.tfvars created state backend
dry run β nothing was written
--dry-run resolves the order, the state keys and the account, and makes no AWS call at all.
$ lerian infra --repo ~/lerian-terraform-foundation --env dev --target bootstrap,infra-base --dry-run
==> Preflight
templates ~/lerian-terraform-foundation @ untagged (--repo)
environment dev
account 123456789012 (declared in examples/aws/environments.conf)
region us-east-2
backend MISSING β run --target bootstrap --action apply
target bootstrap,infra-base
action plan
==> Execution plan (dry run β no AWS call was made)
stage 1: bootstrap
bootstrap local state, workspace=dev
stage 2: infra-base/vpc
infra-base/vpc aws/infra-base/vpc/terraform.tfstate
stage 3: infra-base/eks
infra-base/eks aws/infra-base/eks/terraform.tfstate
ok all 3 stack(s) ready
Run lerian infra in a terminal without --env and it asks. The account is the question that matters, so the region is named beside it and the environment is not asked at all.
Which AWS account?
Everything is created there. The state backend and the sizing follow from it.
β― lerian-sandbox account 524121347244 Β· us-east-2
default session expired β choose to log in
other-profile account 239025757440 Β· not set up here yet β choosing it sets it up
sign in as someone else ends the session for every AWS tool on this machine
.
βββ README.md # this file
βββ cmd/
β βββ lerian/ # main entrypoint
β βββ auth/ # lerian auth login / logout
β βββ infra/ # lerian infra
βββ internal/
β βββ config/ # ~/.lerian/config.yaml, profiles, reset
β βββ infra/ # Terraform orchestration, account guard, tfvars
β βββ infracli/ # terminal face of infra: wizard, prompts, check, init
β βββ output/ # table / json / yaml printer
β βββ version/ # build identity
βββ docs/ # command references, CI/CD, testing strategy
βββ scripts/install.sh # release installer
βββ scripts/upgrade.sh # in-place upgrade to the current release
βββ Makefile
βββ .goreleaser.yml / .releaserc.yml # release pipeline
βββ .github/workflows/ # pr-validation, release, routine
The installer downloads the latest release through the GitHub CLI, so it needs gh installed and authenticated with access to this repository.
curl -fsSL https://raw.githubusercontent.com/LerianStudio/lerian-cli/main/scripts/install.sh | shIt installs the latest release, verifies the checksum, writes to
~/.local/bin, and says so if that is not on your PATH. A -beta is something
to ask for by name.
It works out the platform from uname, so there is nothing to pass: Linux
(x86_64, arm64, armv7) and macOS (x86_64, arm64). Anything else
stops with Unsupported operating system rather than downloading the wrong
archive β see Windows below.
Options:
# A specific version, release or pre-release
curl -fsSL https://raw.githubusercontent.com/LerianStudio/lerian-cli/main/scripts/install.sh | sh -s -- --version v1.3.0
# Somewhere else (default: ~/.local/bin)
curl -fsSL https://raw.githubusercontent.com/LerianStudio/lerian-cli/main/scripts/install.sh | INSTALL_DIR=/usr/local/bin sh
# The newest pre-release instead of the newest release
curl -fsSL https://raw.githubusercontent.com/LerianStudio/lerian-cli/main/scripts/install.sh | INCLUDE_PRERELEASE=1 shVerify:
lerian versionOther installation methods
Manual download β the archives are named after the project, lerian-cli_*,
and hold a binary called lerian.
# Linux x86_64 β swap for Linux_arm64, Darwin_arm64 or Darwin_x86_64
gh release download --repo LerianStudio/lerian-cli --pattern "lerian-cli_*_Linux_x86_64.tar.gz"
tar -xzf lerian-cli_*_Linux_x86_64.tar.gz
sudo mv lerian /usr/local/bin/Linux packages β one per architecture, so name the one you want rather than downloading all of them.
# Debian/Ubuntu
gh release download --repo LerianStudio/lerian-cli --pattern "lerian-cli_*_linux_x86_64.deb"
sudo dpkg -i lerian-cli_*_linux_x86_64.deb
# RHEL/Fedora
gh release download --repo LerianStudio/lerian-cli --pattern "lerian-cli_*_linux_x86_64.rpm"
sudo rpm -i lerian-cli_*_linux_x86_64.rpm
# Alpine
gh release download --repo LerianStudio/lerian-cli --pattern "lerian-cli_*_linux_x86_64.apk"
sudo apk add --allow-untrusted lerian-cli_*_linux_x86_64.apkWindows β a binary is published, but neither script installs it: both are
sh, and run under Git Bash they stop at Unsupported operating system rather
than unpack a .zip as if it were a tarball. Download and extract it yourself.
gh release download --repo LerianStudio/lerian-cli --pattern "lerian-cli_*_Windows_x86_64.zip"
Expand-Archive lerian-cli_*_Windows_x86_64.zip -DestinationPath .
# then put lerian.exe somewhere on PATHUpgrading there is the same download again, over the old binary.
Go install β requires Go 1.26+ and access to the private repository via GOPRIVATE.
GOPRIVATE=github.com/LerianStudio/* go install github.com/LerianStudio/lerian-cli/cmd/lerian@latestFrom source β see Development below.
Shell completions
# Bash
lerian completion bash > /etc/bash_completion.d/lerian
# Zsh
lerian completion zsh > "${fpath[1]}/_lerian"
# Fish
lerian completion fish > ~/.config/fish/completions/lerian.fish
# PowerShell
lerian completion powershell > lerian.ps1curl -fsSL https://raw.githubusercontent.com/LerianStudio/lerian-cli/main/scripts/upgrade.sh | shIt replaces the binary where it already is, which is the part that matters:
installing to a second directory leaves two on PATH, the shell picks whichever
comes first, and the upgrade looks as though it did nothing. It follows a symlink
to the real file, verifies the checksum, and keeps the old binary until the new
one is in place β so a failure leaves a working CLI.
# What is installed, what is available β changes nothing
curl -fsSL https://raw.githubusercontent.com/LerianStudio/lerian-cli/main/scripts/upgrade.sh | sh -s -- --check
# A specific version, in either direction
curl -fsSL https://raw.githubusercontent.com/LerianStudio/lerian-cli/main/scripts/upgrade.sh | sh -s -- --version v1.3.0[INFO] Installed: 1.2.1 (/Users/you/.local/bin/lerian)
[INFO] Available: v1.3.0
[OK] Upgraded 1.2.1 β v1.3.0
Like the installer, it moves to the latest release and leaves pre-releases alone unless you name one. Already on that version, it says so and stops.
Installed through a package manager or go install? Upgrade the same way you
installed: dpkg -i the new .deb, or re-run go install.
--configβ config file path (default:$HOME/.lerian/config.yaml)--profile, -pβ Lerian platform profile to use (default:default). Not an AWS profile;lerian infrahas its own.--output, -oβ output format:table,json,yaml(default:table)--help, -hβ help for any command--version, -vβ version information
lerian auth login \
--api-url https://api.lerian.studio \
--api-key YOUR_API_KEY \
--tenant-id YOUR_TENANT_ID
# Named profile
lerian auth login --profile production --api-url ... --api-key ... --tenant-id ...
lerian auth logout# Verify this machine: dependencies, checkout, what it would use (no AWS call)
lerian infra check
# Write the configuration a fresh checkout needs
lerian infra init --env dev
# Resolve and print the execution plan, touching nothing
lerian infra --env dev --target all --dry-run
# Stand up an environment, in order
lerian infra --env dev --target bootstrap --action apply
lerian infra --env dev --target infra-base --action apply
# Copy what you configured into a repository of your own
lerian config repo ~/infrastructureRun with no --env in a terminal and it asks instead. lerian infra --help has every flag, the ordering rules and the environment variables it reads. Full walkthrough: docs/infra.md.
# Install into the cluster kubectl points at
lerian agent install --control-plane https://cp.example.com --token lerian_enroll_...
# Or without the credential ever passing through the CLI
lerian agent install --control-plane https://cp.example.com --existing-secret agent-creds
# What is installed, and what it is running
lerian agent status
# Move to another chart version, keeping every other value
lerian agent upgrade --chart-version 1.0.2The agent connects outward to the Lerian control plane and runs the Helm operations it is given; nothing reaches into the cluster from outside. It installs into whatever cluster your kubeconfig points at, so it does not have to be one this CLI created β and the menu at the end of a cluster deploy offers the same installation for the cluster just built. Full reference: docs/agent.md.
Everything the CLI remembers lives in one file, ~/.lerian/config.yaml: where the templates checkout is, and the profiles lerian auth login creates.
lerian config # what it has written down, and where
lerian config reset # forget it, as if the CLI had never run herecurrent-profile: default
profiles:
default:
api-url: https://api.lerian.studio
api-key: ***
tenant-id: your-tenant-uuid-here
production:
api-url: https://api.lerian.studio
api-key: ***
tenant-id: prod-tenant-uuidreset removes that file and nothing else. ~/.aws and the templates checkout are never touched unless you ask for the checkout to be deleted.
LERIAN_TF_REPOβ path to the lerian-terraform-foundation checkout, for this shell.LERIAN_NO_BANNER=1β turns the session banner off.NO_COLOR,TERM=dumbβ honored throughout; no color, no animation.
Cannot connect to the Lerian API
curl https://api.lerian.studio/health
lerian config # which profile and file are in use
lerian auth login401 Unauthorized β the API key or tenant ID in the active profile is wrong. Run lerian config to see which profile is active, then lerian auth login again with the right values.
lerian infra fails before it starts β run lerian infra check. It reports every missing dependency in one pass and makes no AWS call.
docs/testing-strategy.mdβ test approach and layout.docs/ci-cd/README.mdβ the three workflows, thetier-1channel and the change gates.
make test # all tests with -race and coverage
make test-unit # fast tests only
make test-race # race detector
make lint # golangci-lintPull requests to develop and main run PR validation (lint, tests, coverage gate, title scope check). Pushes to those branches cut the release. The release workflow also lists release-candidate, which is configured but does not exist yet.
Requirements: Go 1.26+, Make.
git clone https://github.com/LerianStudio/lerian-cli.git
cd lerian-cli
make build # β build/bin/lerian
make testmake dev builds the working tree as lerian-dev, next to the installed release instead of over it:
make dev
lerian version # whatever was installed from the releases page
lerian-dev version # whatever is checked out right now
make dev-uninstall # when you are doneBoth live in ~/.local/bin. The dev version string carries the branch and a -dirty suffix when the tree has uncommitted work. make install also exists, but it uses go install and creates a second binary called lerian in $GOPATH/bin; prefer make dev.
Commits follow Conventional Commits, and the type decides the release version. PR titles are checked against an allowed scope list (auth, cli, cmd, config, deps, docs, infra, output, tests, and others in pr-validation.yml). See CONTRIBUTING.md.
- Command references:
docs/infra.md,docs/interactive-session.md - CI/CD:
docs/ci-cd/README.md - Terraform templates: lerian-terraform-foundation
- Release history:
CHANGELOG.md - Contributing:
CONTRIBUTING.mdΒ· Security:SECURITY.md(security@lerian.studio) Β·CODE_OF_CONDUCT.md - Issues: GitHub Issues
Apache License 2.0 β Lerian Studio. See LICENSE.
