Skip to content

CLI

The Queuebase CLI (@queuebase/cli) provides commands for local development and production deployment.

Starts the local development server.

Terminal window
npx queuebase dev [options]
FlagDescriptionDefault
--port <port>Server port3847
--callback <url>Callback URL for job executionhttp://localhost:3000/api/queuebase

On startup the dev server:

  1. Initializes a local SQLite database at .queuebase/dev.db
  2. Reads the manifest at .queuebase/queuebase.manifest.json (if it exists)
  3. Syncs any scheduled jobs from the manifest into the database
  4. Starts the HTTP API and job executor

Discovers your job router, extracts schedule metadata, and writes a manifest file.

Terminal window
npx queuebase generate

The command:

  1. Looks for your job router using convention paths or a config file
  2. Loads the router module and extracts job definitions
  3. Builds a manifest with job names and resolved schedule configs
  4. Writes the manifest to .queuebase/queuebase.manifest.json

The CLI looks for your router in the following order:

Convention paths (checked first):

  1. src/jobs/index.ts
  2. src/jobs/index.js
  3. jobs/index.ts
  4. jobs/index.js

Config file (fallback):

If no convention path matches, the CLI looks for queuebase.config.ts or queuebase.config.js in the project root:

queuebase.config.ts
export default {
routerPath: "./src/jobs/index.ts",
};

The generated manifest looks like this:

.queuebase/queuebase.manifest.json
{
"version": 1,
"generatedAt": "2026-03-16T12:00:00.000Z",
"jobs": {
"sendEmail": {},
"dailyReport": {
"schedule": {
"cronExpression": "0 9 * * *",
"timezone": "UTC",
"enabled": true,
"overlap": "skip"
}
}
}
}

Syncs schedule definitions from the manifest to the production API.

Terminal window
npx queuebase sync [options]
FlagDescriptionDefault
--api-url <url>Production API URLhttps://api.queuebase.com
--dry-runPreview changes without applyingfalse

The command:

  1. Reads the manifest at .queuebase/queuebase.manifest.json
  2. Extracts jobs that have a schedule property
  3. Posts the schedule definitions to the production API
  4. The API diffs against the database: new schedules are inserted, changed ones are updated, and removed ones are soft-deleted
VariableDescriptionRequired
QUEUEBASE_API_KEYAPI key for authenticationYes
QUEUEBASE_API_URLOverride the API URL (lower priority than --api-url flag)No

Use --dry-run to preview what the sync would do without making changes:

Terminal window
npx queuebase sync --dry-run

The output shows a diff of what would be inserted (+), updated (~), or deleted (-):

Dry run — no changes applied
+ dailyReport (0 9 * * *, UTC)
~ weeklyDigest cronExpression: "0 9 * * 1" → "0 10 * * 1"
- oldCleanup (will be soft-deleted)
1 to insert, 1 to update, 1 to delete

Add queuebase sync as a deploy step after building your app:

Terminal window
npx queuebase generate
npx queuebase sync

The sync is idempotent — running it multiple times with the same manifest produces the same result. The command exits with code 0 on success and 1 on any failure.