airsh is the CLI client for Airlock users: log in to a cluster, SSH, Kubernetes, databases, and file copying.

Full reference: airsh help <command>.

Environment variables

VariableDescriptionExample
AIRLOCK_AUTHAuthentication connector name (SAML, OIDC, GitHub, local)github
AIRLOCK_CLUSTERRoot or leaf cluster namecluster.example.com
AIRLOCK_LOGINDefault OS login on the remote hostroot
AIRLOCK_LOGIN_BROWSERnone — do not open the browser during SSOnone
AIRLOCK_PROXYProxy Service addresscluster.example.com:3080
AIRLOCK_HOMEairsh configuration directory~/.airsh
AIRLOCK_USERAirlock usernamealice
AIRLOCK_USE_LOCAL_SSH_AGENTssh-agent integrationtrue, false
AIRLOCK_GLOBAL_AIRSH_CONFIGPath to global config/etc/airsh.yaml
AIRLOCK_IDENTITY_FILEPath to identity file/opt/identity

Global flags

FlagDescription
-l, --loginOS login on the remote host
--proxyProxy Service address: host:https_port[,ssh_proxy_port]
--userAirlock username
--ttlCertificate validity in minutes (default 720)
-i, --identityIdentity file
--authAuthentication connector (default local)
--insecureDo not verify the server certificate (tests only)
-d, --debugVerbose output
-J, --jumphostSSH jump host

airsh login

Log in to the cluster. The certificate is saved to ~/.airsh.

airsh login [<flags>] [<cluster>]
FlagDescription
-o, --outSave identity to a file
--formatfile, openssh, kubernetes
--browsernone — do not open the browser
--no-use-local-ssh-agentDo not load the certificate into ssh-agent
airsh --proxy=proxy.example.com login
airsh --proxy=proxy.example.com --auth=local --user=admin login
airsh --proxy=proxy.example.com --auth=github login
airsh --ttl=1 login
airsh login --format=kubernetes -o kubeconfig

airsh logout

Removes the client certificate.

airsh logout

airsh status

Shows the current profile, roles, logins, and certificate expiry.

airsh status

airsh ls

List cluster nodes.

airsh ls [<flags>] [<label>]
FlagDescription
-v, --verboseShow Node ID
--clusterLeaf cluster
airsh ls
airsh ls os=linux
airsh ls -v

airsh ssh

SSH connection or command execution.

airsh ssh [<flags>] <[user@]host> [<command>...]
FlagDescription
-p, --portSSH port
-A, --forward-agentAgent forwarding
-L, --forwardLocal port forwarding
-D, --dynamic-forwardSOCKS5 proxy
--clusterLeaf cluster
-X, --x11-untrustedX11 forwarding
-Y, --x11-trustedTrusted X11 forwarding
airsh ssh root@grav-00
airsh ssh -o ForwardAgent=yes root@grav-00
airsh ssh root@env=prod hostname

airsh scp

Copy files.

airsh scp [<flags>] <source>... <dest>
FlagDescription
-r, --recursiveRecursive copy
-P, --portPort
--clusterLeaf cluster

airsh join

Join an active session.

airsh join [<flags>] <session-id>

airsh clusters

List trusted clusters.

airsh clusters [--quiet]

airsh kube ls

List available Kubernetes clusters.

airsh kube ls

airsh kube login

Log in to a Kubernetes cluster, update kubeconfig.

airsh kube login <kube-cluster>
FlagDescription
--allKubeconfig for all available clusters
--asKubernetes user impersonation
--as-groupsKubernetes group impersonation
--clusterAirlock cluster
-n, --kube-namespaceDefault namespace

airsh db ls

List available databases.

airsh db ls

airsh db connect

Connect to a database using the built-in client.

airsh db connect --db-user=<user> --db-name=<db> <database>

airsh proxy db

Local proxy for connecting to a database.

airsh proxy db [<flags>] <db>
FlagDescription
--db-userDatabase user
--db-nameDatabase name
--portLocal port
--tunnelAuthenticated tunnel without additional credentials
--clusterLeaf cluster
airsh proxy db mysql-db
airsh proxy db --port 10700 mysql-db
airsh proxy db --tunnel mysql-db

airsh recordings ls

List recorded sessions.

airsh recordings ls [--last=6h0m0s] [--from-utc=YYYY-MM-DD] [--to-utc=YYYY-MM-DD]

airsh play

Play back a recorded session.

airsh play <session-id>

airsh config

Print the OpenSSH configuration for use with Airlock.

airsh config >> ~/.ssh/config

airsh proxy ssh

Local TLS proxy for SSH (TLS routing mode).

airsh proxy ssh [<flags>] <[user@]host>

airsh version

Client and server version.

airsh version [--format=json] [--client]

airsh mfa add / ls / rm

Manage MFA devices.

airsh mfa add
airsh mfa ls
airsh mfa rm <type>

Manage Access Requests.

airsh request create --roles=prod --reason="..."
airsh request ls [--my-requests] [--reviewable]
airsh request review --approve <request-id>
airsh request show <request-id>
airsh request drop [<request-id>...]
airsh request search --kind=node --labels=env=dev