Skip to content
Bonfire Docs
Docs

howto

Bonfire CLI

The Bonfire CLI lets you manage your community straight from the terminal — list and create channels, post and read messages, and browse members. It's a thin wrapper around the public REST API, so every command respects your API key's scopes.

The package is onbonfire-cli and it installs a single binary named bonfire.

1. Install

npm install -g onbonfire-cli

This makes the bonfire command available globally.

2. Authenticate

API access requires a Business or Enterprise plan. Generate an API key in Admin → API Keys (route /admin/api-keys), then log in:

bonfire login

The interactive prompt asks for your key and stores it. To skip the prompt — handy in scripts or CI — pass the key directly:

bonfire login --key bf_live_xxxxxxxxxxxxxxxx

Credentials are written to ~/.bonfire/config.json. To sign out and clear that file:

bonfire logout

To confirm who you're authenticated as — the active tenant, current plan, key prefix, and granted scopes:

bonfire whoami

3. Manage channels

List channels, optionally scoped to a single space:

bonfire channels list
bonfire channels list --space <id>

Create a channel. --name is required; the rest are optional:

bonfire channels create --name announcements --space-name "General" --type announcement
FlagRequiredDescription
--name <name>yesThe channel name.
--space-name <space>noPlace the channel in a named space.
--type <type>noOne of text, announcement, resource, event, or voice. Defaults to text.

4. Post and read messages

List the most recent messages in a channel:

bonfire messages list <channelId>
bonfire messages list <channelId> --limit 50

Post a message from inline text, or from a file:

bonfire messages post <channelId> --text "Welcome to the community!"
bonfire messages post <channelId> --file ./announcement.md --pinned
FlagDescription
--text <text>The message body, inline.
--file <path>Read the message body from a file (use instead of --text).
--pinnedPin the message after posting.

5. Browse members

List members, with optional filtering and pagination:

bonfire members list
bonfire members list --role moderator
bonfire members list --limit 25 --offset 50
FlagDescription
--role <role>Only return members with this role.
--limit <n>Maximum number of members to return.
--offset <n>Skip this many members (for pagination).

Tips

  • Use bonfire whoami to check which tenant a command will hit before running it.
  • Scripts can authenticate non-interactively with bonfire login --key bf_live_..., then run commands and finish with bonfire logout.
  • Every command calls the public REST API under the hood, so its actions respect your key's scopes. A read-only key can list channels and members but can't create them.
  • Authenticate with the Bonfire API — /docs/api
  • Your first API call — /docs/guides/getting-started/your-first-api-call
  • API design principles — /docs/guides/developers/api-design

FAQ

Do I need a paid plan to use the CLI? Yes. API access — and therefore the CLI — requires a Business or Enterprise plan. You generate the key in Admin → API Keys.

Where are my credentials stored? In ~/.bonfire/config.json. Run bonfire logout to clear it.

Can I work with multiple communities? Each API key is tied to one tenant. Log in with the key for the community you want to manage, and run bonfire whoami to confirm the active tenant before acting.

What permissions does a command need? The same scopes as the underlying API. Listing channels, messages, and members needs read scopes; channels create and messages post need the matching write scopes. If a command fails with a permission error, check your key's scopes with bonfire whoami.