@ebay-dt/bonfire-cli
v0.1.0
Published
The Bonfire command-line tool.
Keywords
Readme
@ebay-dt/bonfire-cli
The Bonfire preparation command for local development.
Usage
Add the package to an application and run this before Next.js development:
{
"scripts": {
"dev": "bonfire prepare && next dev"
}
}bonfire prepare [--root <application-root>]prepare validates BF_SESSION_SECRET from the process environment when it
is supplied. Otherwise it safely creates or updates <root>/.env.local with
32 random bytes encoded as hexadecimal, without rotating an existing valid
secret. It also ensures .env.local is ignored by <root>/.gitignore.
For values already in .env.local, the command accepts only literal values:
unquoted #, $ variable expansion, and malformed or multiline quotes are
rejected. This keeps the value validated by Bonfire identical to the value
loaded by Next.js. Put secrets requiring other dotenv syntax in the process
environment instead.
The command never invokes GitHub CLI, loads application configuration, or
prints the secret. It exits with 0 on success, 1 on validation or
filesystem failure, and 2 for invalid command syntax.
Converting a Next.js scaffold
Convert a compatible Next.js App Router scaffold in place. This command intentionally generates an eBay-configured application, including the eBay preset, corporate GitHub hostname, and deployment defaults:
bonfire convert \
--root /path/to/app \
--app-id my-bonfire-appWhen running from the Bonfire monorepo, use the workspace package directly (after building the CLI):
pnpm --filter @ebay-dt/bonfire-cli exec node dist/bin.js convert \
--root /path/to/app \
--app-id my-bonfire-app \
--name "My Bonfire App"--root and --app-id are required. The display name defaults to a humanized app ID (my-bonfire-app becomes My Bonfire App). Hostname defaults to github.corp.ebay.com and the development port defaults to 1995. Data routes are included by default; use --without-data to omit the eBay item gateway adapter. Use --dry-run to inspect the plan and --skip-install to leave dependency installation and type generation to the caller. Existing customized files and conflicting settings stop the conversion rather than being overwritten.
The normal conversion performs pnpm install, formats changed files, runs next typegen, and synchronizes generated repository context. It does not create GitHub/Vercel projects, authenticate a machine, or start the development server.
Context repository operations
Use the context commands explicitly from an instance repository:
bonfire context sync [--check] [--root <root>]
bonfire context install [--check] --app-id <app-id> [--root <root>]sync writes deterministic repository projections and sync --check performs
the same validation without writing. Both default --root to the current
working directory and print only generated paths and status. install installs
canonical skills and merges MCP definitions into the user's Cursor MCP
configuration while preserving unrelated entries. install --check validates
machine state without changing it.
Branch preparation
Before starting Next.js in development, run:
bonfire branch prepare --root <application-root> --hostname <hostname>The command loads environment values with Next-compatible precedence and
honors BF_DISABLE_AUTO_BRANCH_SWITCH=true. Disabled mode performs no GitHub
CLI or Git operation. When switching is enabled, BF_PROTOTYPE_BASE_BRANCH
overrides the default main base branch and must name an existing local or
fetched branch; preparation fails rather than silently using another branch. When enabled, an already-authenticated GitHub CLI user
is prepared on their login branch through @ebay-dt/bonfire-node. Missing or
unauthenticated GitHub CLI is a successful deferred result; other failures
return exit code 1. The command never starts interactive authentication or
prints identity, credentials, paths, or Git output.
