Barestash uses Nix flakes with direnv and nix-direnv for the local development environment.
Prerequisites:
- Nix with flakes support
- direnv with a shell hook enabled
- nix-direnv
Initial setup:
direnv allow
just installManual shell entry:
nix developChecks:
just format
just lint
just check
just test
just test-e2e
just coverage
just typecheck
nix flake check
nix develop -c nixfmt --check flake.nixLocal development commands:
just barestash --help
just dev-api
just deploy-api ENV=staging DRY_RUN=1
just dev-cli
just reset-api-statejust dev-api starts the API Worker with Wrangler local D1/R2/Durable Object
bindings persisted under apps/api/.wrangler/state. Run just reset-api-state
to delete that directory and reset local D1, R2, and Durable Object state. See
docs/local-cloudflare-development.md
for local migration and inspection commands.
just deploy-api ENV=<staging|production> deploys the API Cloudflare
infrastructure for operators. Production deploys require
CONFIRM=production. See docs/api-deployment.md.
Use just recipes as the canonical project command surface. Recipes may wrap
pnpm scripts internally, but day-to-day command examples should prefer just.
Codex local environment configuration lives in
.codex/environments/environment.toml. Its setup script runs just install,
and its configured actions enter the Nix dev shell before running the same
just recipes shown above.
Search recipes:
rg -n "temporary endpoint|private endpoint|events stream" requirements docs
rg -n "new Hono|app\\.get|app\\.post|/v1" apps/api packages
rg -n "runCli|barestash|auth|endpoints|events|tokens" apps/cli packages
rg -n "describe\\(|it\\(" apps packages
rg -n "authorization|cookie|x-barestash-secret|token|secret" apps packages requirements docsFormat Nix files with:
nix fmtUpdate the pinned Nix inputs with:
nix flake update
nix flake checkIf flakes are not enabled globally for manual nix commands, run them with:
nix --extra-experimental-features "nix-command flakes" develop