CLI
awctl is the command-line client for the Admin API. It manages the same
objects the admin console and the Terraform provider manage, inside a tenant,
and its command tree mirrors the provider’s resource table, so a resource you
know in one is spelled the same way in the other.
Commands follow one shape:
awctl SERVICE RESOURCES VERB [NAME] [FLAGS]SERVICE is identity, access, guard, or audit, RESOURCES is a plural such as realms
or clients, and VERB is one of create, list, describe, update,
edit, or delete. NAME is a short AWID such as r-01 or a full resource
name such as tenants/t-01/realms/r-01; both work.
Install
Section titled “Install”Binaries are published to the awctl package registry on git.authwise.com for
darwin and linux on amd64 and arm64, and for windows on amd64. The
project is public, so downloads need no credential. To install a release:
VERSION=AWCTL_VERSIONOS=$(uname -s | tr '[:upper:]' '[:lower:]')ARCH=$(uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/')BASE="https://git.authwise.com/api/v4/projects/6/packages/generic/awctl/${VERSION}"
curl -fsSL -o awctl "${BASE}/awctl_${VERSION}_${OS}_${ARCH}"curl -fsSL -o SHA256SUMS "${BASE}/awctl_${VERSION}_SHA256SUMS"grep "awctl_${VERSION}_${OS}_${ARCH}" SHA256SUMS | sed "s|awctl_${VERSION}_${OS}_${ARCH}|awctl|" | shasum -a 256 -c -chmod +x awctl && sudo mv awctl /usr/local/bin/awctlawctl versionAWCTL_VERSION is a release version such as 0.5.0; the project’s package
registry lists them. Releases are plain X.Y.Z versions; a version with a
commit suffix is a development build.
Point it at an install
Section titled “Point it at an install”A profile tells awctl where an install is and which issuer you sign in at.
To connect to an install, create a profile and sign in:
awctl config profiles create PROFILE \ --endpoint API_HOST:443 \ --auth-issuer https://ADMIN_HOSTawctl auth loginPROFILEis a name you choose for the install, such asprod.API_HOSTis the Admin API host.awctlreaches it over gRPC with TLS.ADMIN_HOSTis the install’s admin issuer host.
The values depend on where Authwise runs:
| Install | API_HOST | ADMIN_HOST | Token URL | Audience |
|---|---|---|---|---|
| The Authwise service | api.authwise.com | admin.authwise.com | https://admin.authwise.com/oauth/token | a-01 |
| Your own install | A host from the install’s networking.api.hosts. See Reach the Admin API. | spec.bootstrap.admin.issuerHost | https://ADMIN_HOST/oauth/token | a-01 |
The token URL and the audience are what a
service account credential needs; a
browser login needs only the first two. The admin issuer host serves the
sign-in and the token endpoint, not the Admin API: a call to
admin.authwise.com:443 as the endpoint fails with 405 Method Not Allowed.
Your tenant’s ID (t-…) is in the console’s address bar when you open the
tenant, as /tenants/TENANT_ID, and in the mint dialog of a service
account.
The first profile you create is active. Profiles live in
~/.awctl.d/config.yaml, created with mode 0600. A profile never holds a
credential.
A profile has these settings. Each one has an environment variable that overrides it:
| Flag | Environment variable | Setting |
|---|---|---|
--endpoint | AWCTL_ENDPOINT | The Admin API, as HOST:PORT. |
--guard-endpoint | AWCTL_GUARD_ENDPOINT | Guard’s control plane, for awctl guard. |
--audit-endpoint | AWCTL_AUDIT_ENDPOINT | The estate audit server’s retrieval endpoint, for awctl audit. |
--auth-issuer | AWCTL_AUTH_ISSUER | The admin issuer that awctl auth login uses. |
--insecure | AWCTL_INSECURE=true | Plaintext gRPC, for development endpoints such as a port-forward to the api Service. |
Work with several installs
Section titled “Work with several installs”To add another install, create another profile. To switch to it, activate it:
awctl config profiles create staging --endpoint STAGING_API_HOST:443 \ --auth-issuer https://STAGING_ADMIN_HOSTawctl config profiles activate stagingawctl config profiles listlist marks the active profile with *. STAGING_API_HOST and
STAGING_ADMIN_HOST are the second install’s hosts.
To run one command against a profile without activating it, pass
--profile, or set AWCTL_PROFILE for a shell session. Two terminals can
use two installs at once this way:
awctl --profile prod identity realms listawctl config profiles describe shows the profile in use, contexts
included. update PROFILE changes the settings you pass, and delete PROFILE removes a profile other than the active one.
Contexts
Section titled “Contexts”A context stores the scope identifiers you would otherwise pass on every command. Each command group has its own context inside the profile, so switching profile switches the context too, and an identifier from one install never fills in a command against another.
awctl identity context set --tenant TENANT_ID --issuer ISSUER_IDawctl identity realms list # --tenant-id comes from the contextawctl identity context set --realm REALM_IDawctl identity users list # --tenant-id and --realm-idawctl identity context showTENANT_ID, ISSUER_ID, and REALM_ID are the AWIDs of the tenant, issuer,
and realm you work in, such as t-01.
| Group | Levels context set stores |
|---|---|
identity | --tenant, --issuer, --realm, --audience |
access | The same context as identity: awctl access context is an alias. |
guard | --tenant (the tenant that has Guard enabled, the same t-… as identity), --network |
audit | None. --tenant is always explicit. |
A client is never stored: --client-id is what a command is about, not a
scope you work inside. context set changes only the levels you pass, so
setting --tenant keeps the stored realm; run context show after you
switch tenants. context clear --realm clears one level, and context clear
with no flags clears the group’s context.
For each value, an explicit flag wins, then the environment variable, then
the profile. When a value is missing, the error names the flag and the
context set command that stores it. A full resource name, such as
tenants/t-01/realms/r-01, needs no context.
When a command that changes something takes scope from the context, it prints that scope to stderr before it runs, if stderr is a terminal:
scope from profile prod: tenant t-01, realm r-01Reads print nothing, and nothing prints when stderr is redirected.
Run in CI
Section titled “Run in CI”A CI job needs no profile. Set the endpoint and the client-credential variables in the environment, and pass every scope flag explicitly:
export AWCTL_ENDPOINT=API_HOST:443export AWCTL_TOKEN_URL=TOKEN_URLexport AWCTL_CLIENT_ID=CLIENT_IDexport AWCTL_CLIENT_SECRET=CLIENT_SECRETexport AWCTL_AUDIENCE=AUDIENCE_ID
awctl identity realms list --tenant-id TENANT_IDThe values come from a credential minted for automation. A tenant administrator mints one for a service account the tenant owns; an operator uses the install’s machine credential.
Authenticate
Section titled “Authenticate”There are two ways to authenticate, and awctl picks one deterministically:
if any client-credential variable is set, it uses the client-credentials grant
and refuses to start if the set is incomplete; otherwise it uses the credential
that a browser login stored.
With a machine credential
Section titled “With a machine credential”For scripts, CI, and the first session on a fresh install, use the machine
credential the operator minted at install. It is an OAuth 2.0
client_credentials client in the install’s admin tenant; see
Read the machine credential.
CREDENTIAL="$(kubectl -n NAMESPACE get secret CR_NAME-admin-credential \ -o jsonpath='{.data.credential\.json}' | base64 -d)"export AWCTL_TOKEN_URL="$(jq -r .token_url <<<"$CREDENTIAL")"export AWCTL_CLIENT_ID="$(jq -r .client_id <<<"$CREDENTIAL")"export AWCTL_CLIENT_SECRET="$(jq -r .client_secret <<<"$CREDENTIAL")"export AWCTL_AUDIENCE="$(jq -r .audience <<<"$CREDENTIAL")"export AWCTL_ENDPOINT=API_HOST:443
awctl identity realms list --tenant-id TENANT_IDNAMESPACE and CR_NAME are the install’s namespace and the name of its
AuthwiseIdentityServer. AWCTL_AUDIENCE is the admin audience’s AWID, an
identifier rather than a URL; pass it verbatim. Tokens are minted in process
and re-minted before they expire.
As a person
Section titled “As a person”awctl auth login runs the OAuth 2.0 authorization code flow with PKCE in your
browser against the active profile’s --auth-issuer:
awctl auth loginWithout a profile, pass the issuer: awctl auth login --issuer https://ADMIN_HOST. The issuer can also come from AWCTL_AUTH_ISSUER.
awctl signs in as the public CLI client that every install seeds, so a fresh
install needs no client of your own. To sign in as another public client, pass
--client-id CLIENT_ID, and allow the redirect URI that
awctl auth login --show-redirect-uri prints, with the port dropped
(http://localhost/return).
The access token is stored per issuer under ~/.awctl.d/credentials/, with
mode 0600. Two profiles on one install share a login, and two installs
never do. From 0.16, the login is renewed in the background: a short-lived
access token is replaced through its refresh token for up to 12 hours of
inactivity and 7 days in all, after which commands fail with a hint to run
awctl auth login again. awctl auth logout deletes the login for the
profile’s issuer.
Output and input
Section titled “Output and input”Every verb takes --format table|yaml|json, with --yaml and --json as
shorthands, and --fields a,b,c to choose columns. Tables hide sensitive
fields; yaml and json do not. list pages through the whole collection
automatically.
create and update take flags for the common fields, or --file PATH with
a YAML or JSON document of the whole object. edit NAME opens the object in
$EDITOR and sends the difference as a field-mask patch.
The command tree
Section titled “The command tree”| Group | Scope flags | Notes |
|---|---|---|
identity domains | --tenant-id | create --hostname HOST --custom [--wait] claims a hostname of your own and prints its two DNS records (awctl 0.40; a domain is identified by d-…, the hostname is a field); --product guard claims a custom Guard address instead; get, list with kind and state, delete (refused while an issuer is bound to it). create --issuer ISSUER_ID is deprecated: it claims the host and binds that issuer at its root for one release. See Use your own domain. identity issuer-domains is a deprecated alias. |
identity issuer-domain-bindings | --tenant-id --issuer-id | create --domain HOST [--path PATH] binds the issuer at a path of a domain; list, describe, delete. Each binding is its own issuer URL. |
identity issuers | --tenant-id | create needs no domain; --domain-id (the domain’s d-…) or --domain HOST with --path creates the first binding in the same step (deprecated). --preferred-binding (a binding id or hostname) chooses the host mailed links use. After create, domain_id, path and domain_name are output only and follow the issuer’s first binding. --config, --appearance-profile-id, --labels. --domain-name is deprecated. |
identity realms | --tenant-id | |
identity audiences, clients, appearance-profiles | --tenant-id --issuer-id | A client takes --audience-id, --display-name, --grant-type, --application-url, --login-url, --post-logout-redirect-uris, --config. |
identity client-secrets | --tenant-id --issuer-id --client-id | No create; mint prints the secret once. |
identity users, providers, factors | --tenant-id --realm-id | Users also have invite, list-authenticators, revoke-authenticator, list-devices, revoke-device, list-identifiers, remove-identifier. |
identity scopes | --tenant-id --issuer-id --audience-id | create ID; add-, remove-, list-access-permissions. |
identity themes, assets, certificates, secrets, endpoints | --tenant-id | Certificates: import, rotate, export. Secrets: create, add-version. Endpoints: check, referrers. |
identity events | --tenant-id | Read only: list, describe. |
access access-permissions, access-roles, access-conditions, access-bindings | --tenant-id --issuer-id --audience-id | Roles: add-, remove-, list-access-permissions. |
awctl identity providers import-saml-metadata and export-saml-metadata
exchange SAML metadata with an identity provider; awctl identity clients
has the same pair for the service-provider side.
Common tasks
Section titled “Common tasks”Create a realm and list the realms in a tenant:
awctl identity realms create --tenant-id TENANT_ID --display-name Employeesawctl identity realms list --tenant-id TENANT_IDMint a client secret and capture it without it reaching your terminal:
awctl identity client-secrets mint \ --tenant-id TENANT_ID --issuer-id ISSUER_ID --client-id CLIENT_ID \ --out ./client-secret.txt--out writes the secret to a file with mode 0600 and refuses to overwrite.
The secret is shown once; there is no way to read it again, only to mint a
successor.
Invite a person into a realm, from awctl 0.15. They get an email with a link to set their password:
awctl identity users invite dana@acme.example \ --tenant-id TENANT_ID --realm-id REALM_ID --display-name "Dana Reyes"The command prints the new user and whether the invitation was mailed.
When it was not, because the install has no message delivery configured
or the address was refused, it prints the reason and the accept URL for
you to pass on; the URL sets the person’s password, so treat it like one.
--json always includes it. --reissue replaces a live invitation and
voids the earlier link.
Read an issuer’s configuration as JSON and inspect one field:
awctl identity issuers describe ISSUER_ID --tenant-id TENANT_ID --json \ | jq .configCheck an outbound endpoint and see what references it:
awctl identity endpoints check ENDPOINT_ID --tenant-id TENANT_IDawctl identity endpoints referrers ENDPOINT_ID --tenant-id TENANT_IDcheck exits non-zero when the endpoint is unreachable, which suits a
readiness script.
List recent events in a tenant:
awctl identity events list --tenant-id TENANT_IDWorking notes
Section titled “Working notes”- Secrets go through files or stdin, never flags.
identity secrets createreads material from--data-file PATHor from stdin with-. Useprintf '%s'rather thanechoto avoid sending a trailing newline as part of the secret. --configon an issuer replaces the whole config. The server refuses a partial update beneath the realm selector, so read the config, edit it, and write it back whole.ALREADY_EXISTSon an access binding means the same audience, subject, role, resource, and condition already have a binding. Expiry is not part of that identity, so extending a grant is anupdate, not a secondcreate.- Deletion is refused while referenced. An endpoint, certificate, or issuer
that something still references cannot be deleted;
endpoints referrersnames the holders. - Revoking a user’s authenticator also revokes their remembered browsers.
The revoke and remove verbs prompt unless you pass
--yes, and refuse to run without a terminal and without it. awctlworks inside a tenant. It does not create tenants or grant operator status; those belong to the operator-only tenancy surface.