B BrandLeaf docs

Operate

Artisan commands

Pitchbar ships a handful of php artisan commands beyond the standard Laravel surface — they handle queue ticks, vector rebuilds, source freshness, demo seeding, and a few admin convenience wrappers. Run any of them with --help to see options.

Operational

CommandWhat it does
php artisan pitchbar:queue-tick Process a bounded batch of queued jobs and exit. Designed for external-cron-driven processing on shared hosting (Cloudflare Worker → POST /api/v1/internal/queue-tick → this command). See Deployment for the full external-cron setup.

Flags: --queues=analytics,default,index,crawl, --max-jobs=20, --max-time=55.
php artisan documents:purge-superseded One-off cleanup for knowledge bases built before the supersede fix. A re-crawl whose content had changed used to create a new document and leave the previous one behind, with its chunks still embedded — so an agent accumulated a stale copy of every page it re-crawled, and those old chunks kept competing in retrieval (a re-crawled product page could still answer from the older copy). New crawls retire the superseded version themselves; this clears what already piled up. Keeps the newest document per source + URL and deletes the rest along with their vectors.

Flags: --agent={uuid} to restrict to one agent, --dry-run to report without deleting.
php artisan vector:setup Idempotently create the vector index/collection — Vectorize on Cloudflare, or Qdrant. Run once on a fresh install before the first crawl. Safe to re-run; it short-circuits when the index already exists. The legacy qdrant:setup alias still works.
php artisan vector:rebuild-index Recovery flow for embedding-model changes. Drops the Vectorize index, deletes every local Chunk, resets every Source to pending, recreates the index at the dim that matches the currently-configured embedding model, and re-dispatches IndexDocumentJob for every Document with persisted text. Use this after switching CLOUDFLARE_EMBED_MODEL between models of different dimensions (e.g. bge-base 768 → bge-m3 1024). Flags: --force to skip the confirmation prompt, --dim=N to override the resolved dim. See Knowledge for the full model→dim map.
php artisan pitchbar:audit-vectors Compare DB chunks against the vector index and report drift (chunks present in DB but missing in the index, and vice versa). Read-only. Useful after a Vectorize re-provision or when investigating "the bot doesn't know about page X."
php artisan pitchbar:probe-retrieval {agent} "question" … Show the knowledge an agent finds for each question: the ranked candidates, their similarity and rerank scores, and whether each passes the agent's threshold. Options: --file (one question per line), --page, --top, --json. Read-only: no cache reads or writes. Useful when "the bot found nothing" or "answered from the wrong product".
php artisan pitchbar:reembed {agent} Re-embed an agent's existing chunks with their page title (card #735), under the same vector ids — nothing is re-crawled. Run it once per agent for knowledge indexed before titles were embedded. --dry-run only counts; --without-titles embeds the bare text again (the way back). Costs one embedding per chunk.
php artisan pitchbar:refresh-stale-sources Re-crawl sources whose content is older than N days (default 7). Schedule this nightly via your external cron if you want auto-refresh; without it, sources only re-sync when the operator clicks Refresh.
php artisan pitchbar:sync-oauth-sources Re-ingest Notion / Google Doc sources whose content might be stale. Same idea as refresh-stale-sources but only walks OAuth-backed integrations (where the file may have changed inside Notion / Drive without a webhook).
php artisan tickets:auto-escalate Applies each workspace's "escalate tickets with no staff reply after N hours" rule (off unless an Owner / Admin sets it on /app/tickets): open or pending tickets past the window with no staff reply become urgent and are assigned to the workspace owner, who gets an email. Scheduled every 15 minutes; idempotent. See Tickets.
php artisan pitchbar:suggest-from-gaps Walk recurring unanswered questions (logged by DetectGapJob) and draft CuratedAnswer suggestions. Generates an admin notification; the curated answer is created as a draft, never published.
php artisan billing:process-manual-payments Bank-transfer periods: emails the workspace owner once, 7 days before an approved period ends (skipped while a renewal waits for approval), and moves workspaces whose period ended without a newer approved payment to the Free plan. Scheduled hourly; safe to re-run. Flag: --days=7 (reminder window). See Bank transfers & manual payments.

Admin convenience

CommandWhat it does
php artisan pitchbar:make-admin {email} Promote an existing user to super_admin. Pass --demote to flip them back to customer. Use this for your very first super_admin after signup — there's no UI for the role bump.
php artisan pitchbar:build-wp-plugin Package wp-plugin/pitchbar/ into an install-ready zip for distribution. Compiles every .po language file to .mo automatically before zipping.
php artisan pitchbar:seed-demo-agent Create or refresh the demo agent used by the marketing site widget. Only meaningful on installs with DEMO=true (the public pitchbar.io demo). Idempotent.
php artisan pitchbar:seed-local-test Create a published "Local Test" agent + script snippet for embedding on a sibling project during dev. Useful when you're building the widget locally and want a consistent agent across restarts.

Internal board (Kanban)

The internal admin board at /admin/board is backed by these commands. See Admin board for the full workflow. Quick reference:

  • php artisan board:add "Title" --body="..." --label=... — append a card to the backlog.
  • php artisan board:start <id-or-title> — move a card to In Progress.
  • php artisan board:done <id-or-title> --test="..." --release="v2.0.0" — close the card with a UI test plan and stamp the release version.
  • php artisan board:stamp-version vX.Y.Z --status=done — backfill release version on all freshly-Done cards.
  • php artisan board:seed — seed the initial backlog (idempotent).

Changelog

See Changelog for the public release-notes page. The maintainer-side commands:

  • php artisan changelog:add — append a new entry interactively. Writes a new database/changelog-entries/v{version}.md file; the running site reads those Markdown files directly via ChangelogStore (no DB table — the original changelog_entries table was dropped in 2026_05_09_120539 in favour of the file-based store).