Skip to content

CLI: Exports

Commands to export a space’s entries and media to a file. Common flags that you can add to any command (--host, --json, and others) are in the CLI command reference.

Command Description
hakocms-cli exports create Start an export of a space
hakocms-cli exports delete Delete an export record and its ZIP
hakocms-cli exports download Download an exported ZIP
hakocms-cli exports get Get one export
hakocms-cli exports list List a space’s exports

Start an export of a space.

Starts an export of a space.

Returns 409 if an export of the same space is waiting or running.

ターミナルウィンドウ
hakocms-cli exports create [OPTIONS]
Flag or argument Description
-s, --space <SLUG> Space. If omitted: HAKOCMS_SPACE, hakocms-cli.toml, then the one set with spaces use, in that order
--media-files[=true|false] Whether to include the media files themselves (included by default)
--data <JSON> The whole body (JSON). Use @file to read from a file, - to read from standard input. Other flags are applied on top of it
--wait Wait until the job finishes and print the result. Exits with 1 if it fails

Delete an export record and its ZIP.

Deletes an export record and its ZIP. Ones that are waiting or running cannot be deleted (409)

ターミナルウィンドウ
hakocms-cli exports delete [OPTIONS] <ID>
Flag or argument Description
-s, --space <SLUG> Space. If omitted: HAKOCMS_SPACE, hakocms-cli.toml, then the one set with spaces use, in that order
<ID> ID
--force Do it without asking for confirmation

Download an exported ZIP.

Downloads an exported ZIP.

Returns 404 for exports that have not finished, have expired, or have been deleted.

ターミナルウィンドウ
hakocms-cli exports download [OPTIONS] <ID>
Flag or argument Description
<ID> Export ID
-s, --space <SLUG> Space. If omitted: HAKOCMS_SPACE, hakocms-cli.toml, then the one set with spaces use, in that order
-o, --output <PATH> Where to write (- for standard output). If omitted, saved in the current folder with the name the server gives
--force Overwrite the file if it exists

Get one export.

ターミナルウィンドウ
hakocms-cli exports get [OPTIONS] <ID>
Flag or argument Description
-s, --space <SLUG> Space. If omitted: HAKOCMS_SPACE, hakocms-cli.toml, then the one set with spaces use, in that order
<ID> ID

List a space’s exports.

Returns up to 20 items, newest first.

ターミナルウィンドウ
hakocms-cli exports list [OPTIONS]
Flag or argument Description
-s, --space <SLUG> Space. If omitted: HAKOCMS_SPACE, hakocms-cli.toml, then the one set with spaces use, in that order