CLI Commands
The Archibald CLI ships 13 commands: add, build, depolier, docker, e2e, link, lint, maestro, package, serve, storybook, test and upgrade-diff. The three commands central to the application lifecycle — serve, build, and package — are described below; see the CLI usage guides for the full command and flag reference.
1. serve (Development)
Starts a local development server with Hot Module Replacement (HMR).
What it does:
- Compiles the application in
developmentmode. - Starts the Hapi.js server for SSR or a static server for CSR.
- Enables file watching and HMR for both the client and server parts.
- Opens the application in the default browser (optional).
Key Options:
--tenant <name>: Specify which tenant's code and config to use.--platform <name>: Choose one of the project's platforms, as configured underproject.platformsin the Archibald config (e.g.shop,app,portal). For native targets (web,ios,android) use--native.--ssl: Serve the application over HTTPS using either manual or automatic (MKCert) certificates.
See serve for the full flag list.
2. build (Compilation)
Compiles the application and prepares it for deployment.
What it does:
- Executes a full production build by default.
- Generates optimized, minified chunks (JS, CSS).
- Produces the
loadable.jsonmanifest for SSR asset discovery. - Generates service workers (if active).
- Can optionally build for Vercel outputs or CCV2 (SAP Commerce Cloud) structure.
Key Options:
--mode <development|production>: Forces the compilation mode.--analyze: Generates an Rsdoctor bundle analysis.--vercel: Automatically formats the output for Vercel deployment.
See build for the full flag list.
3. package (Distribution)
Groups the build output with environment-specific configurations into a distributable archive.
What it does:
- Triggers the
buildcommand first (if not skipped). - Resolves and injects the
config.jsfor every target environment (e.g.,prod,qa,stage). - Creates a ZIP archive of the entire distribution folder.
Why use it?
The package command ensures that the same build artifact (JS/CSS chunks) can be deployed across multiple environments. It decouples the application logic from the environment-specific secrets and URLs, following the "Build Once, Deploy Anywhere" principle.