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

ArgumentDescription
<file>Path to a .ipa, .apk, or .aab. Optional in a TTY.

Options

FlagDescription
--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

ArgumentDescription
[platform]ios, android, or omitted to use the first configured platform.

Options

FlagDescription
--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

FlagDescription
--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

FlagDescription
--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

FlagDescription
-y, --yesSkip the confirmation prompt.

Environment variables

VariableDefaultPurpose
BUILDTREE_API_URLhttps://buildtree.shBase URL of the buildtree API. Overrides the URL saved by buildtree login.
BUILDTREE_TOKENunsetAPI token. Intended for CI. Overrides the token saved by buildtree login.

Related

Last updated

CLI reference | buildtree docs