@krispyai/cli
v0.1.0
Published
The krispy CLI — manage your self-hosted Krispy bot's knowledge base (system prompt) and onboard via the edge Worker's tenant-config route.
Maintainers
Readme
@krispyai/cli
The krispy self-host CLI — manage your bot's knowledge base (its system prompt)
without hand-writing wrangler kv calls. It talks to your @krispy/edge
Worker's POST /api/tenant/config route, which merges the prompt into KV.
Commands
krispy init # guided first-run setup (Telegram → train → embed → next steps)
krispy set-kbase kbase.md # write kbase.md as the bot's system prompt
krispy dev # run the edge Worker locally (wrangler dev)krispy init — the wizard
The terminal-native counterpart to Krispy Cloud's dashboard onboarding. Four steps, each
persisted as you go via POST /api/tenant/config (single-tenant self); re-run any time —
it never clobbers fields you've already set.
- Connect Telegram — BotFather guide (
/newbotat https://t.me/botfather) → paste the bot token, validated live via TelegramgetMe(green✓ @yourbotor red retry) → supergroup-with-Topics + add-the-bot-as-admin guide → chat id. PersistsbotToken+chatId. - Train your bot — point it at a knowledge-base file, accept a starter template, or skip
(set one later with
set-kbase). PersistssystemPrompt. - Embed the widget — prints the copy-paste
<script>snippet with yourdata-api+data-tenantbaked in. Paste it before</body>. - Next steps — how to run (
krispy dev/wrangler deploy) and test the loop.
Needs a real terminal (TTY); in CI/piped input it exits with guidance instead of hanging.
Config (env)
| var | default | meaning |
| -------------------- | ----------------------- | -------------------------------------------- |
| KRISPY_API | http://localhost:8787 | your edge Worker base URL |
| KRISPY_TENANT | self | tenant id |
| TENANT_SYNC_SECRET | — | must match the Worker's TENANT_SYNC_SECRET |
Run it
# from the repo (no publish needed):
KRISPY_API=https://krispy-edge.YOU.workers.dev \
TENANT_SYNC_SECRET=... \
bun packages/cli/src/index.ts set-kbase ./kbase.md