@archlast/cli
v0.2.2
Published
Archlast CLI for development and deployment
Readme
Archlast CLI
CLI tool for Archlast development, deployment, and Docker lifecycle management.
Requirements
- Node.js 18+
- Docker Desktop or Docker Engine
- Bun 1.3+
Installation
npm install -g @archlast/cliOn Windows, ensure Bun is on your PATH (the installer adds it, but terminals need a restart):
[Environment]::SetEnvironmentVariable(
"Path",
"$env:Path;$env:USERPROFILE\\.bun\\bin",
"User"
)Quick start
archlast init
archlast start
archlast status
archlast logs --followTo watch and auto-deploy functions during development:
archlast dev --path ./archlast --server http://localhost:4000Commands
dev- watcharchlast/srcfor changes, regenerate types, and deploy deltasdeploy- one-time deployment to the serverbuild- generate types without deployingpull- pull schema/files from the server, or use--dockerto pull an imageinit- scaffold the minimal Archlast project structurestart/stop/restart- manage the Docker containerstatus- print container status and healthlogs- stream container logsupgrade- pull a new image and restart the containerconfig- show resolved Docker config (use--jsonfor JSON)generate crud <collection>- scaffold CRUD handlers from schemadata- snapshot/export/import/restore data (requiresARCHLAST_API_KEY)
Common options
--path <path>points to your Archlast project folder--server <url>sets the API base URL (default:http://localhost:4000)--port <port>overrides the container port forstartandupgrade--config <path>points toarchlast.config.js--name <name>sets the project name when runninginit
Configuration
The CLI reads configuration in this order:
- CLI flags
archlast.config.js.envor.env.local- defaults
Example archlast.config.js:
export default {
docker: {
image: "algochad/archlast-server",
tag: "latest",
containerName: "archlast-server",
restartOnDeploy: true,
},
server: { port: 4000 },
paths: {
config: ".archlast/config",
deploy: ".archlast-deploy",
},
cors: { origins: ["http://localhost:3000"] },
env: {
ARCHLAST_DASHBOARD_PORT: "4001",
ARCHLAST_STORE_PORT: "7001",
},
};Environment variables starting with ARCHLAST_, S3_, AWS_, and STORAGE_
are forwarded into the container.
If containerName or volumeName is not set, the CLI generates unique names per
project to keep data isolated.
The CLI stores per-project metadata in .archlast/project.json and persists the
selected port when it has to pick a new one.
When restartOnDeploy is enabled, archlast dev and archlast deploy restart the
Docker container after a successful upload.
Dev and deploy flow
The server receives deployments at POST /_archlast/deploy with payload:
{
functions: Array<{
name: string;
type: "query" | "mutation" | "action";
filePath: string;
code: string;
}>;
schema: { filePath: string; code: string } | null;
timestamp: number;
}Data management
Use the data command group to snapshot, export, import, and restore data.
Set ARCHLAST_API_KEY in your environment for authentication.
Examples:
archlast data snapshot --name "pre-migration"
archlast data export ./backup.zip
archlast data import ./backup.zip --strategy merge
archlast data restore snapshot-2026-01-01.zipPublishing (maintainers)
See docs/npm-publishing.md for the release workflow and manual publish steps.
