Install AgileBuilder

Requirements, installation, verification, upgrade, and uninstall instructions for the AgileBuilder CLI

Requirements

Before installing the AgileBuilder CLI, make sure your system has:

  • Node.js 20.0.0 or later (the CLI's engines field requires node >= 20.0.0)
  • Git: templates are distributed as Git repositories, so Git must be available when creating projects
  • Any package manager: npm (bundled with Node.js), pnpm, or yarn

Check your environment:

node --version   # must be >= v20.0.0
git --version

Install the CLI

Install globally via npm:

npm install -g agilebuilder

The package provides three executables:

CommandDescription
agilebuilderThe main CLI command
agA short alias for agilebuilder; the two are fully equivalent
agilebuilder-mcpThe MCP stdio server, configured into AI tools

You can also run it without installing via npx (handy for CI or one-off use):

npx agilebuilder --help
npx agilebuilder@latest create --git-url <url> --target ./app

Verify the installation

ag --version    # prints the version, e.g. 1.2.2
ag --help       # lists all commands

ag --help should show these commands: config, login, logout, auth, space, res, create, device.

Choose a backend region

The backend.profile config key controls which regional cloud service the CLI talks to:

ValueBehavior
auto (default)Picks the China region when the system locale/timezone indicates mainland China, otherwise the Global region
chinaUses the *.agilebuilder.cn endpoints
globalUses the *.agilebuilder.net endpoints
ag config list                          # show current config
ag config set backend.profile global    # set the region manually
ag config set language en-US            # CLI output language: auto / zh-CN / en-US

If you only use local features (no cloud sign-in), the region setting doesn't matter.

Data directory

The CLI stores its local data in:

~/.agilebuilder/v2

Main files:

FilePurpose
config.jsonCLI configuration
current-space.jsonThe currently selected workspace
resources/local.jsonLocal template and doc resources
auth.encEncrypted authentication credentials

You can override the data directory with the AGILEBUILDER_CORE1_DATA_DIR environment variable:

AGILEBUILDER_CORE1_DATA_DIR=/tmp/ag-data ag res list

Upgrade and uninstall

Upgrade to the latest version:

npm install -g agilebuilder@latest

Uninstall:

npm uninstall -g agilebuilder

Uninstalling does not remove the ~/.agilebuilder/v2 data directory. Delete it manually if you want a clean removal.

Next steps