Start here
Getting started
Install the brico CLI, capture your first brick and add it to another project in about five minutes.
This guide installs brico, captures a module from one project into a Vault, and adds it to a second project. You need a terminal and git. Supported projects are Next.js and NestJS, written in TypeScript.
Install the CLI
brico is a single static binary with no runtime dependencies. Choose one method:
Install script (macOS, Linux)
curl -fsSL https://raw.githubusercontent.com/ScienceWerx-Inc/bricowerx/main/scripts/install.sh | shThe script downloads the release binary for your OS and architecture, checks it against the release’s SHA256SUMS.txt, and installs it to ~/.local/bin. To change that, set these variables before running it:
# install a specific version into /usr/local/bin
curl -fsSL https://raw.githubusercontent.com/ScienceWerx-Inc/bricowerx/main/scripts/install.sh \
| BRICO_VERSION=0.1.0 BRICO_INSTALL_DIR=/usr/local/bin shnpm
npm install -g bricoThe npm package downloads the same checksummed release binary.
From source
Requires Go. The result is the same binary.
git clone https://github.com/ScienceWerx-Inc/bricowerx.git
cd bricowerx/engine
go build -o ../brico ./cmd/bricoConfirm it works:
brico --version
brico doctorCapture and reuse your first brick
The repository ships two example NestJS apps: examples/nest-source, which has a JWT auth module, and examples/nest-target, which doesn’t. The steps below use a throwaway Vault, so nothing touches your real one. Run them from the repository root.
- Point brico at a scratch Vault
bash export BRICO_VAULT="$(mktemp -d)"Without this, the Vault defaults to
~/.brico/vault. You can also pass--vault <path>to any command. - Find reusable modules
bash brico --cwd examples/nest-source extractextractlists modules that look self-contained, ranked by confidence.--cwdruns a command as if you were inside that directory. - Capture one into the Vault
bash brico --cwd examples/nest-source capture auth -y \ -d "JWT authentication with Passport and bcrypt" \ -t security,jwt,authcapturescans the module’s files, imports and environment variables, writes abrico.manifest.json, and commits the snapshot to the Vault as version0.1.0. - Find it again
bash brico list brico search jwt - Add it to another project
bash brico --cwd examples/nest-target add auth -yaddcopies the files to the framework’s install path, records the module inbrico.json, appends its required variables to.env.example, and prints the wiring steps for your framework. - Check the result
bash brico --cwd examples/nest-target doctor
In your own project
cd ~/code/api-one
brico extract # what looks reusable here?
brico capture billing -p src/billing -d "Stripe billing" -t payments
cd ~/code/api-two # another app on the same framework
brico add billing@^0.1.0Version ranges follow semver: billing takes the latest version, billing@0.2.0 an exact version, billing@^0.1.0 the newest compatible one and billing@~0.1.0 the newest patch.
A brick records the framework it was captured from, and add refuses to put a NestJS brick into a Next.js app or the other way round. To make one brick usable in any Next.js app regardless of its aliases or design system, follow the brick rules.
Next steps
- Share the Vault with your team: publish and pull.
- Make bricks that install cleanly anywhere: brick rules.
- Author a new brick without writing the scaffolding: Builder.
- Every command and flag: CLI reference.