Get started with the CLI
1. Install
The CLI ships as a .NET global tool. It targets .NET 8 (LTS) and runs on the .NET 8, 9 or 10 runtime.
Code
This installs the albuild command. Make sure the global tools folder is on your PATH (~/.dotnet/tools on macOS/Linux; %USERPROFILE%\.dotnet\tools on Windows).
Need the .NET SDK?
The tool needs a .NET runtime present. Install the SDK or runtime from dotnet.microsoft.com if dotnet --version fails.
2. Prerequisites
The CLI drives the businessdev.ALbuild PowerShell module, so it needs:
- PowerShell 7+ (
pwsh) onPATH. - The
businessdev.ALbuildmodule: install it with the CLI itself:
Code
- Docker in the right mode only on a host that will run BC containers (Windows containers on Windows). A Mac/Linux client that talks to a remote MCP host does not need Docker locally.
macOS: 'You must install or update .NET to run this application' from pwsh
If albuild commands fail with a runtime error pointing at pwsh.dll (e.g. it asks for Microsoft.NETCore.App 8.0.0 while you only have 9.x), your PowerShell was installed as a net8 dotnet-tool but only a newer .NET runtime is present. Fixes, best first:
- Install PowerShell as a real package so it's self-contained:
brew install powershell. - Or let it roll forward onto the newer runtime:
export DOTNET_ROLL_FORWARD=Major(add to~/.zshrc). Recent CLI builds set this for thepwshchild automatically.
3. Configure dependencies — albuild.json
This is the step that pays off the most. ALbuild's headline feature is a real transitive dependency resolver: it reads your project's app.json dependencies, resolves a mutually-compatible, transitively-complete set of packages from your configured feeds (plus Microsoft's first-party feeds, registered automatically), downloads them into .alpackages, and writes a dependencies.lock.json for reproducible builds. No hand-curated .alpackages, no "works on my machine".
You drive it with one committed file at the repo root — albuild.json — which ALbuild reads automatically, so you never repeat --country/--bc-version/feeds on the command line or in a pipeline.
Scaffold it, then add your feeds:
Code
The result is a small, source-controlled file:
Code
kindtells the resolver what a feed serves:apps(default, installable apps),symbols(compile-only symbol packages) orruntime(sealed runtime packages). Here, NuGet.org carries app/symbol packages and the 365 business development feed serves runtime packages.- Microsoft's feeds are automatic. The resolver always registers Microsoft's public symbol/app feeds (MSSymbols, AppSourceSymbols, MSApps), so you only list your ISV/partner feeds.
- Private feeds keep their key out of the file. Add
--api-key-env <VAR>(or"tokenEnv": "<VAR>"in the object) — it records the name of an environment variable holding the token, resolved at run time:
Code
Preview what would be resolved (downloads nothing), then restore for real:
Code
Mixed sources, one resolver
The same resolver also pulls Azure DevOps Universal Packages and committed local .app files, alongside NuGet v3 feeds, and pins Microsoft first-party apps to the target build. See the dependency resolver deep dive and the full albuild.json reference.
4. Check AL logic without a container
Before any of the walkthroughs below: not every question needs a container.
albuild probe interprets your AL locally, so "what does this actually return?" is
answered in a fraction of a second instead of a publish-and-test cycle.
Code
Probe refuses rather than guesses: anything it cannot model exactly returns a stable error code instead of a plausible-looking wrong answer. Treat it as a fast pre-check, then confirm with the real test run below. See Probing AL.
5. Walkthroughs
5.1 Local Windows developer — a container for local development
On a Windows box with Docker (Windows-container mode), everything runs locally — no --server.
Code
container new prints how to connect the moment the container is ready:
Code
Open the web client in your browser and sign in with those credentials. To restore your app's dependencies into the container and run the inner loop, then tear it down when you're done:
Code
Prefer the editor? Use the VS Code extension
The ALbuild VS Code extension creates and inspects BC containers, restores dependencies and runs the pipeline from the sidebar — the same engine, without leaving the editor. Great if you'd rather click than type.
5.2 GitHub Copilot (VS Code) — let the agent drive the CLI
Give Copilot's agent mode an instructions file so it runs the build/test loop through albuild instead of hand-writing pwsh/docker, and manages a single warm container per task. Commit .github/copilot-instructions.md:
Code
Open the repo in VS Code, switch Copilot Chat to Agent mode, and ask it to implement and validate a change. It runs the commands in the integrated terminal and reads the structured results — create once, iterate on the warm container, drop it at the end.
Want an automatic warm pool — or the native VS Code path?
For a real warm pool across sessions (automatic reuse + LRU eviction), point the CLI at a local MCP server with --backend mcp: container new then warm-reuses a matching container from the pool instead of building a new one. Alternatively, the ALbuild VS Code extension contributes the MCP server to Copilot automatically, so the agent gets typed ensure-container/deploy-and-test tools (warm pool + auto-cleanup) — see the MCP server guide.
5.3 Claude Code — let the agent drive the CLI
Claude Code drives the CLI through its shell. Commit a CLAUDE.md at the repo root with the same loop:
Code
Claude Code reads CLAUDE.md at session start and runs these via its shell tool, iterating build → publish → test against the one warm container and removing it when the task is done.
Or use the MCP server directly
Claude Code can also drive the ALbuild MCP server (typed tools, a warm pool and removal governance) instead of the CLI — drop a .mcp.json pointing at npx -y @365businessdev/albuild-mcp. See MCP server → Get started. On a Mac, point both the CLI and the MCP server at a remote host (next walkthrough).
5.4 macOS / Linux — drive a remote MCP host
You can't run a BC container on a Mac, but you can still compile. Run the heavy container work on a shared Windows MCP host and point the CLI at it. Two sides — the host (Windows server) and each client. The bearer token is generated on the host and handed to the client out-of-band; it is never written into mcp.json.
On the host (Windows + Docker):
Code
On each client (your Mac/Linux box):
Code
The token is read from ALBUILD_MCP_TOKEN at run time (--token-env <VAR> to choose another variable). Keep it in the environment / a secret store, not in the committed mcp.json.
Compilation is always local
Even when you target a remote host, albuild app build (and the build step of run pipeline) compile on the client: your AL source and the compiler stay on your machine. Only the container ops (publish, install, test, unpublish) go to the host, and the locally-built .app files travel there as uploads. This is the classic macOS flow: compile here, run there.
Make the remote host the default
So you don't repeat --server on every command, save it as the default. albuild mcp configure --server <name> --url <url> records a named profile in ~/.albuild/config.json and the first one configured becomes the default; pass --default to force it. When --server is omitted, the CLI resolves it in this order: --server → ALBUILD_SERVER env var → configured default → local.
Code
This gives you the natural split: on a Mac, set the default once and every command goes remote; on Windows, leave it unset to run local by default and opt into a host per-command with --server prod (or tell your agent to). ALBUILD_SERVER is the per-shell override, handy in CI.
Next: the full command reference.


