Guides

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

  1. The briq downloads the branch's latest commit, unless its volume already has it.
  2. It runs steps when the commit changed. Without steps, it installs the dependencies, when a lockfile changed.
  3. It runs cmd with PORT set, 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

FieldWhat it is
repogithub.com/acme/shop, https://github.com/acme/shop.git or acme/shop. On another host: an archive URL
refA branch, a tag or a commit sha. Default: the default branch. A full sha pins the code
pathThe app's folder in the repo, like backend. Steps and cmd run there
tokenFor 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

RecipeInstalls, without stepsStarts with, without cmd
nodenpm ci, pnpm install or yarn install, by lockfilenpm start
bunbun installbun run start
pythonrequirements.txt, or pyproject.toml (editable)python app.py
rubybundle installruby app.rb
phpnothingPHP's built-in server
gobuilds at each start, from its cachethe binary
rustbuilds at each start, from its cachecargo run --release
staticnothing: serves path as it isnginx

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.
  • ref does not apply: the version is in the URL.
  • A private archive takes token, sent as Authorization: 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_fork the briq, then briq_destroy the 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: private
briq_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 in briq_up's secrets; 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 in vite.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:

  1. Repository access: Only select repositories, this repo only.
  2. Permissions: Contents, read-only. Nothing else.
  3. 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_exec can 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 sayFix
could not read … from GitHubCheck 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 errorFix 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. Use medium, or large (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" }]. pnpm and yarn work in steps and cmd, through corepack: pin a version with packageManager in package.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.0 works through its URL. Siblings need it on ::.

How can we help?

Message to the briq team