docs
Try the demo Get started
Esc
↑↓ moveEnter openEsc close

Install it · 8 of 8

Managing inbuxa from the command line

inbuxa-cli reads and changes everything the console manages, from a terminal or a script, and keeps a server's settings in a file that can be reviewed and applied to another server.

2 min read

On this page

inbuxa-cli does from a terminal what the console does in a browser. It works with domains, accounts, listeners, spam rules, tracers and every other type in the server's registry. It reads the server's own description of those types, so it knows every one the server knows.

It also keeps settings in a file. snapshot writes a server's settings as a plan, and apply makes a server match one. Keep the plan in version control, review a change as a diff, and set up a second server the same way.

Install it

Linux, on amd64 or arm64. Each release carries one archive per architecture and a SHA256SUMS file:

base=https://git.coffeylabs.org/inbuxa/inbuxa-cli/releases/latest/download
curl -fLO "$base/inbuxa-cli-linux-amd64.tar.gz"
curl -fLO "$base/SHA256SUMS"
sha256sum --check --ignore-missing SHA256SUMS
tar -xzf inbuxa-cli-linux-amd64.tar.gz
./inbuxa-cli --version

On arm64, fetch inbuxa-cli-linux-arm64.tar.gz instead.

Sign in

Make an API key in the console under Account › Credentials › API Keys, signed in as an administrator. Give it and the server's address in the environment:

export INBUXA_URL=https://mail.example.com
export INBUXA_API_KEY=API_…
inbuxa-cli types

Without INBUXA_API_KEY, inbuxa-cli asks for the key. The server takes a password here only in bootstrap and recovery mode, or with INBUXA_HTTP_BASIC_AUTH=all. There, use --user and the password in INBUXA_PASSWORD.

Look and change

Types are named as the console names them: Domain, Account, Http. An object is named by its id or its key, such as a domain's name or an account's address.

inbuxa-cli list Domain
inbuxa-cli describe Account
inbuxa-cli get Domain example.com
inbuxa-cli create Domain name=example.com
inbuxa-cli create Account @type=User name=alice domainId=@x:Domain/example.com
inbuxa-cli update Account alice@example.com description="Alice Liddell"
inbuxa-cli update Http usePermissiveCors=false
inbuxa-cli delete Account alice@example.com

A value that reads as JSON is JSON; anything else is a string. @x:Domain/example.com stands for that domain's id. Settings are applied on the running server after each change. A store's settings take effect when the server restarts, and inbuxa-cli says so.

Keep settings in a file

inbuxa-cli snapshot -o server.json
inbuxa-cli apply server.json --dry-run
inbuxa-cli apply server.json

A plan names objects by key and refers to other objects as @x:Domain/example.com, so it isn't tied to one server's ids. apply changes only the properties a plan names, and creates objects in the order their references need.

Secrets aren't in a snapshot

The server never shows a password, API key or DNS provider credential, so a snapshot has none. Add them to a plan by hand. apply writes them when it creates an object, and to existing objects only with --write-secrets.

--prune also deletes objects of the plan's types that the plan leaves out. Run it with --dry-run first.

The full reference is in the README.