CLI reference
Install
npm install -g @buildtree/cli
The binary on your PATH is buildtree. Requires Node 18.19 or later. Node 20 or 22 is recommended. To run it without installing, use npx @buildtree/cli <command>.
AI coding agents can drive the same flows through the MCP server.
buildtree login
buildtree login
Authenticate with buildtree. Authorise the session in the browser when prompted.
buildtree upload
buildtree upload <file> [options]
Upload a build artifact and confirm it on the server.
Arguments
| Argument | Description |
|---|---|
<file> | Path to a .ipa, .apk, or .aab. Optional in a TTY. |
Options
| Flag | Description |
|---|---|
--project <slug> | Project slug. Required in CI. |
--env <name> | Environment string. Required in CI. |
--branch <name> | Branch name. Omit to create a checkpoint. |
--release <tag> | Attach a release tag such as v1.2.0. |
Examples
# Interactive
buildtree upload ./app.apk
# Fully scripted
buildtree upload ./app.apk --project acme --env dev --branch feature/payments
# Promote to dev checkpoint
buildtree upload ./app.ipa --project acme --env dev
# Tag a release
buildtree upload ./app.ipa --project acme --env prod --release v1.2.0
buildtree publish
buildtree publish [platform] [options]
Run buildtree build then buildtree upload in one command.
Arguments
| Argument | Description |
|---|---|
[platform] | ios, android, or omitted to use the first configured platform. |
Options
| Flag | Description |
|---|---|
--project <slug> | Project slug. Required in CI. |
--env <name> | Environment string. Required in CI. |
--branch <name> | Branch name. Omit to create a checkpoint. |
--release <tag> | Attach a release tag. |
buildtree build
buildtree build [platform]
Run the build command declared in buildtree.config.json at your project root:
{
"builds": {
"ios": {
"command": "fastlane build_ios",
"artifact": "build/App.ipa"
},
"android": {
"command": "cd android && ./gradlew assembleRelease",
"artifact": "android/app/build/outputs/apk/release/app-release.apk"
}
}
}
The artifact field must be a single, exact file path. No glob expansion.
Projects are not auto-detected. If eas.json is present and no buildtree config is found, the CLI falls back to eas build --local --platform <platform> --profile preview --output build/App.<ext>.
buildtree list
# Projects
buildtree list
# Builds within a project
buildtree list --project acme
Options for the builds variant
| Flag | Description |
|---|---|
--project <slug> | Project to list. Required for the builds variant. |
--env <name> | Filter to a specific environment. |
--branch <name> | Filter to a specific branch. |
buildtree link
buildtree link --build <buildId>
Generate a temporary download URL for an artifact.
Options
| Flag | Description |
|---|---|
--build <id> | Build UUID. Required. |
--expires-in <seconds> | URL TTL. Max 86400, default 3600. |
buildtree delete-project
buildtree delete-project <slug> [options]
Delete a project, its builds, and its registered devices. Irreversible.
Options
| Flag | Description |
|---|---|
-y, --yes | Skip the confirmation prompt. |
Environment variables
| Variable | Default | Purpose |
|---|---|---|
BUILDTREE_API_URL | https://buildtree.sh | Base URL of the buildtree API. Overrides the URL saved by buildtree login. |
BUILDTREE_TOKEN | unset | API token. Intended for CI. Overrides the token saved by buildtree login. |
Related
- Quickstart: share your first build in 5 minutes
- Share Expo builds with testers
- Share React Native builds with testers
- Share Flutter builds with testers
- Troubleshooting installs and uploads
Last updated