Contributing
bb is a solo side project but PRs and issues are welcome.
Setup
git clone https://github.com/Hugo-Hbrt/bbucket-cli.git
cd bbucket-cli
npm install
npm test
Requires Node ≥ 18.
Running the CLI locally
./bin/run.js auth
./bin/run.js branch list
There's no need to npm link unless you really want bb on your PATH while developing.
Code style
- Biome handles formatting, linting, and import organization. Run
npm run checkto auto-fix. - TypeScript strict mode plus
noUncheckedIndexedAccess,noImplicitReturns, andnoFallthroughCasesInSwitch. - Inline null guards in DI constructors:
if (!dep) throw new Error("IDep is required").
Adding a feature
The full loop, roughly:
- Check
docs/bbucket/swagger.v3.jsonfor the relevant endpoint shape. - Extend
domain/types.tswith any new types. - Add the method to
IBitbucketClient(or the appropriate port). - Implement it in
HttpBitbucketClient(or the appropriate adapter). - Add the business-logic method to the relevant
*Service. - Create
src/commands/<topic>/<command>.ts. - Add the
*Listed/*Shown/*Appliedmethod toIOutputPort+ all three adapters (Table / Json / Ai). - Write acceptance tests in
test/<topic>.test.jsthat stub the fake Bitbucket server. - Verify the acid test still passes.