AlmaForge CLI Reference
This page covers the two AlmaForge command-line binaries:
almais the user CLI. Use it for login, resource access, configuration, admin tasks, and audit workflows. RBAC determines what each user can see and do.almadis the server daemon. It runs the Auth, Proxy, and resource services.
For installation, sign-in, shell completion, and the kubectl-style
day-to-day workflow, see the CLI guide. This page is
the reference for common commands and their flags. Use
alma <command> --help for the complete list in your installed version.
alma
alma is the user-facing CLI for day-to-day cluster access and
administration. The flags below are accepted by every alma subcommand.
Subcommand-specific flags are documented alongside each command.
Global flags
| Flag | Description |
|---|---|
--proxy | Proxy address. |
--ttl | Minutes-to-live for the issued session. |
-i, --identity | Identity file to use instead of the local profile. Place this global flag before exec. |
-d, --debug | Verbose logging to stdout. |
--auth-server | Address of the Auth Service to connect to directly, bypassing the Proxy. Uses the local admin identity from --data-dir, which has a default path. |
--data-dir | Path to the data directory holding the local admin identity (default /var/lib/almaforge). |
-o, --format | Output format: text, json or yaml. Accepted by every command that prints a result. |
Output format
A command defaults to text (the table a person reads), whether output
goes to a terminal or into a pipe. When an AI agent spawns the process
(AI_AGENT, AGENT, or a known agent harness variable), the default
switches to json. -o names the format explicitly and always wins.
Set ALMA_FORMAT to pin the default for a whole shell or service:
export ALMA_FORMAT=jsonalma ls | jq '.[0].metadata.name'Failures
A command that fails writes its reason to standard error and leaves a status
that says what kind of failure it was. Output on standard output is always the
result, never an error. (alma exec and alma ssh pass
through the remote command's exit status directly without a JSON error
envelope.)
| Status | Meaning |
|---|---|
0 | Success. |
1 | Failed for a reason without a more specific status. |
2 | The command or its flags were wrong. |
3 | No credentials, or they expired. Run alma login. |
4 | Authenticated, but not permitted. Ask for access with alma request create. |
5 | The named resource does not exist. |
6 | It already exists, and the command would have replaced it. |
7 | The cluster could not be reached. |
Ask for json or yaml output and the failure is structured too, so nothing
has to read the prose:
{
"error": {
"code": "unauthenticated",
"message": "not logged in, run:\n$ alma login --proxy=example.com:443",
"hint": "Run 'alma login', or ask the operator to run it for you."
}
}
code is one of failure, bad_parameter, unauthenticated,
access_denied, not_found, already_exists or connection_problem, paired
with the status of the same meaning above. hint says what to try next and is
omitted when there is nothing useful to say.
Authentication
alma login
Log in to a cluster and receive a certificate.
alma login [flags] [cluster]
| Flag | Description |
|---|---|
--ca-pin | sha256:<hex> pin of the CA the Proxy presents, such as its self-signed certificate. Repeatable. The Proxy is trusted when that CA matches a pin, and the profile keeps the pins for later commands. Env: ALMA_CA_PIN. |
--request-roles | Request one or more extra roles |
--request-reason | Reason for requesting additional roles |
--request-reviewers | Suggested reviewers for role request |
--request-nowait | Finish without waiting for request resolution |
--request-id | Login with the roles requested in the given request, named by ID or a unique prefix |
--browser | Open a browser during login (default). Use --no-browser to print a sign-in URL for another device. This is a Boolean flag. A following value is treated as the cluster name. |
--breakglass | Create a one-time recovery link with the local admin identity. Must run on an Auth host. Ignores every other login flag. |
--kube-cluster | Name of the Kubernetes cluster to login to |
-v, --verbose | Show extra status information |
alma logout
Log out of the current cluster, removing local certificates.
alma logout
alma status
Show the current session and cluster status.
alma status [flags]
| Flag | Default | Description |
|---|---|---|
-o, --format | text | Output format: text, json, yaml |
-v, --verbose | Show extra detail |
Resource Configuration (CRUD)
These commands follow kubectl conventions and work across resource types. RBAC determines which resources each user can manage.
alma get
List resources or show one resource.
alma get <kind> [name] [flags]
alma get <kind>/<name> [flags]
alma get all
| Flag | Default | Description |
|---|---|---|
-o, --format | text | Output format: text, yaml, json |
-v, --verbose | Full label output | |
--with-secrets | false | Include secrets (CAs, connectors) |
--search | Fuzzy search keywords | |
--query | Predicate language filter |
Resource kinds & listing aliases
AlmaForge provides Kubernetes-style get commands alongside familiar listing shortcuts:
| Resource Kind | List Command | Accepted Aliases |
|---|---|---|
| Servers | alma get server | alma get servers, alma node ls, alma ls |
| Databases | alma get db | alma get databases, alma db ls |
| Kubernetes | alma get kube | alma get kubernetes, alma kube ls |
| Applications | alma get app | alma get apps, alma app ls |
| Access requests | alma get request | alma get requests, alma request ls |
| Active sessions | alma get session | alma kube sessions, alma get sessions |
| Recordings | alma get recording | alma get recordings, alma recording ls |
| Alerts | alma get alert | alma get alerts, alma alert ls |
| Tokens & Bots | alma get token, alma get bot | alma get tokens, alma get bots |
Additional resource kinds include role, user, lock, connector (auth connectors), AuthConfig, NetworkConfig, RecordingConfig, and more. Run alma get --help for the full list.
List servers
List servers. node remains an accepted kind alias.
alma get server [flags] [labels]
alma get servers [flags] [labels]
alma node ls [flags] [labels]
alma ls [flags] [labels]
Resource filtering
Listing commands such as alma get server, alma get db, alma get app, and
alma get kube accept --search and --query flags to filter results.
--search runs a fuzzy match against resource fields. For example,
--search=mac matches any resource containing mac.
--query accepts a predicate expression for precise filtering on labels and
fields.
You can combine both with a trailing comma-separated label selector.
# List all nodesalma node ls
# List nodes by labelalma node ls env=staging,os=mac
# Fuzzy search across fieldsalma node ls --search=staging,mac
# Predicate query on labelsalma node ls --query='labels["env"] == "staging" && equals(labels["os"], "mac")'alma apply
Create or update a resource, like kubectl apply.
alma apply -f resource.yaml
alma apply resource.yaml # positional filename also accepted
| Flag | Description |
|---|---|
-f, --filename | Resource definition file (stdin if omitted) |
The filename can be passed as a positional argument or with -f.
alma update
Patch resource metadata fields.
alma update <kind>/<name> [flags]
| Flag | Description |
|---|---|
--set-labels | Replace labels with a comma-separated key=value list |
--set-ttl | Set resource TTL |
alma create
Create a resource. The command fails if the resource already exists. Use
apply to overwrite an existing resource.
From a file:
alma create -f resource.yaml
Imperative shortcuts:
| Command | Description |
|---|---|
alma create token --services=<services> | Create an invitation token |
alma create bot <name> --roles=<roles> | Create a certificate renewal bot |
alma delete
Delete a resource.
alma delete <kind> <name>
alma delete <kind>/<name>
Aliases: alma rm, alma del
alma edit
Open a resource in $EDITOR and apply changes on save.
alma edit <kind>/<name>
alma explain
List supported resource kinds or describe the fields of a kind or nested field path.
alma explain [kind[.field...]] [flags]
| Flag | Default | Description |
|---|---|---|
-o, --format | text | Output format: text, json, yaml |
alma explainalma explain role.spec.allowResource Access
alma exec
Open a session or run a command on a resource you can access. Address the
resource as kind/name or as kind name. Put the target first, followed by
flags, and native-client arguments after --.
alma exec KIND/NAME [-u USER] [--db-name NAME] [-- ARGS...]
| Kind | Behavior |
|---|---|
server | Open the account's login shell, or execute the command after -- over SSH. |
db | Launch the local database client, such as psql, mariadb, mongosh, or valkey-cli. Arguments after -- go to that client. |
kube | Run local kubectl with a temporary kubeconfig for the target cluster. Arguments after -- are required. |
app | Use port-forward app/NAME to connect a native client. |
node, nodes, and servers are aliases for server. Database aliases
include database, dbs, and databases. Kubernetes accepts k8s and
kubernetes, and apps accept application, apps, and applications.
For servers, a short name such as server/web1 matches web1.example.com
when exactly one server has that first DNS label. Exact hostnames and server
IDs take precedence. If several servers match, the error lists them. This
also applies to server port forwarding. Database, app, and Kubernetes names
stay exact.
| Flag | Description |
|---|---|
-u, --user | SSH login for a server or database account for a database. Other kinds reject this flag. |
--db-name | Database name. Only accepted for db. |
Omitting --user uses the resource's existing default. Servers use the
local OS user if it appears in the saved profile, otherwise the profile's
first login. Use --user to select an account allowed on the target server.
Databases reuse
an allowed saved route or choose an unambiguous allowed account, including
an automatically provisioned account when configured.
Stdin is always attached. Server sessions allocate a PTY only when both stdin and stdout are terminals. Pipes and scripts keep stdout and stderr separate. Database clients and kubectl inherit your terminal. The command returns the remote or native client's exit status.
alma exec server/web1alma exec server/web1 --user=ubuntu -- uptimeprintf 'hello\n' | alma exec server/web1 -- catalma exec db/postgres --db-name=orders -- -c 'select 1'alma exec db/postgres < schema.sqlalma exec kube/prod -- get podsalma exec kube/prod -- exec -it web-0 -- shKubernetes execution requires kubectl on your PATH. The local proxy and
private temporary kubeconfig last for that command and are removed when it
exits. Your default kubeconfig stays unchanged.
alma port-forward
Open an authenticated tunnel and keep it running until interrupted.
alma supplies the cluster credentials. Point a native client at the
printed local address. Kubernetes tools use the printed KUBECONFIG.
alma port-forward KIND/NAME [--address ADDR] [-u USER] [--db-name NAME] [[LOCAL:]REMOTE...]
Legacy proxy aliases
Aliases for alma port-forward:
alma proxy db <name>(alias foralma port-forward db/<name>)alma proxy app <name>(alias foralma port-forward app/<name>)alma proxy kube <name>(alias foralma port-forward kube/<name>)
For native OpenSSH, alma proxy ssh is invoked by the ProxyCommand configuration generated by alma config (see server access).
| Port argument | Meaning |
|---|---|
5432 | Listen on local port 5432 and forward to remote port 5432. |
15432:5432 | Listen on local port 15432 and forward to remote port 5432. |
:5432 or 0:5432 | Choose a free local port and forward to remote port 5432. |
For databases, apps, and Kubernetes, omit the port to try the resource's remote port locally. If that port is busy or requires privileges you do not have, the command chooses a free port and prints it. The remote port comes from the resource URI, or its protocol default when the URI omits a port. Kubernetes uses port 443.
An explicit port argument disables that automatic choice. Databases, apps,
and Kubernetes accept one pair, and its remote port must match the resource.
A server requires at least one pair and accepts multiple pairs. Each forwards
to its own localhost:REMOTE, without starting a shell.
| Flag | Default | Description |
|---|---|---|
--address | localhost | Bind to localhost or a specified IP address. |
-u, --user | Resource default | SSH login or database account. Accepted for server and db. |
--db-name | Resource default | Database name. Accepted for db. |
alma port-forward db/postgresForwarding from 127.0.0.1:5432 -> 5432psql postgres://alice@localhost:5432/ordersalma port-forward server/web1 8080:80 9090alma port-forward app/echoalma port-forward kube/prodUse the printed address, which may differ from the default port. Database tunnels also print a client command with the selected account and database.
Server access (SSH)
Connect to servers using interactive SSH, run remote commands, copy files, or forward local ports.
| Command | Description |
|---|---|
alma get serveralma ls | List accessible servers (alias: alma node ls) |
alma ssh [user@]host | Start an interactive SSH session |
alma scp src dest | Copy files to or from a remote server |
alma exec server/NAME | Run remote command over SSH |
alma port-forward server/NAME | Forward ports to server |
alma ssh
alma ssh [flags] [user@]host [command...]
| Flag | Description |
|---|---|
-l, --login | Remote host login |
-p, --port | SSH port on the remote host |
-A, --forward-agent | Forward SSH agent |
-L, --forward | Local port forwarding (local:remote) |
-D, --dynamic-forward | SOCKS5 dynamic forwarding |
-t, --tty | Force TTY allocation |
--local | Execute command on localhost after connecting to SSH node |
-N, --no-remote-exec | No remote command (port forwarding only) |
-c, --cluster | Target cluster |
-X, --x11-untrusted | Untrusted X11 forwarding |
-Y, --x11-trusted | Trusted X11 forwarding |
--x11-untrusted-timeout | Timeout for untrusted X11 forwarding |
--request-reason | Reason for automatic access request |
--disable-access-request | Disable automatic resource access requests |
--log-dir | Directory for per-node command output logs |
alma scp
Copy files to or from a remote node.
alma scp [flags] src dest
| Flag | Description |
|---|---|
-l, --login | Remote host login |
-r, --recursive | Recursive copy |
-P, --port | Remote port |
-p, --preserve | Preserve timestamps |
-q, --quiet | Quiet mode |
-c, --cluster | Target cluster |
Database access
Connect to databases with native clients, retrieve short-lived credentials, or open local tunnels for desktop GUI tools.
| Command | Description |
|---|---|
alma get dbalma db ls | List accessible databases |
alma exec db/NAME | Connect directly with native client (psql, mariadb, mongosh) |
alma port-forward db/NAME | Open local tunnel for desktop GUIs (DBeaver, DataGrip, TablePlus) |
alma db login <db> | Retrieve database credentials |
alma db logout [db] | Remove database credentials |
alma db env | Print database environment variables |
alma db config | Print database connection info |
| Flag | Description |
|---|---|
-c, --cluster | Target cluster |
Kubernetes access
Interact with Kubernetes clusters through native kubectl, temporary execution sessions, or local tunnels.
| Command | Description |
|---|---|
alma get kubealma kube ls | List accessible Kubernetes clusters |
alma kube login <cluster> | Configure kubectl context persistently in current shell |
alma exec kube/NAME -- ARGS | Execute kubectl in an isolated temporary session without modifying kubeconfig |
alma port-forward kube/NAME | Open local tunnel for GUI tools (Lens, k9s) |
alma kube credentials | Get kubectl credentials (exec plugin) |
alma kube sessionsalma get session | List active Kubernetes sessions |
Application access
Access internal HTTP web applications and APIs through authenticated local tunnels or short-lived certificates.
| Command | Description |
|---|---|
alma get appalma app ls | List accessible applications |
alma port-forward app/NAME | Open authenticated local tunnel for browser or API clients |
alma app login <app> | Get short-lived app certificate |
alma app logout [app] | Remove app certificate |
alma app config | Print app connection info |
Access Requests
alma request
Manage temporary access requests.
| Command | Description |
|---|---|
alma get requestalma request ls | List access requests |
alma request show <id> | Show request details |
alma request create | Create an access request |
alma request review <id> | Review an access request |
alma request search | Search for requestable resources |
alma request drop | Drop access requests from current identity |
alma request assume <id> | Assume an approved access request |
For recurring credential delivery to files or Kubernetes Secrets, use
alma export -c <file>. See Credential Export.
Audit
alma audit
List audit events, newest first. Use --type to select an event type.
Repeat the flag to include multiple types.
alma audit --last=1h --type=UserLoginalma audit -f -o jsonalma recording
Session recording commands.
| Command | Description |
|---|---|
alma recording lsalma get recording | List recordings |
alma recording play <id>alma play <id> | Replay a recorded session |
The audit and recording listing commands share these options:
| Flag | Description |
|---|---|
-f, --follow | Keep watching for new results until interrupted. |
-o, --format | Output format: text, json, or yaml. Defaults to text. |
--from-utc | Start date in YYYY-MM-DD format, at midnight UTC. Defaults to 24 hours ago. |
--to-utc | End date in YYYY-MM-DD format, at midnight UTC. Defaults to the current time. |
--last | Look back by a duration such as 1h30m. Cannot be combined with date bounds. |
--limit | Maximum number of initial results. Defaults to 50. |
Both commands list the most recent results first. The initial range cannot
exceed 365 days or include future dates. With --follow, omit --to-utc.
The command prints up to --limit initial results and then continues with
new arrivals. Use --limit=0 to follow without printing existing history.
alma recording ls --last=1h -o jsonalma recording ls -f --limit=0Following checks for new results every five seconds, including records that arrive late. JSON output consists of successive arrays, one per batch. YAML output uses separate documents. Query work and memory grow with the number of records in the selected range.
Admin
Tokens
Invitation tokens for enrolling agents.
| Command | Description |
|---|---|
alma create token --services=<services> | Create an invitation token |
alma get token | List tokens |
alma delete token/<name> | Remove a token |
Bots
Certificate renewal bots.
| Command | Description |
|---|---|
alma create bot <name> --roles=<roles> | Create a bot and print its enrollment command |
alma get bot | List bots with the user and roles behind each one |
alma delete bot/<name> | Remove a bot, along with the role created with it |
alma create lock
Create a new cluster lock to disable a user, role, login, request, or server.
alma create lock [flags]
| Flag | Description |
|---|---|
--target-user | User to disable |
--role | Role to disable |
--target-login | Local UNIX user to disable |
--access-request | Access request UUID to disable |
--server-id | Server UUID to disable |
--message | Message for locked-out users |
--expires | Lock expiry (RFC3339) |
--lock-ttl | Lock TTL duration |
alma auth
Certificate authority operations.
| Command | Description |
|---|---|
alma auth export | Export public CA keys |
alma auth sign | Create identity file(s) for a user |
alma auth rotate | Rotate certificate authorities |
alma auth ls | List connected auth servers |
alma auth crl | Export certificate revocation list |
alma auth pin | Print the CA pins used to verify the Auth Service during a join |
alma get instance
| Command | Description |
|---|---|
alma get instance | List the instances registered with the cluster |
alma alert
Cluster alert management.
| Command | Description |
|---|---|
alma alert lsalma get alert | List alerts |
alma alert create <message> | Create a cluster alert |
alma alert ack <id> | Acknowledge an alert |
alma alert ack ls | List acknowledged alerts |
alma get cluster
Show the cluster you are connected to.
alma get cluster [flags]
| Flag | Default | Description |
|---|---|---|
-o, --format | text | Output format: text, yaml, json |
Misc
alma version
Print the client and server version.
alma version [flags]
| Flag | Default | Description |
|---|---|---|
-o, --format | text | Output format: text, json, yaml |
--client | Client version only (no server required) |
alma install skill
Install the AI agent skill (SKILL.md) into ~/.agents/skills/almaforge/SKILL.md and symlink ~/.claude/skills/almaforge, or write it to stdout or a single file.
alma install skill [flags]
| Flag | Default | Description |
|---|---|---|
-o, --output | Write to stdout (-o=stdout) or a file (-o=file:///path) | |
--project | false | Install into the current directory instead of $HOME |
alma install mcp
Register alma as a Model Context Protocol (MCP) server with every supported agent CLI found on this host: claude, codex, agy, opencode, pi, and copilot.
alma install mcp [flags]
| Flag | Default | Description |
|---|---|---|
--print | false | Print the configuration block instead of registering |
Each client is configured through its own mcp add subcommand, and the command prints what it ran:
alma install mcpclaude mcp add --scope user almaforge -- /usr/local/bin/alma mcpAdded stdio MCP server almaforge with command: /usr/local/bin/alma mcp to user configFile modified: /root/.claude.jsoncodex mcp add almaforge -- /usr/local/bin/alma mcpAdded global MCP server 'almaforge'.# Restart your agent client to pick up the new server.Registration is host-wide, writes only to the invoking user's own configuration files, and needs no elevated privileges. Rerunning the command replaces an existing entry, which is how an upgrade that moves the binary takes effect.
For a client this command does not know, use --print and copy the block into that client's own configuration:
alma install mcp --print{ "mcpServers": { "almaforge": { "args": [ "mcp" ], "command": "/usr/local/bin/alma" } }}alma mcp
Run a local Model Context Protocol (MCP) server over stdio using your existing profile. Agent clients start this themselves once alma install mcp has registered it, so it is rarely run by hand.
alma mcp
alma get license
Show license status and current usage.
alma get license
almad
almad is the AlmaForge server daemon. One binary runs every cluster
service: Auth, Proxy, SSH Node, Database, Application, Kubernetes, and
the built-in access-request plugins. Role flags, environment variables,
and resource files decide which services start.
almad does not have process-wide global flags. Each
subcommand defines its own flags. almad start carries the
longest flag list. Run almad <command> --help to inspect
the exact flags for a subcommand.
Commands
| Command | Purpose |
|---|---|
almad start | Run almad in the foreground with services selected by service flags, environment variables, or resource files. |
almad status | Print the active SSH session metadata when invoked from inside an almad SSH session. |
almad version | Print the binary version. Add --raw for the bare version string. |
almad install systemd | Render a systemd unit file for almad. |
almad install script | Render a shell script that installs an agent on a fresh node. |
almad join openssh | Enroll an existing OpenSSH server into the cluster without running the daemon. |
Run almad <command> --help for the full flag list of any subcommand.
Starting a cluster
Set environment variables or place resource files under /etc/almaforge/almad.d,
run the daemon, and optionally wire it into systemd. Use this flow to
bring up a new Auth/Proxy or run almad as a long-lived service
on any node.
almad start
almad start runs in the foreground and exits when interrupted. For
production deployments, put resource files in /etc/almaforge/almad.d and set daemon
defaults in the environment. The CLI flags below are most useful for
bootstrapping and one-off invocations.
General
| Flag | Default | Description |
|---|---|---|
-d, --debug | Verbose stderr logging. Env: ALMA_DEBUG. | |
--log-level | info | Log severity: debug, info, warn, error. Env: ALMA_LOG_LEVEL. |
--log-output | stderr | Log destination: stderr, stdout, syslog, or a file path. Env: ALMA_LOG_OUTPUT. |
--log-format | text | Log line format: text for human-readable output, json for one JSON object per line. Env: ALMA_LOG_FORMAT. |
--config-dir | /etc/almaforge/almad.d | Path to the config directory or file. Loaded on every start to apply typed resources (StorageConfig, roles, tokens, etc.). Env: ALMA_CONFIG_DIR. |
--data-dir | /var/lib/almaforge | Directory for local state and the embedded SQLite store. Env: ALMA_DATA_DIR. |
--pid-file | Write the process PID to this path. | |
-t, --test | Resolve the configuration and exit without starting any service. | |
--license-file | Path to the AlmaForge license file. Env: ALMA_LICENSE_FILE. | |
--permit-user-env | Read environment variables from ~/.ssh/environment, the OpenSSH PermitUserEnvironment file, when starting a session. |
Services
| Flag | Description |
|---|---|
--auth-service | Run the Auth service. --no-auth-service turns it off. Env: ALMA_AUTH_SERVICE. |
--proxy-service | Run the Proxy service. --no-proxy-service turns it off. Env: ALMA_PROXY_SERVICE. |
--ssh-service | Run the SSH Node service. --no-ssh-service turns it off. Env: ALMA_SSH_SERVICE. |
--database-service | Run the Database service. --no-database-service turns it off. Env: ALMA_DATABASE_SERVICE. |
--app-service | Run the Application service. --no-app-service turns it off. Env: ALMA_APP_SERVICE. |
--kubernetes-service | Run the Kubernetes service. --no-kubernetes-service turns it off. Env: ALMA_KUBERNETES_SERVICE. |
--jira-service | Run the built-in Jira access-request plugin. --no-jira-service turns it off. Env: ALMA_JIRA_SERVICE. |
--slack-service | Run the built-in Slack access-request plugin. --no-slack-service turns it off. Env: ALMA_SLACK_SERVICE. |
--pagerduty-service | Run the built-in PagerDuty plugin. --no-pagerduty-service turns it off. Env: ALMA_PAGERDUTY_SERVICE. |
--telegram-service | Run the built-in Telegram plugin. --no-telegram-service turns it off. Env: ALMA_TELEGRAM_SERVICE. |
Cluster join
| Flag | Description |
|---|---|
--auth-server | Address of the Auth Service, for a Proxy joining an Auth fleet. An agent cannot use it: agents open no port and are reached through a tunnel they hold to a Proxy. Env: ALMA_AUTH_SERVER. |
--proxy | Address of the Proxy Service. What every agent joins with. Env: ALMA_PROXY. |
--client-id | Resource name (metadata.name) of the provisioning Token, or a path to a file containing it. Env: ALMA_CLIENT_ID. |
ALMA_CLIENT_SECRET | Plaintext shared secret for the static join method. Environment-only (no CLI flag), keeping the value out of command-line arguments. |
--ca-pin | sha256:<hex> pin of the Auth Server CA. Repeatable. Used on first join. Env: ALMA_CA_PIN. |
--join-method | Join method: static, aws, ec2, kubernetes, azure, gcp, github, gitlab, circleci, spacelift. Env: ALMA_JOIN_METHOD. |
--nodename | Override the node name (defaults to the host's hostname). Env: ALMA_NODE_NAME. |
--labels | Comma-separated key=value static labels for this node. Env: ALMA_LABELS. |
Networking
--listen is the shared TLS listener: one TLS port that serves every
proxy protocol via SNI/ALPN. It is the only listener bound by default.
Dedicated listener flags can add an entry point or move a protocol to
another port. See how dedicated ports change access.
Each listener is paired with its advertise flag immediately below it.
| Flag | Default | Description |
|---|---|---|
--listen | 0.0.0.0:443 | Shared TLS listener. Bound when the Proxy Service or Auth Service is enabled. Env: ALMA_LISTEN. |
--advertise | Canonical endpoint advertised to clients (alma.example.com:443). Used for SSO redirects, ACME, and as the fallback for every --*-advertise override. Env: ALMA_ADVERTISE. | |
--kube-listen | Optional dedicated kube SNI port. The kube SNI route on the shared TLS listener is on by default. Set this only to add a separate listener. Env: ALMA_KUBE_LISTEN. | |
--kube-advertise | Override for alma kube login config server URL. Env: ALMA_KUBE_ADVERTISE. | |
--tunnel-listen | Optional dedicated reverse tunnel port. Env: ALMA_TUNNEL_LISTEN. | |
--tunnel-advertise | Override for agent reverse-tunnel reconnect URL. Env: ALMA_TUNNEL_ADVERTISE. | |
--mysql-listen | Optional native MySQL wire-protocol port. Env: ALMA_MYSQL_LISTEN. | |
--mysql-advertise | Override for MySQL client connection display. Env: ALMA_MYSQL_ADVERTISE. | |
--postgres-listen | Optional native Postgres wire-protocol port. Env: ALMA_POSTGRES_LISTEN. | |
--postgres-advertise | Override for Postgres client connection display. Env: ALMA_POSTGRES_ADVERTISE. | |
--mongo-listen | Optional native Mongo wire-protocol port. Env: ALMA_MONGO_LISTEN. | |
--mongo-advertise | Override for Mongo client connection display. Env: ALMA_MONGO_ADVERTISE. | |
--ssh-listen | Optional dedicated proxy SSH port (alma ssh raw-SSH path). Configures the Proxy Service ingress, not the SSH Node service. Env: ALMA_SSH_LISTEN. | |
--ssh-advertise | Override for the proxy's SSH ingress public address. Env: ALMA_SSH_ADVERTISE. | |
--peer-listen | Proxy-to-proxy peering listener for HA proxy clusters. Env: ALMA_PEER_LISTEN. | |
--peer-advertise | Address this proxy advertises to peer proxies. Env: ALMA_PEER_ADVERTISE. | |
--diag-listen | Diagnostics endpoint (/healthz, /readyz, plus /debug/pprof/* under --debug). Also serves /metrics while --metrics-listen is unset. Operator-only. No advertise. Env: ALMA_DIAG_LISTEN. | |
--metrics-listen | Prometheus metrics endpoint (/metrics). Operator-only. No advertise. Env: ALMA_METRICS_LISTEN. | |
--metrics-tls-cert | Certificate the metrics listener presents. Env: ALMA_METRICS_TLS_CERT. | |
--metrics-tls-key | Private key for --metrics-tls-cert. Env: ALMA_METRICS_TLS_KEY. | |
--metrics-client-ca | CA a scraper must present a certificate from. The metrics listener serves mutual TLS or plaintext, so these three go together with --metrics-listen and a subset fails at startup. Env: ALMA_METRICS_CLIENT_CA. | |
--real-ip-from | Networks a client-supplied source address is believed from (comma-separated CIDRs or bare IPs). Empty believes none. Env: ALMA_REAL_IP_FROM. | |
--real-ip-header | proxy_protocol | The one channel a trusted proxy may use to give the client address (proxy_protocol / X-Forwarded-For / X-Real-IP / off). Env: ALMA_REAL_IP_HEADER. |
--proxy-protocol | Whether a PROXY protocol header is required on the multiplex listener (on / off). Unset allows one without requiring it. Believing the address it carries is controlled by --real-ip-from and --real-ip-header. Env: ALMA_PROXY_PROTOCOL. | |
--tls-cert | Path to a TLS certificate for the Proxy. Env: ALMA_TLS_CERT. | |
--tls-key | Path to the matching TLS private key. Set both or neither. Half a pair fails at startup. Without a supplied pair or ACME, the Proxy uses a self-signed certificate. Env: ALMA_TLS_KEY. | |
--tls-reload-interval | How often the Proxy re-reads --tls-cert, for example 1h. Set it to pick up a renewal issued out of band without restarting. Unset loads the certificate once at startup. Env: ALMA_TLS_RELOAD_INTERVAL. | |
--acme | Enable ACME / Let's Encrypt certificate provisioning on the Proxy. Env: ALMA_ACME_ENABLED. | |
--acme-email | Registration email for ACME. Env: ALMA_ACME_EMAIL. | |
--acme-uri | Let's Encrypt production | ACME directory to use. Point it at a staging directory while testing so experiments do not consume the production rate limit, or at a private CA. Env: ALMA_ACME_URI. |
Storage backends
Each flag holds a single URI parsed into a typed StorageConfig. The URI
grammar (schemes, query keys) is documented in
Storage backends → URI format.
| Flag | Description |
|---|---|
--state-uri | Cluster state backend URI. Examples: sqlite:///var/lib/almaforge/backend, postgres://user@host/db, dynamodb://table?region=us-east-1. Env: ALMA_STATE_URI. |
--audit-uri | Audit events sink URI. Examples: dir:///var/lib/almaforge/audit, s3://bucket/events?region=us-east-1, file:///var/log/audit.log. Env: ALMA_AUDIT_URI. |
--recordings-uri | Session recordings storage URI. Examples: dir:///var/lib/almaforge/audit, s3://bucket/prefix?region=us-east-1, gs://bucket/prefix. Env: ALMA_RECORDINGS_URI. |
For multi-sink audit fan-out, use typed StorageConfig documents under
--config-dir instead of the single-URI flag.
CA keystore
Where the Auth Service keeps its CA private keys. Name the driver explicitly: settings for a driver you did not select are a startup error rather than a silent fall back to software keys.
| Flag | Default | Description |
|---|---|---|
--ca-keystore | software | Keystore driver: software, pkcs11 or gcp_kms. Env: ALMA_CA_KEYSTORE. |
--pkcs11-module | Path to the PKCS#11 module. Required for pkcs11. Env: ALMA_PKCS11_MODULE. | |
--pkcs11-slot | Slot number holding the token. Give this or --pkcs11-token-label. Env: ALMA_PKCS11_SLOT. | |
--pkcs11-token-label | Label of the token to use. Give this or --pkcs11-slot. Env: ALMA_PKCS11_TOKEN_LABEL. | |
--pkcs11-pin | PIN for the token. An absolute path is read as a file holding the PIN, which keeps it out of the process environment. Env: ALMA_PKCS11_PIN. | |
--gcp-kms-keyring | Fully qualified GCP KMS keyring name. Required for gcp_kms. Env: ALMA_GCP_KMS_KEYRING. | |
--gcp-kms-protection-level | SOFTWARE | GCP KMS protection level: HSM or SOFTWARE. Env: ALMA_GCP_KMS_PROTECTION_LEVEL. |
OpenTelemetry
OpenTelemetry export has no flags. It is configured with the standard
OTEL_* environment variables, listed in the
environment reference.
Application service
Run almad start --app-service and define AppTarget
resources under /etc/almaforge/almad.d.
The flags below describe a single application on the command line
instead, which is what the join command printed by alma create token --services=app uses. --app-name is required as soon as any of
the others is set.
| Flag | Description |
|---|---|
--app-name | Name of the application to serve. |
--app-uri | Internal address the application is reachable at. |
--app-advertise | DNS name clients reach the application by. Routing is by name on the web proxy port, so a port or a literal IP is rejected. |
Database service
Run almad start --database-service and define
DatabaseTarget resources under /etc/almaforge/almad.d.
The flags below describe a single database on the command line instead,
which is what the join command printed by alma create token --services=database uses. --db-name is what turns them on: without it
the rest are ignored and the service starts with no database.
| Flag | Description |
|---|---|
--db-name | Name of the proxied database. |
--db-protocol | Wire protocol: postgres, mysql, mongodb, cockroachdb, redis, snowflake, cassandra, elasticsearch, opensearch, dynamodb, clickhouse or clickhouse-http. |
--db-uri | Address the database is reachable at. |
--db-ca-cert | Path to the CA certificate the database's own certificate is checked against. |
--db-aws-region | AWS region the database runs in. Required for RDS and Aurora. |
Kubernetes service
| Flag | Description |
|---|---|
--kubeconfig | Path to a kubeconfig used to register external Kubernetes clusters. Env: ALMA_KUBECONFIG. |
Resource matching
| Flag | Description |
|---|---|
--match-labels | Label matcher for dynamically registered databases, applications, and Kubernetes clusters. Env: ALMA_MATCH_LABELS. |
Examples
# Single-node cluster (auth + proxy + node).sudo almad start
# SSH Node joining an existing cluster.sudo ALMA_CLIENT_SECRET=/etc/almaforge/client-secret \ almad start \ --ssh-service \ --no-auth-service \ --no-proxy-service \ --proxy=proxy.example.com:443 \ --client-id=db-prod-1 \ --labels=env=prod,role=db
# App agent joining an existing cluster. The apps it serves come# from AppTarget resources, not from flags.sudo ALMA_CLIENT_SECRET=/etc/almaforge/client-secret \ almad start \ --app-service \ --no-auth-service \ --no-proxy-service \ --proxy=proxy.example.com:443 \ --client-id=billing-appalmad install systemd
Render a systemd unit file for almad. Defaults match the package layout.
| Flag | Description |
|---|---|
--env-file | Path to the environment file. |
--fd-limit | Maximum open file descriptors. |
--binary | Full path to the almad binary. |
-o, --output | Output destination (stdout, file:///path). |
--data-dir | Data directory embedded in the unit. |
almad install script
Render a shell script that installs and joins an agent on a fresh node.
The script is written to almaforge.sh in the current directory. Use
-o stdout to write it to standard output instead, or
-o file:///path to choose another location.
Joining a cluster
Helpers for adding a new node, agent, or service to an existing cluster.
almad join openssh
Enroll an existing OpenSSH server into the cluster without running the almad
daemon. The command writes credentials, updates sshd_config, and (by default)
restarts sshd.
| Flag | Description |
|---|---|
--proxy | Address of the Proxy Service. |
--client-id | Token resource name on the cluster (literal or file path). Pair with ALMA_CLIENT_SECRET for the static method. |
--join-method | static, aws, ec2, kubernetes, azure, gcp, github, gitlab, circleci, or spacelift. |
--openssh-config | Path to the sshd config (default /etc/ssh/sshd_config). |
--data-dir | Directory for local state. |
--restart-sshd | Restart sshd after writing config (default true). |
--sshd-check-command | Command used to validate the new sshd config. |
--sshd-restart-command | Command used to restart OpenSSH. Defaults to systemctl restart on the unit the host installs, sshd.service or ssh.service. |
--labels | Comma-separated key=value labels for the OpenSSH node. |
--address | IP address of this OpenSSH node. |
--additional-principals | Extra principals to include on the certificate. |
Misc
almad status
When invoked from inside a session opened by an almad SSH Node, prints the
session metadata: cluster, user, roles, and certificate expiration. Useful for
debugging RBAC and join behavior.
almad version
Print the binary version. Add --raw for the bare version string (useful in
scripts).
Query Examples
Resource-listing commands accept --query. The flag takes a predicate
expression that is evaluated against each resource. Resources for which the
expression evaluates to true are returned.
Examples:
alma node ls --query 'labels["env"] == "prod"'alma db ls --query 'contains(labels["team"], "platform")'alma app ls --query 'hasPrefix(name, "billing-")'