Skip to main content
The Bannerify CLI has three commands: config, create, and whoami.
Run bannerify --help, or bannerify <command> --help, to print the options of a command in your terminal.

Global flags

config

Manage the settings the CLI keeps between runs. The commands work like git config.

Keys

The apiKey value is masked in the output of get and list. Add --show to reveal it:
config set apiKey prompts for the key without echoing it. Add --show to the prompt when you paste a long key and want to see it:
The config file lives at $XDG_CONFIG_HOME/bannerify/config.json, or ~/.config/bannerify/config.json. The CLI creates it with 0600 permissions.

create

Generate an image or a PDF from a template.

Options

Without --out, the CLI writes the file to <templateId>.<format> in the current directory, or in outputDir when you set it.

Modifications

--modifications takes the same array as the modifications field of the REST API. Each entry names a layer with name and sets its value.
For a long array, keep it in a file and pass the path, or pipe it through stdin:
The layer names come from the template editor. See Template elements for the field each layer type accepts.

Examples

whoami

Verify the API key and print the project it belongs to.
key source reports where the key came from: flag, env, or config. Use it to check which key a script uses. Run whoami first in a new environment. It reports an authentication problem before a long batch fails.

Use it from a script or an agent

The CLI detects a non-interactive session. When stdin or stdout is not a terminal, or when CI is set, it never prompts: a missing key fails at once with the commands to fix it.

JSON output

Add --json to read the result from a script. On success, create prints one object:
create pdf omits format. whoami prints the project and the key source:
On an error, the command prints the error object from the API and exits with a non-zero code:
When --out=- is used with --json, the file bytes stay on stdout. Send the file to a target that accepts a stream, or write to a path instead.

Exit codes

Troubleshoot

Learn more