Skip to main content

AlmaForge CLI Reference

This page covers the two AlmaForge command-line binaries:

  • alma is the user CLI. Use it for login, resource access, configuration, admin tasks, and audit workflows. RBAC determines what each user can see and do.
  • almad is 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​

FlagDescription
--proxyProxy address.
--ttlMinutes-to-live for the issued session.
-i, --identityIdentity file to use instead of the local profile. Place this global flag before exec.
-d, --debugVerbose logging to stdout.
--auth-serverAddress 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-dirPath to the data directory holding the local admin identity (default /var/lib/almaforge).
-o, --formatOutput 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:

Terminal
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.)

StatusMeaning
0Success.
1Failed for a reason without a more specific status.
2The command or its flags were wrong.
3No credentials, or they expired. Run alma login.
4Authenticated, but not permitted. Ask for access with alma request create.
5The named resource does not exist.
6It already exists, and the command would have replaced it.
7The cluster could not be reached.

Ask for json or yaml output and the failure is structured too, so nothing has to read the prose:

JSON
{
"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.

text
alma login [flags] [cluster]
FlagDescription
--ca-pinsha256:<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-rolesRequest one or more extra roles
--request-reasonReason for requesting additional roles
--request-reviewersSuggested reviewers for role request
--request-nowaitFinish without waiting for request resolution
--request-idLogin with the roles requested in the given request, named by ID or a unique prefix
--browserOpen 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.
--breakglassCreate a one-time recovery link with the local admin identity. Must run on an Auth host. Ignores every other login flag.
--kube-clusterName of the Kubernetes cluster to login to
-v, --verboseShow extra status information

alma logout​

Log out of the current cluster, removing local certificates.

text
alma logout

alma status​

Show the current session and cluster status.

text
alma status [flags]
FlagDefaultDescription
-o, --formattextOutput format: text, json, yaml
-v, --verboseShow 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.

text
alma get <kind> [name] [flags]
alma get <kind>/<name> [flags]
alma get all
FlagDefaultDescription
-o, --formattextOutput format: text, yaml, json
-v, --verboseFull label output
--with-secretsfalseInclude secrets (CAs, connectors)
--searchFuzzy search keywords
--queryPredicate language filter
Resource kinds & listing aliases​

AlmaForge provides Kubernetes-style get commands alongside familiar listing shortcuts:

Resource KindList CommandAccepted Aliases
Serversalma get serveralma get servers, alma node ls, alma ls
Databasesalma get dbalma get databases, alma db ls
Kubernetesalma get kubealma get kubernetes, alma kube ls
Applicationsalma get appalma get apps, alma app ls
Access requestsalma get requestalma get requests, alma request ls
Active sessionsalma get sessionalma kube sessions, alma get sessions
Recordingsalma get recordingalma get recordings, alma recording ls
Alertsalma get alertalma get alerts, alma alert ls
Tokens & Botsalma get token, alma get botalma 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.

text
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.

Terminal
# 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.

text
alma apply -f resource.yaml
alma apply resource.yaml # positional filename also accepted
FlagDescription
-f, --filenameResource definition file (stdin if omitted)

The filename can be passed as a positional argument or with -f.

alma update​

Patch resource metadata fields.

text
alma update <kind>/<name> [flags]
FlagDescription
--set-labelsReplace labels with a comma-separated key=value list
--set-ttlSet 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:

text
alma create -f resource.yaml

Imperative shortcuts:

CommandDescription
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.

text
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.

text
alma edit <kind>/<name>

alma explain​

List supported resource kinds or describe the fields of a kind or nested field path.

text
alma explain [kind[.field...]] [flags]
FlagDefaultDescription
-o, --formattextOutput format: text, json, yaml
Terminal
alma explainalma explain role.spec.allow

Resource 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 --.

text
alma exec KIND/NAME [-u USER] [--db-name NAME] [-- ARGS...]
KindBehavior
serverOpen the account's login shell, or execute the command after -- over SSH.
dbLaunch the local database client, such as psql, mariadb, mongosh, or valkey-cli. Arguments after -- go to that client.
kubeRun local kubectl with a temporary kubeconfig for the target cluster. Arguments after -- are required.
appUse 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.

FlagDescription
-u, --userSSH login for a server or database account for a database. Other kinds reject this flag.
--db-nameDatabase 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.

Terminal
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 -- sh

Kubernetes 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.

text
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 for alma port-forward db/<name>)
  • alma proxy app <name> (alias for alma port-forward app/<name>)
  • alma proxy kube <name> (alias for alma port-forward kube/<name>)

For native OpenSSH, alma proxy ssh is invoked by the ProxyCommand configuration generated by alma config (see server access).

Port argumentMeaning
5432Listen on local port 5432 and forward to remote port 5432.
15432:5432Listen on local port 15432 and forward to remote port 5432.
:5432 or 0:5432Choose 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.

FlagDefaultDescription
--addresslocalhostBind to localhost or a specified IP address.
-u, --userResource defaultSSH login or database account. Accepted for server and db.
--db-nameResource defaultDatabase name. Accepted for db.
Terminal
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/prod

Use 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.

CommandDescription
alma get server
alma ls
List accessible servers (alias: alma node ls)
alma ssh [user@]hostStart an interactive SSH session
alma scp src destCopy files to or from a remote server
alma exec server/NAMERun remote command over SSH
alma port-forward server/NAMEForward ports to server
alma ssh​
text
alma ssh [flags] [user@]host [command...]
FlagDescription
-l, --loginRemote host login
-p, --portSSH port on the remote host
-A, --forward-agentForward SSH agent
-L, --forwardLocal port forwarding (local:remote)
-D, --dynamic-forwardSOCKS5 dynamic forwarding
-t, --ttyForce TTY allocation
--localExecute command on localhost after connecting to SSH node
-N, --no-remote-execNo remote command (port forwarding only)
-c, --clusterTarget cluster
-X, --x11-untrustedUntrusted X11 forwarding
-Y, --x11-trustedTrusted X11 forwarding
--x11-untrusted-timeoutTimeout for untrusted X11 forwarding
--request-reasonReason for automatic access request
--disable-access-requestDisable automatic resource access requests
--log-dirDirectory for per-node command output logs
alma scp​

Copy files to or from a remote node.

text
alma scp [flags] src dest
FlagDescription
-l, --loginRemote host login
-r, --recursiveRecursive copy
-P, --portRemote port
-p, --preservePreserve timestamps
-q, --quietQuiet mode
-c, --clusterTarget cluster

Database access​

Connect to databases with native clients, retrieve short-lived credentials, or open local tunnels for desktop GUI tools.

CommandDescription
alma get db
alma db ls
List accessible databases
alma exec db/NAMEConnect directly with native client (psql, mariadb, mongosh)
alma port-forward db/NAMEOpen local tunnel for desktop GUIs (DBeaver, DataGrip, TablePlus)
alma db login <db>Retrieve database credentials
alma db logout [db]Remove database credentials
alma db envPrint database environment variables
alma db configPrint database connection info
FlagDescription
-c, --clusterTarget cluster

Kubernetes access​

Interact with Kubernetes clusters through native kubectl, temporary execution sessions, or local tunnels.

CommandDescription
alma get kube
alma kube ls
List accessible Kubernetes clusters
alma kube login <cluster>Configure kubectl context persistently in current shell
alma exec kube/NAME -- ARGSExecute kubectl in an isolated temporary session without modifying kubeconfig
alma port-forward kube/NAMEOpen local tunnel for GUI tools (Lens, k9s)
alma kube credentialsGet kubectl credentials (exec plugin)
alma kube sessions
alma get session
List active Kubernetes sessions

Application access​

Access internal HTTP web applications and APIs through authenticated local tunnels or short-lived certificates.

CommandDescription
alma get app
alma app ls
List accessible applications
alma port-forward app/NAMEOpen 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 configPrint app connection info

Access Requests​

alma request​

Manage temporary access requests.

CommandDescription
alma get request
alma request ls
List access requests
alma request show <id>Show request details
alma request createCreate an access request
alma request review <id>Review an access request
alma request searchSearch for requestable resources
alma request dropDrop 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.

Terminal
alma audit --last=1h --type=UserLoginalma audit -f -o json

alma recording​

Session recording commands.

CommandDescription
alma recording ls
alma get recording
List recordings
alma recording play <id>
alma play <id>
Replay a recorded session

The audit and recording listing commands share these options:

FlagDescription
-f, --followKeep watching for new results until interrupted.
-o, --formatOutput format: text, json, or yaml. Defaults to text.
--from-utcStart date in YYYY-MM-DD format, at midnight UTC. Defaults to 24 hours ago.
--to-utcEnd date in YYYY-MM-DD format, at midnight UTC. Defaults to the current time.
--lastLook back by a duration such as 1h30m. Cannot be combined with date bounds.
--limitMaximum 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.

Terminal
alma recording ls --last=1h -o jsonalma recording ls -f --limit=0

Following 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.

CommandDescription
alma create token --services=<services>Create an invitation token
alma get tokenList tokens
alma delete token/<name>Remove a token

Bots​

Certificate renewal bots.

CommandDescription
alma create bot <name> --roles=<roles>Create a bot and print its enrollment command
alma get botList 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.

text
alma create lock [flags]
FlagDescription
--target-userUser to disable
--roleRole to disable
--target-loginLocal UNIX user to disable
--access-requestAccess request UUID to disable
--server-idServer UUID to disable
--messageMessage for locked-out users
--expiresLock expiry (RFC3339)
--lock-ttlLock TTL duration

alma auth​

Certificate authority operations.

CommandDescription
alma auth exportExport public CA keys
alma auth signCreate identity file(s) for a user
alma auth rotateRotate certificate authorities
alma auth lsList connected auth servers
alma auth crlExport certificate revocation list
alma auth pinPrint the CA pins used to verify the Auth Service during a join

alma get instance​

CommandDescription
alma get instanceList the instances registered with the cluster

alma alert​

Cluster alert management.

CommandDescription
alma alert ls
alma get alert
List alerts
alma alert create <message>Create a cluster alert
alma alert ack <id>Acknowledge an alert
alma alert ack lsList acknowledged alerts

alma get cluster​

Show the cluster you are connected to.

text
alma get cluster [flags]
FlagDefaultDescription
-o, --formattextOutput format: text, yaml, json

Misc​

alma version​

Print the client and server version.

text
alma version [flags]
FlagDefaultDescription
-o, --formattextOutput format: text, json, yaml
--clientClient 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.

text
alma install skill [flags]
FlagDefaultDescription
-o, --outputWrite to stdout (-o=stdout) or a file (-o=file:///path)
--projectfalseInstall 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.

text
alma install mcp [flags]
FlagDefaultDescription
--printfalsePrint the configuration block instead of registering

Each client is configured through its own mcp add subcommand, and the command prints what it ran:

Terminal
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:

Terminal
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.

text
alma mcp

alma get license​

Show license status and current usage.

text
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​

CommandPurpose
almad startRun almad in the foreground with services selected by service flags, environment variables, or resource files.
almad statusPrint the active SSH session metadata when invoked from inside an almad SSH session.
almad versionPrint the binary version. Add --raw for the bare version string.
almad install systemdRender a systemd unit file for almad.
almad install scriptRender a shell script that installs an agent on a fresh node.
almad join opensshEnroll 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

FlagDefaultDescription
-d, --debugVerbose stderr logging. Env: ALMA_DEBUG.
--log-levelinfoLog severity: debug, info, warn, error. Env: ALMA_LOG_LEVEL.
--log-outputstderrLog destination: stderr, stdout, syslog, or a file path. Env: ALMA_LOG_OUTPUT.
--log-formattextLog line format: text for human-readable output, json for one JSON object per line. Env: ALMA_LOG_FORMAT.
--config-dir/etc/almaforge/almad.dPath 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/almaforgeDirectory for local state and the embedded SQLite store. Env: ALMA_DATA_DIR.
--pid-fileWrite the process PID to this path.
-t, --testResolve the configuration and exit without starting any service.
--license-filePath to the AlmaForge license file. Env: ALMA_LICENSE_FILE.
--permit-user-envRead environment variables from ~/.ssh/environment, the OpenSSH PermitUserEnvironment file, when starting a session.

Services

FlagDescription
--auth-serviceRun the Auth service. --no-auth-service turns it off. Env: ALMA_AUTH_SERVICE.
--proxy-serviceRun the Proxy service. --no-proxy-service turns it off. Env: ALMA_PROXY_SERVICE.
--ssh-serviceRun the SSH Node service. --no-ssh-service turns it off. Env: ALMA_SSH_SERVICE.
--database-serviceRun the Database service. --no-database-service turns it off. Env: ALMA_DATABASE_SERVICE.
--app-serviceRun the Application service. --no-app-service turns it off. Env: ALMA_APP_SERVICE.
--kubernetes-serviceRun the Kubernetes service. --no-kubernetes-service turns it off. Env: ALMA_KUBERNETES_SERVICE.
--jira-serviceRun the built-in Jira access-request plugin. --no-jira-service turns it off. Env: ALMA_JIRA_SERVICE.
--slack-serviceRun the built-in Slack access-request plugin. --no-slack-service turns it off. Env: ALMA_SLACK_SERVICE.
--pagerduty-serviceRun the built-in PagerDuty plugin. --no-pagerduty-service turns it off. Env: ALMA_PAGERDUTY_SERVICE.
--telegram-serviceRun the built-in Telegram plugin. --no-telegram-service turns it off. Env: ALMA_TELEGRAM_SERVICE.

Cluster join

FlagDescription
--auth-serverAddress 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.
--proxyAddress of the Proxy Service. What every agent joins with. Env: ALMA_PROXY.
--client-idResource name (metadata.name) of the provisioning Token, or a path to a file containing it. Env: ALMA_CLIENT_ID.
ALMA_CLIENT_SECRETPlaintext shared secret for the static join method. Environment-only (no CLI flag), keeping the value out of command-line arguments.
--ca-pinsha256:<hex> pin of the Auth Server CA. Repeatable. Used on first join. Env: ALMA_CA_PIN.
--join-methodJoin method: static, aws, ec2, kubernetes, azure, gcp, github, gitlab, circleci, spacelift. Env: ALMA_JOIN_METHOD.
--nodenameOverride the node name (defaults to the host's hostname). Env: ALMA_NODE_NAME.
--labelsComma-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.

FlagDefaultDescription
--listen0.0.0.0:443Shared TLS listener. Bound when the Proxy Service or Auth Service is enabled. Env: ALMA_LISTEN.
--advertiseCanonical 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-listenOptional 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-advertiseOverride for alma kube login config server URL. Env: ALMA_KUBE_ADVERTISE.
--tunnel-listenOptional dedicated reverse tunnel port. Env: ALMA_TUNNEL_LISTEN.
--tunnel-advertiseOverride for agent reverse-tunnel reconnect URL. Env: ALMA_TUNNEL_ADVERTISE.
--mysql-listenOptional native MySQL wire-protocol port. Env: ALMA_MYSQL_LISTEN.
--mysql-advertiseOverride for MySQL client connection display. Env: ALMA_MYSQL_ADVERTISE.
--postgres-listenOptional native Postgres wire-protocol port. Env: ALMA_POSTGRES_LISTEN.
--postgres-advertiseOverride for Postgres client connection display. Env: ALMA_POSTGRES_ADVERTISE.
--mongo-listenOptional native Mongo wire-protocol port. Env: ALMA_MONGO_LISTEN.
--mongo-advertiseOverride for Mongo client connection display. Env: ALMA_MONGO_ADVERTISE.
--ssh-listenOptional dedicated proxy SSH port (alma ssh raw-SSH path). Configures the Proxy Service ingress, not the SSH Node service. Env: ALMA_SSH_LISTEN.
--ssh-advertiseOverride for the proxy's SSH ingress public address. Env: ALMA_SSH_ADVERTISE.
--peer-listenProxy-to-proxy peering listener for HA proxy clusters. Env: ALMA_PEER_LISTEN.
--peer-advertiseAddress this proxy advertises to peer proxies. Env: ALMA_PEER_ADVERTISE.
--diag-listenDiagnostics 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-listenPrometheus metrics endpoint (/metrics). Operator-only. No advertise. Env: ALMA_METRICS_LISTEN.
--metrics-tls-certCertificate the metrics listener presents. Env: ALMA_METRICS_TLS_CERT.
--metrics-tls-keyPrivate key for --metrics-tls-cert. Env: ALMA_METRICS_TLS_KEY.
--metrics-client-caCA 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-fromNetworks a client-supplied source address is believed from (comma-separated CIDRs or bare IPs). Empty believes none. Env: ALMA_REAL_IP_FROM.
--real-ip-headerproxy_protocolThe 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-protocolWhether 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-certPath to a TLS certificate for the Proxy. Env: ALMA_TLS_CERT.
--tls-keyPath 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-intervalHow 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.
--acmeEnable ACME / Let's Encrypt certificate provisioning on the Proxy. Env: ALMA_ACME_ENABLED.
--acme-emailRegistration email for ACME. Env: ALMA_ACME_EMAIL.
--acme-uriLet's Encrypt productionACME 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.

FlagDescription
--state-uriCluster state backend URI. Examples: sqlite:///var/lib/almaforge/backend, postgres://user@host/db, dynamodb://table?region=us-east-1. Env: ALMA_STATE_URI.
--audit-uriAudit 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-uriSession 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.

FlagDefaultDescription
--ca-keystoresoftwareKeystore driver: software, pkcs11 or gcp_kms. Env: ALMA_CA_KEYSTORE.
--pkcs11-modulePath to the PKCS#11 module. Required for pkcs11. Env: ALMA_PKCS11_MODULE.
--pkcs11-slotSlot number holding the token. Give this or --pkcs11-token-label. Env: ALMA_PKCS11_SLOT.
--pkcs11-token-labelLabel of the token to use. Give this or --pkcs11-slot. Env: ALMA_PKCS11_TOKEN_LABEL.
--pkcs11-pinPIN 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-keyringFully qualified GCP KMS keyring name. Required for gcp_kms. Env: ALMA_GCP_KMS_KEYRING.
--gcp-kms-protection-levelSOFTWAREGCP 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.

FlagDescription
--app-nameName of the application to serve.
--app-uriInternal address the application is reachable at.
--app-advertiseDNS 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.

FlagDescription
--db-nameName of the proxied database.
--db-protocolWire protocol: postgres, mysql, mongodb, cockroachdb, redis, snowflake, cassandra, elasticsearch, opensearch, dynamodb, clickhouse or clickhouse-http.
--db-uriAddress the database is reachable at.
--db-ca-certPath to the CA certificate the database's own certificate is checked against.
--db-aws-regionAWS region the database runs in. Required for RDS and Aurora.

Kubernetes service

FlagDescription
--kubeconfigPath to a kubeconfig used to register external Kubernetes clusters. Env: ALMA_KUBECONFIG.

Resource matching

FlagDescription
--match-labelsLabel matcher for dynamically registered databases, applications, and Kubernetes clusters. Env: ALMA_MATCH_LABELS.

Examples

Terminal
# 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-app

almad install systemd​

Render a systemd unit file for almad. Defaults match the package layout.

FlagDescription
--env-filePath to the environment file.
--fd-limitMaximum open file descriptors.
--binaryFull path to the almad binary.
-o, --outputOutput destination (stdout, file:///path).
--data-dirData 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.

FlagDescription
--proxyAddress of the Proxy Service.
--client-idToken resource name on the cluster (literal or file path). Pair with ALMA_CLIENT_SECRET for the static method.
--join-methodstatic, aws, ec2, kubernetes, azure, gcp, github, gitlab, circleci, or spacelift.
--openssh-configPath to the sshd config (default /etc/ssh/sshd_config).
--data-dirDirectory for local state.
--restart-sshdRestart sshd after writing config (default true).
--sshd-check-commandCommand used to validate the new sshd config.
--sshd-restart-commandCommand used to restart OpenSSH. Defaults to systemctl restart on the unit the host installs, sshd.service or ssh.service.
--labelsComma-separated key=value labels for the OpenSSH node.
--addressIP address of this OpenSSH node.
--additional-principalsExtra 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:

Terminal
alma node ls --query 'labels["env"] == "prod"'alma db ls --query 'contains(labels["team"], "platform")'alma app ls --query 'hasPrefix(name, "billing-")'