Run a GitHub repo
An app from a repo, running with a URL. The briq downloads the code itself, and nothing is built on your side.
Recipes: Python app, Node.js app, Bun app, Go app, Ruby app, Rust app, PHP app, Static site, Nginx gateway
Ask your agent to "run github.com/acme/shop". It passes the repo's address, and the briq downloads
the code itself. The shape is a GitHub Actions job's: an image, a checkout, steps, then the
command that serves.
One call
briq_run({
recipe: "node",
checkout: { repo: "github.com/acme/shop" },
steps: [{ run: "npm ci" }, { run: "npm run build" }],
cmd: "npm start",
ports: [3000],
expose: "private"
})
→ bq_7f1… app (node:22-slim) running · url: https://app-x2kd.briq.run/?briq_token=… · …What happens
- The briq downloads the branch's latest commit, unless its volume already has it.
- It runs
stepswhen the commit changed. Withoutsteps, it installs the dependencies, when a lockfile changed. - It runs
cmdwithPORTset, and waits until the port answers.
A first build can take minutes. briq_status shows creating meanwhile, and briq_logs shows each
step.
What checkout takes
| Field | What it is |
|---|---|
repo | github.com/acme/shop, https://github.com/acme/shop.git or acme/shop. On another host: an archive URL |
ref | A branch, a tag or a commit sha. Default: the default branch. A full sha pins the code |
path | The app's folder in the repo, like backend. Steps and cmd run there |
token | For a private repo |
The recipe also takes image (another version is another tag: node:24-slim), steps, cmd,
ports ([8080]), env, size and volume ({ gb: 2 }).
Each language
| Recipe | Installs, without steps | Starts with, without cmd |
|---|---|---|
| node | npm ci, pnpm install or yarn install, by lockfile | npm start |
| bun | bun install | bun run start |
| python | requirements.txt, or pyproject.toml (editable) | python app.py |
| ruby | bundle install | ruby app.rb |
| php | nothing | PHP's built-in server |
| go | builds at each start, from its cache | the binary |
| rust | builds at each start, from its cache | cargo run --release |
| static | nothing: serves path as it is | nginx |
Take cmd and the port from the README. A Next.js app:
steps: [{ run: "npm ci" }, { run: "npm run build" }], cmd: "npm start", ports: [3000].
Another host
On GitLab, Bitbucket or Codeberg, pass the https URL of a .tar.gz archive of the code:
checkout: { repo: "https://gitlab.com/acme/shop/-/archive/main/shop-main.tar.gz" }- The briq downloads it at each start, and unpacks it only when it changed.
refdoes not apply: the version is in the URL.- A private archive takes
token, sent asAuthorization: Bearer.
A new commit
- A briq starting from scratch looks the branch up again.
- A wake resumes from a memory snapshot: the app keeps its commit.
- A start from scratch (a restart, or a snapshot that could not be kept) builds the new commit before the app answers.
- To run a new commit now:
briq_forkthe briq, thenbriq_destroythe old one. - To pin a version: pass a full commit sha as
ref.
Several services
One service per part, each with its own path, and an Nginx gateway in front.
The browser sees one URL: no CORS, no back end address built into the front end. Write them in a
stack file and bring it up in one call: each service waits for the ones it
names ({{briq:NAME}}).
Here is fastapi/full-stack-fastapi-template
as a briq.yaml:
stack: shop
services:
db:
recipe: postgres
backend:
recipe: python
image: python:3.14-slim
checkout: { repo: github.com/fastapi/full-stack-fastapi-template, path: backend }
steps:
- run: pip install --no-cache-dir -q -e .
- run: mkdir -p app/frontend && bash scripts/prestart.sh
cmd: fastapi run app/main.py --host :: --port $PORT
env:
DATABASE_URL: postgres://postgres:{{secret:POSTGRES_PASSWORD}}@{{briq:db}}:5432/app
SECRET_KEY: { secret: SECRET_KEY }
FIRST_SUPERUSER: admin@example.com
FIRST_SUPERUSER_PASSWORD: { secret: FIRST_SUPERUSER_PASSWORD }
frontend:
recipe: bun
checkout: { repo: github.com/fastapi/full-stack-fastapi-template, path: frontend }
steps:
- run: bun install
- run: VITE_API_URL= bun run build
cmd: bunx sirv-cli ../backend/app/frontend --single --host :: --port $PORT
gateway:
recipe: nginx
routes: { "/api/": "backend:8080", "/docs": "backend:8080", "/": "frontend:8080" }
expose: privatebriq_up({ file: "<content of briq.yaml>" })
→ stack shop: 4 created (db, backend, frontend, gateway), 0 already there
…
gateway:URL=https://gateway-k3m9.briq.run/?briq_token=…{{secret:POSTGRES_PASSWORD}}is the database's password, put into the backend's env when it starts. Status shows the placeholder, never the password.- A secret without a value (
SECRET_KEY) is generated. One briq cannot generate, like an API key, comes inbriq_up'ssecrets; ask the person for it. - Empty the front end's API address at build time (
VITE_API_URL=): it then calls/api/…. - Serve the folder the build writes to: here
../backend/app/frontend, set invite.config.ts. - Listen on
::: the gateway reaches the services over the private network, which is IPv6. - Migrations go in
steps: they run once per new commit.
A private repo
Ask the person for a fine-grained token, at github.com/settings/personal-access-tokens/new:
- Repository access: Only select repositories, this repo only.
- Permissions: Contents, read-only. Nothing else.
- Set an expiration. An organization may have to approve the token.
checkout: {
repo: "github.com/acme/internal-api",
token: { secret: "GITHUB_TOKEN", value: "github_pat_…" }
}- The token is stored encrypted, and shown as
{ secret: "GITHUB_TOKEN", scope: "boot" }. - Only the download gets it: a boot-only secret, a file the boot
script reads and deletes before the steps and the app start. It is never in the environment,
so neither the app nor
briq_execcan read it. - Never pass the person's own token (
gh auth token): it reaches every repo they can reach. - Delete the token once the briq is gone.
When it does not start
briq_logs says which step failed:
| The logs say | Fix |
|---|---|
could not read … from GitHub | Check the URL. A private repo needs token |
… has no branch or tag named … | Check ref |
the repo has no folder … | Check path |
| An install or build error | Fix the repo and push, or run a new briq with other steps or cmd |
Good to know
- Builds need CPU. On
small, a Next.js, Rust or Go build can take over ten minutes. Usemedium, orlarge(Hobby: with a card on file, see pay as you go). - A monorepo builds from its root:
steps: [{ run: "cd /work/src && pnpm install && pnpm -w build" }].pnpmandyarnwork instepsandcmd, through corepack: pin a version withpackageManagerinpackage.json. - The volume counts toward your plan's disk until the briq is destroyed, stopped or failed
ones included. Big dependencies need
volume: { gb: 5 }or more. - A fork starts warm: it copies the volume, code and dependencies included.
- An app on
0.0.0.0works through its URL. Siblings need it on::.