Skip to content

CLI command reference

Every hakocms-cli command, with its flags and arguments. To install the CLI and log in, see Install the CLI and Log in with the CLI. For output formats and exit codes, see CLI output and exit codes.

Commands take the form hakocms-cli <resource> <action> (hakocms-cli entries list). Every command prints the same description as this page with --help.

You can add these to any command.

Flag or argument Description
--host <URL|NAME> The server to connect to (a URL, or a name you gave with auth login). If omitted: HAKOCMS_HOST, hakocms-cli.toml, then auth switch, in that order
--json Output JSON
--jq <EXPR> Filter the JSON with a jq expression (implies –json)
--no-input Never prompt. If a prompt is needed, fail with an error
Commands Description Number of commands
Login and access tokens Commands to log in to and out of Hako CMS, switch the connection target, and list and revoke access tokens. 7
Spaces Commands to create, list, and delete spaces, and to set the space used when you omit --space. 5
Content types Commands to create, change, and delete content types. 7
Entries Commands to create, change, publish, and delete entries, plus commands for revision history and scheduled publishing. 12
Media Commands to upload, list, change, and delete media. 6
Schema files Commands to pull a space’s schema as a .hako.json file, view the diff, and apply it to another space, plus a command to pull type definitions. 4
Schema applies Commands to start applying a schema file (a job), check its progress, and get its result. You normally use schema apply instead. 5
Exports Commands to export a space’s entries and media to a file. 5
Imports Commands to create a space from an exported file. 7
API keys Commands to issue API keys for the Content API, change their permissions, and revoke them. 5
Webhooks Commands to create, change, and delete webhooks, and to view and resend deliveries. 8
Members Commands to list a space’s members, change their roles, and remove them. 4
Invitations Commands to create, list, and cancel invitations to a space. 5
Roles Commands to create, change, and delete a space’s roles (sets of allowed actions). 5
Users Commands to create, list, and delete the environment’s users, and to issue a link for setting a password. Most can be used only by environment administrators. 5
Activity records Commands to view a space’s activity records (audit log) and export them as CSV. 2
Usage A command to view current usage and limits for a space and for the whole environment. 1
Call the Admin API directly A command to call any Admin API, for operations that have no command. 1
Shell completion A command to print a script for completing commands and flags in your shell. 1
Version A command to print the version of hakocms-cli and the version of the Admin API it speaks. 1