Skip to main content
The Bannerify CLI generates images and PDFs from a terminal. It uses the same templates and API keys as the REST API, so you can render a file in one command and pipe the result into another tool. Use the CLI when you want to:
  • Render a file during a build, a deploy, or a cron job.
  • Batch many templates from a shell script.
  • Let an agent or a script create files without writing code.

Before you start

  • A Bannerify account with at least one template.
  • An API key. Create one in API keys.

Install

Install the CLI with npm:
To run it without installing:

Save your API key

Store the key once, like git config:
The key is written to $XDG_CONFIG_HOME/bannerify/config.json, or ~/.config/bannerify/config.json. The file is created with 0600 permissions. Confirm the key works:
The command prints the project name, the project id, the creation date, and where the key came from:

Generate an image

Override the layers of the template with --modifications:
The array holds one entry per layer. Each entry names the layer with name and sets its value with text, src, or another field of that layer type.

Generate a PDF

The PDF uses the same modifications format:

Use it in a pipeline

The CLI keeps stdout for data and stderr for messages, so the bytes of a file pass cleanly to the next command. Write to stdout with --out=-:
For long batches, keep the messages and the bytes apart. For example, upload every result as it is generated:

Key resolution

The CLI looks for the API key in this order:
  1. The --api-key flag.
  2. The BANNERIFY_API_KEY environment variable.
  3. The stored config.
This lets you keep one key in the config and override it for a single command or a container:

Configuration file

Manage the file with the config commands. See CLI commands.

Usage and limits

Every generation from the CLI counts against the same monthly and daily quota as the REST API and the SDKs. See Quota and limits.

Next steps