Work from your terminal
appbricx moves a project's files between your editor and Appbricx. Pull the project, change it with your own tools, push it and check or apply in one command. It also adds npm packages the way the build installs them, and gives each git branch a preview.
When you would use it
- You build in code, in your editor, with git. See the code quickstart.
- An agent with a shell (Claude Code, Codex) works on files on disk and you want them in git.
- CI pushes every branch as a preview.
Checking, applying, verifying and deploying are also MCP tools and developer API routes; the CLI doesn't have its own deploy, logs or secrets commands. push --check and push --apply cover the first two.
Set up
appbricx is the platform's own binary (the same one that runs a self-hosted install). It reads two variables:
export APPBRICX_API=https://appbricx.com/api/dev/v1 # self-hosted: https://<your platform host>/dev/v1
export APPBRICX_TOKEN=apx_pat_… # Workspace settings → Coding agentsThe token needs read to pull and apply to push. See access tokens.
Commands
| Command | What it does |
|---|---|
appbricx pull <project> <dir> | Writes the project's dev draft into the directory. Files the draft doesn't have are left alone. |
appbricx push <project> <dir> [--check | --apply] | Makes the draft equal to the directory (draft files it doesn't have are deleted), then optionally checks it or applies it to dev. |
appbricx push <project> <dir> --preview[=<name>] [--delete] | Sends what git sees as a preview with its own database and address, named after the branch; --delete removes it. The dev draft is left alone. |
appbricx add <package>[@range] … [--dir <project>] | Adds npm packages: writes package.json and package-lock.json with versions at least 7 days old. |
appbricx migrate --to code <contract.json | dir> <new dir> | Converts an app made from a JSON contract into a code-first project directory. |
The rest of the binary runs a self-hosted platform (serve, doctor, owner, backup): see self-host. Every command and flag is in the CLI reference.
A typical session
appbricx pull "$PROJECT" teamday/
cd teamday
$EDITOR db/schema/experience.sql routes/experiences/[id].tsx
appbricx push "$PROJECT" . --check # errors at file:line, nothing changes
appbricx push "$PROJECT" . --apply # dev is built: migrated, bundled, workflows armed
git add -A && git commit -m "Experiences have a duration"--check and --apply print the server's report as JSON. A report with errors is printed, not turned into an exit code: read report.ok in scripts.
What push sends
- Every file under the directory except dot-files, dot-directories and
node_modules. With--previewin a git checkout: what git tracks, plus new files it doesn't ignore. - Text only: keep images, fonts and build output out of the directory. Upload images with the
assetstool. - No merge: the draft becomes your directory. If an agent or a teammate may have edited the draft since, pull first.
Previews from git
# .git/hooks/pre-push, or a CI job on every push
appbricx push "$PROJECT" . --preview
# when the branch is merged
appbricx push "$PROJECT" . --preview --deleteThe preview is named after the branch (feature/teaser becomes feature-teaser; in CI it is read from GITHUB_HEAD_REF, GITHUB_REF_NAME or CI_COMMIT_REF_NAME) and answers at preview-<name>--<app>. A preview untouched for 7 days is removed. In CI, set APPBRICX_API and APPBRICX_TOKEN (with apply) from the CI's secret store.
Exit codes
0: done.1: the server or a tool said no (an unknown project, a missing scope, a stale draft, npm failing).2: a usage error.