CLI: Login and access tokens
Commands to log in to and out of Hako CMS, switch the connection target, and list and revoke access tokens. Common flags that you can add to any command (--host, --json, and others) are in the CLI command reference.
For how to use them, see Log in with the CLI.
| Command | Description |
|---|---|
hakocms-cli auth login |
Log in to a server and save an access token |
hakocms-cli auth logout |
Log out and revoke the saved access token |
hakocms-cli auth status |
Show the connection targets you are logged in to, and which one is currently selected |
hakocms-cli auth switch |
Change the connection target used when you omit –host |
hakocms-cli auth token |
Print the connection target’s access token (to pass to other tools) |
hakocms-cli auth tokens list |
List your access tokens |
hakocms-cli auth tokens revoke |
Revoke one of your access tokens |
hakocms-cli auth login
Section titled “hakocms-cli auth login”Log in to a server and save an access token.
Opens the admin in a browser; confirm that it shows the same characters as the terminal, and allow access. To use a token you created in the admin, pass it on standard input with –with-token. Tokens are stored per connection target in the OS credential store (hosts.toml if that is not available)
hakocms-cli auth login [OPTIONS]| Flag or argument | Description |
|---|---|
--name <NAME> |
A name for the connection target (use it like –host staging). If omitted, the hostname |
--with-token |
Read the token from standard input (hakocms-cli auth login –host … –with-token < token.txt) |
--no-browser |
Do not open a browser; print only the URL |
hakocms-cli auth logout
Section titled “hakocms-cli auth logout”Log out and revoke the saved access token.
hakocms-cli auth logouthakocms-cli auth status
Section titled “hakocms-cli auth status”Show the connection targets you are logged in to, and which one is currently selected.
hakocms-cli auth statushakocms-cli auth switch
Section titled “hakocms-cli auth switch”Change the connection target used when you omit –host.
hakocms-cli auth switch <NAME>| Flag or argument | Description |
|---|---|
<NAME> |
The name you gave with auth login |
hakocms-cli auth token
Section titled “hakocms-cli auth token”Print the connection target’s access token (to pass to other tools)
hakocms-cli auth tokenhakocms-cli auth tokens list
Section titled “hakocms-cli auth tokens list”List your access tokens.
hakocms-cli auth tokens listhakocms-cli auth tokens revoke
Section titled “hakocms-cli auth tokens revoke”Revoke one of your access tokens.
hakocms-cli auth tokens revoke [OPTIONS] <ID>| Flag or argument | Description |
|---|---|
<ID> |
ID |
--force |
Do it without asking for confirmation |