Small pre-deploy gut check for btca CLI + server changes.
Run these from the repo root:
bun install
bun run check:cli
bun run check:server
bun run format:allOptional if the server logic changed in a meaningful way:
bun run test:serverTerminal A:
bun run apps/cli/src/index.ts serve --port 8080Terminal B:
export SERVER_URL=http://127.0.0.1:8080
export SMOKE_RESOURCE="smoke-local-$(date +%s)"Expected: Terminal A prints btca server running at http://localhost:8080.
curl -sS "$SERVER_URL/"
bun run apps/cli/src/index.ts --server "$SERVER_URL" status
bun run apps/cli/src/index.ts resources --server "$SERVER_URL"Look for:
- health JSON includes
"ok":true statusprints provider, model, auth state, and version inforesourcessucceeds even if it printsNo resources configured.
Use the repo itself as a disposable local resource:
bun run apps/cli/src/index.ts add . --name "$SMOKE_RESOURCE" --type local --server "$SERVER_URL"
bun run apps/cli/src/index.ts resources --server "$SERVER_URL"Look for:
- add succeeds without weird prompts/errors
- the new resource shows up as
(local)and points at this repo
CLI path:
bun run apps/cli/src/index.ts ask --server "$SERVER_URL" -r "$SMOKE_RESOURCE" -q "What is the root package name in package.json?"Raw server path:
curl -sS \
-X POST "$SERVER_URL/question" \
-H 'content-type: application/json' \
-d "{\"question\":\"What is the root package name in package.json?\",\"resources\":[\"$SMOKE_RESOURCE\"]}"Look for:
- both commands succeed
- the answer is grounded in the repo
- the response is sensible for this question, ideally mentioning
@btca/repo
If status showed Selected provider authed: no, fix auth/config before treating ask failures as a release blocker.
Unknown command should be clean and helpful:
bun run apps/cli/src/index.ts remoevMissing required flags should fail cleanly:
bun run apps/cli/src/index.ts ask --server "$SERVER_URL"Missing resource should preserve a useful server error and hint:
bun run apps/cli/src/index.ts ask --server "$SERVER_URL" -r definitely-missing-resource -q "hello"Bad server request should return structured JSON:
curl -sS \
-X POST "$SERVER_URL/question" \
-H 'content-type: application/json' \
-d '{"question":""}'Look for:
- no stack traces or Effect internals leaking to the terminal
- CLI errors are readable and actionable
- server errors come back as JSON with
errorandtag
bun run apps/cli/src/index.ts remove "$SMOKE_RESOURCE" --server "$SERVER_URL"
bun run apps/cli/src/index.ts resources --server "$SERVER_URL"Then stop Terminal A with Ctrl+C.
Good enough to ship:
- server starts cleanly
status,resources,add, andaskall work- one intentional CLI failure and one intentional server failure both produce good messages
Pause before deploy:
- health or status is flaky
- resource add/remove behaves differently than expected
- ask fails after auth is confirmed
- error output is confusing, noisy, or missing hints