- Home
- Skills
- Cameronapak
- Bknd Skills
- Bknd Local Setup
bknd-local-setup_skill
2
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill cameronapak/bknd-skills --skill bknd-local-setup- SKILL.md9.2 KB
Overview
This skill guides setting up a Bknd project locally and configuring a development environment. It covers installing the CLI, creating a project, choosing runtime adapters, preparing config files, and running the dev server. The goal is a reproducible local workflow for development and quick prototyping.
How this skill works
Follow an interactive CLI or manual code flow to scaffold a project, install dependencies, and generate a bknd.config file that declares the schema and connection. Run the built-in development server with flags for in-memory or file-based SQLite, port selection, and runtime choice (bun or node). Use adapter handlers to integrate Bknd into frameworks like Next.js, Astro, or React Router.
When to use it
- Starting a new Bknd project locally or onboarding a dev machine
- Prototyping quickly with an ephemeral in-memory database
- Developing against a persistent local SQLite file (file:data.db)
- Integrating Bknd into Next.js, Astro, or other frameworks
- Debugging local routes, config detection, or type generation
Best practices
- Use npx bknd create for fastest interactive scaffolding
- Prefer file:data.db for persistent dev, --memory for quick experiments
- Generate TypeScript types after schema changes (npx bknd types)
- Keep bknd.config.ts in version control; add data.db and .env to .gitignore
- Restart the server after schema edits or use a watch tool for hot reload
Example use cases
- Create a demo app with Todos using npx bknd create and default SQLite
- Run npx bknd run --memory to prototype auth flows with ephemeral state
- Embed Bknd API into a Next.js app using createHandler in app/api
- Manually bootstrap a project: npm init, install bknd, add bknd.config.ts and run
- Switch runtime: npx bknd run --server bun for faster local performance
FAQ
Ensure a supported filename exists (bknd.config.ts/.js/.mjs/.cjs/.json) or pass -c/--config with the explicit path.
How do I reset my local database?
Delete the SQLite file (rm data.db) and restart the server, or use --memory for a fresh ephemeral DB.
Which runtime should I use locally: Bun or Node?
Use Bun for faster startup and watch performance; use Node if Bun isn't installed or for parity with Node-only deployments.