Docs

CLI Reference

alien upgrade

Upgrade the Alien CLI to the latest stable release:

alien upgrade

alien update is an alias. The command verifies standalone downloads before replacing the executable. npm and Homebrew installations are upgraded through their package manager so the CLI does not overwrite package-managed files.

Use alien upgrade --dry-run to check what would happen without making changes, or alien upgrade --force to reinstall the current stable version.

alien login

Authenticate in the browser and select a default workspace:

alien login

New accounts do not receive an automatically named workspace. Create one explicitly in the dashboard or with alien workspaces create.

To use a manager you run instead of alien.dev, pass its URL and an API key:

alien login --manager https://manager.example.com --token ax_admin_...

Every command then targets that manager until alien logout or the next alien login. In CI, set ALIEN_MANAGER_URL and ALIEN_API_KEY instead. See Self-hosting.

alien workspaces

Create, list, and select workspaces:

alien workspaces create acme-prod
alien workspaces ls
alien workspaces set acme-prod
alien workspaces current

The workspace name is permanent and appears in dashboard URLs and CLI commands. Use 4–100 lowercase letters, numbers, and hyphens.

alien init

Add an Alien workspace to an existing repository:

alien init

Choose a small architectural starting point. Inside an existing repository, Alien creates an alien/ directory containing alien.ts, workload code, and its dependencies. Inside an empty directory, Alien initializes the current directory.

Choose the template and destination explicitly for automation or a custom repository layout:

alien init remote-worker-ts packages/private-runtime
cd packages/private-runtime

The interactive catalog is intentionally small: private workers, data connectors, event pipelines, HTTPS services, and minimal TypeScript workers. Complete applications and provider-specific examples remain available in the tutorials, with links to their source on GitHub.

alien dev

Start the local development environment:

alien dev

Provisions all resources locally (embedded SQLite for KV/Queue, filesystem for Storage) and starts your workers as native processes. Hot-reloads on code changes.

Restarting the command preserves the deployment and local data. Use alien dev destroy --name default when you want to delete them.

Example:

alien dev
# ✓ worker (worker) → http://localhost:3001
# ✓ data (storage) → local filesystem
# ✓ Server → http://localhost:9090

alien destroy

Remove a deployment's resources with access to its project and cloud setup credentials:

alien --project my-project destroy --name dep_0123456789012345678901234567 --platform aws

The target can be a deployment ID, <group>/<name>, or a unique name in the selected project. An Alien login can resolve the deployment even if this machine did not install it. Local tracking remains supported.

For deployment-token authentication, supply the deployment's own token. Prefer its immutable deployment ID; a group-qualified name requires the manager to include the parent group name in the authorized deployment response. Deployment tokens cannot list deployments:

alien destroy --name production --platform aws --token "$ALIEN_DEPLOYMENT_TOKEN"

--force forgets the deployment record without removing cloud resources. Use the normal command to finish a deployment in teardown-required status.

alien serve

Run a manager on this machine:

alien serve

Starts an HTTP server backed by SQLite. Manages deployments, dispatches commands, collects telemetry, and hosts an embedded artifact registry.

Options:

FlagDescription
--initGenerate a starter alien-manager.toml config file
--config <path>, -cPath to config file (default: alien-manager.toml)
--port <port>Override the HTTP server port
--host <host>Override the HTTP server bind address

Example:

# Generate config
alien serve --init

# Start with defaults
alien serve

# Start with custom config
alien serve --config /etc/alien/manager.toml

On first run, generates an admin API key and prints the alien login command to connect to it. To run a manager in production, see Self-hosting.

alien build

Build your stack into deployable output:

alien build --platform <platform>
alien build --platforms <platform1>,<platform2>

Compiles your TypeScript code or container image, packages the outputs where needed, and validates the stack.

Builds are content-hashed — if your code hasn't changed, the build completes instantly by reusing the previous output.

Options:

FlagDescription
--platform <platform>, --platformsTarget platform(s): aws, gcp, azure (comma-separated for multiple) (required)
--config <path>, -cPath to alien.ts/alien.js/alien.json file or directory
--output-dir <dir>, -oOutput directory for build files
--targets <targets>Target OS/architecture combinations (comma-separated)
--cache-url <url>Cache URL for build caching (e.g., s3://bucket/path)
--jsonEmit structured JSON output

Examples:

alien build --platform aws
alien build --platforms aws,gcp
alien build --platform aws --targets linux-arm64

alien release

Create a new release:

alien release

Builds your code, pushes images to the registry, and creates a release. Active deployments pick up new releases automatically.

Alien rebuilds during release so the release reflects the code you publish. If nothing changed, content-hash deduplication can reuse the previous output. Pushed images are reused when the same image is already in the registry.

Options:

FlagDescription
--platforms <platforms>Comma-separated list of platforms to release (auto-discovers from manager config if not specified)
--project <name>Project name or ID (skips project linking)
--channel <name>Channel to advance (defaults to production)
--prebuiltSkip build and push — uses pre-pushed image URIs from stack.json
--no-gitSkip git metadata collection
--jsonEmit structured JSON output

Examples:

alien release
alien release --platforms aws,gcp
alien release --prebuilt
alien release --channel staging

alien releases promote

Promote an existing immutable release to a channel without rebuilding it:

alien releases promote <release-id> --channel production

Promotion is concurrency-safe: the CLI reads the channel's current release and the API only moves the channel if it still points there, so a stale promotion cannot overwrite a newer one. Promoting an earlier release is the standard rollback — the same tested artifacts, no rebuild.

Create and inspect channels with:

alien releases create-channel staging
alien releases channels
alien releases delete-channel staging

alien deployments set-channel

Change the channel an unpinned deployment follows:

alien deployments set-channel <deployment-id> staging

If the deployment is pinned, it stays on the pinned release and starts following the new channel only after it is unpinned.

alien onboard

Onboard a new customer and generate a deployment token:

alien onboard <name>

Creates a deployment group and returns a token the customer uses to set up their environment.

Options:

FlagDescription
--platform <platform>, --platforms <platforms>Limit the deployment link to selected platforms; defaults to all platforms in the active release
--input <id=value>Provide a non-secret developer stack input
--secret-input <id=value>Provide a secret developer stack input; redacted in output
--max-deployments <n>Maximum deployments allowed for this deployment group
--airgappedRegister a deployment that can't reach your manager; the site keeps it up to date with alien-deploy sync. See Air-gapped deployments.
--jsonEmit structured JSON output

Example:

alien onboard acme-corp \
  --platforms aws \
  --secret-input controlPlaneApiKey=sk_live_...
# Deployment token: ax_dg_abc123...
# Send this to the customer's admin.

For Kubernetes, alien onboard prints the helm install command for the customer, pulling the chart from your manager, and a values.yaml for their infrastructure. With --airgapped, it prints the site's token, the key the site verifies updates with, and the alien-deploy sync command that starts the first sync. See Kubernetes.

If required developer-provided stack inputs are missing, alien onboard validates them and prompts in interactive terminals. Platform-scoped inputs are required only when the selected platforms need them; use --platforms aws to avoid collecting local-only values for an AWS-only link. Deployer-provided inputs are collected later by the deployment portal or project-branded deploy CLI.

alien deploy

Deploy a release to a cloud platform:

alien deploy --name <name> --platform <platform>

Options:

FlagDescription
--name <name>Deployment name; can also be set in the deploy config
--platform <platform>Target platform; can also be set in the deploy config
--config <path>Deployment settings in TOML or JSON
--token <token>Deployment API key for authentication
--channel <name>Release channel followed by a new deployment (defaults to production)
--no-heartbeatDisable heartbeat capability
--monitoring <mode>Telemetry mode: auto (default) or off
--network <mode>Network mode: auto (default), use-default, create, or byo
--network-cidr <cidr>CIDR block for --network create
--availability-zones <n>Number of zones for --network create
--vpc-id <id>Existing AWS VPC ID for --network byo
--public-subnet-ids <ids>Comma-separated AWS public subnet IDs for --network byo
--private-subnet-ids <ids>Comma-separated AWS private subnet IDs for --network byo
--security-group-ids <ids>Comma-separated AWS security group IDs for --network byo
--network-name <name>Existing GCP VPC network name for --network byo
--subnet-name <name>Existing GCP subnet name for --network byo
--network-region <region>GCP subnet region for --network byo
--vnet-resource-id <id>Existing Azure VNet resource ID for --network byo
--public-subnet-name <name>Azure public subnet name for --network byo
--private-subnet-name <name>Azure private subnet name for --network byo

Example:

alien deploy --name acme-production --platform aws
alien deploy --name bear-test --platform aws --channel staging
alien deploy --name acme-production --platform aws --network create --availability-zones 3

Network flags are converted to deployment stack settings. See Networking and Network.

For a public AWS container, configure a customer domain under its resource ID (gateway in this example):

name = "production"
platform = "aws"

[domains.customDomains.gateway]
domain = "api.example.com"

[domains.customDomains.gateway.certificate.aws]
certificateArn = "arn:aws:acm:us-west-2:123456789012:certificate/REPLACE"

Run alien deploy --config deploy.toml. The ACM certificate must be issued, cover the hostname, and belong to the load balancer's AWS account and region. Point your DNS record to the load balancer endpoint reported by the deployment.

The config supplies domains when creating a deployment. Resuming setup with different domain settings fails explicitly; it does not silently change an existing deployment. For CloudFormation setup, use DomainName and CertificateArn. When the stack has multiple public HTTP resources, DomainResource selects which one receives that hostname.

alien deployments ls

List all active deployments:

alien deployments ls

Shows deployment status, platform, current release, and a separate desired release when a rollout has not converged. --json returns deployment records, including workspace, project, and deployment-group identifiers. Local and standalone modes return manager deployment records. JSON output never prompts.

alien deployments get

Show one deployment, its current and desired releases, stack resources, and timestamped provider observations for container and daemon images:

alien deployments get <name-or-id>
alien deployments get <name-or-id> --json

An observed image is what the provider last reported, not the desired stack configuration. A mismatch is shown as rollout pending; a stale observation is labeled separately.

alien deployments retry, redeploy, and pin

alien deployments retry <name-or-id> [--json]
alien deployments redeploy <name-or-id> [--json]
alien deployments pin <deployment-id> [release-id] [--json]
  • retry resumes the failed operation toward the existing desired release.
  • redeploy starts a fresh rollout of the current release and is intended for a running deployment.
  • pin selects a release explicitly; omit release-id to unpin and return to the current release of the deployment's channel.

All three commands preserve structured API error codes, remediation hints, retryability, and request IDs. --json emits only the API response and does not prompt.

alien releases ls

List releases that have been selected by production, with immutable commit SHA and source ref. This includes the channel's rollout history, not only its current release. Select another channel explicitly, or opt into release history across all channels:

alien releases ls
alien releases ls --channel staging
alien releases ls --all-channels
alien releases ls --json

alien releases get

Show an immutable release and correlate it with deployments that are targeting or already running it:

alien releases get <release-id>
alien releases get <release-id> --json

alien tokens

Create, list, and revoke scoped tokens on a manager you run:

alien tokens create --tunnel                    # calls tunnels only
alien tokens create --tunnel --customer acme    # only acme's deployments
alien tokens ls
alien tokens revoke <id>

The token is shown once. See Tokens and Tunnels.

alien vault

Manage vault secrets for a deployment:

alien vault <action>

See Environment Variables for details on managing secrets across deployments.

Commands for agents and automation

These commands accept stable, machine-readable output. Use --json when another program will read the result; it also disables interactive prompts where supported.

Inspect the current context

alien whoami
alien projects get --json
alien projects capabilities status --json
alien status --json

alien status <deployment-group>/<deployment> returns one deployment. Without a deployment, it lists the linked project.

Wait for a deployment

alien deployments wait acme/production \
  --for ready \
  --timeout 10m \
  --json

--for accepts ready, terminal, or deleted. Use this instead of writing a polling loop around deployments get.

Inspect resources and machines

alien deployments resources acme/production --json
alien deployments machines acme/production --json

resources returns a safe summary without resource configuration or secrets. machines returns the connected machine inventory and network-health observations.

Configure project capabilities

alien projects capabilities enable ai \
  --model byo/claude-opus-5

alien projects capabilities enable encryption

alien projects capabilities enable remote-sandbox \
  --base-image public.ecr.aws/example/analysis:v1 \
  --max-session-lifetime-seconds 3600 \
  --json

alien projects capabilities status --json

For AI, repeat --model, --required-model, or --provider to configure more than one value.

For remote sandboxes, both --base-image and --max-session-lifetime-seconds are required. Use a public container image and a session limit between 1 and 28800 seconds (8 hours). The CLI validates these flags before looking up your workspace or project. This command configures the project's sandbox capability; it does not start a sandbox session.

Create scoped API keys

alien api-keys create --for ai-gateway
alien api-keys create --for encryption-gateway --json
alien api-keys create --for remote-bindings
alien api-keys list --json
alien api-keys revoke <key-id> --yes

The create command prints the secret once. --for selects a least-privileged project role; it accepts ai-gateway, encryption-gateway, deployments, remote-bindings, or read-only.

Find customer environments

alien deployment-groups list --json
alien deployment-groups get org_123 --json
alien deployment-groups list --search acme

get accepts a deployment-group ID, name, or external ID. customers and customer are aliases for deployment-groups.

alien examples ai-gateway \
  --protocol openai-chat \
  --model byo/claude-opus-5

alien examples ai-gateway --protocol anthropic-messages
alien examples encryption-gateway --operation encrypt
alien examples encryption-gateway --operation decrypt --json

Generated examples use the active Alien environment. Secrets remain environment-variable references. Add --json to receive the service, endpoint, command, and required environment variables as structured data.

Search gateway diagnostics

alien logs --source ai-gateway \
  --status provider-error \
  --provider anthropic \
  --since 24h \
  --json

alien logs --source encryption-gateway \
  --operation decrypt \
  --status failed

AI diagnostics can be filtered by --model and --provider; Encryption diagnostics by --operation. Both accept --deployment-group and the standard log time filters.

Inspect gateway usage

alien usage ai --range 24h
alien usage encryption --range 30d --json

Ranges are 24h, 7d, and 30d. The command reports that usage is unavailable when the project has no metrics source instead of inventing zeroes.

Invoke an operation directly

alien operations list

alien operations invoke \
  --deployment acme/production \
  --operation kubernetes/get-pods \
  --params '{"namespace":"default","maxResults":10}'

Operations use the <plugin>/<operation> form. The command waits for the result. When the project policy requires approval and you have no approved access request for the operation, the command does not run it and prints how to request access.

FlagDescription
--deployment <id-or-group/name>Target deployment (required)
--operation <plugin>/<operation>Operation to run (required)
--params <json>Operation parameters (default: {})
--timeout <seconds>How long to wait for the result (default: 60)
--request-accessCreate an access request, wait for the customer to approve it, then run the operation
--access-duration <duration>Approval window to request with --request-access (default: 1h)

Request access

alien access-requests create \
  --deployment acme/production \
  --operation kubernetes/restart-pod \
  --params '{"namespace":"default","pod":"api-123"}' \
  --duration 1h

alien access-requests create \
  --deployment acme/production \
  --operation 'kubernetes/*' --max-risk read-only --duration 1h

alien access-requests create \
  --deployment acme/production \
  --debug-tool kubectl --debug-namespace my-product --duration 30m

alien access-requests get ar_123
alien access-requests wait ar_123

An access request asks the customer for time-limited access to one operation, to every operation of a plugin up to a risk tier, to a debug session, or to operations and a debug session together. --duration is at most 6h. The customer approves in their environment. No CLI command approves a request.

FlagDescription
--operation <plugin>/<operation>One exact operation, or <plugin>/* for every operation the plugin exposes now
--params <json>Parameters of an exact operation
--max-risk <tier>Highest tier a <plugin>/* request covers: read-only, mutating, or destructive (required for a wildcard)
--debug-tool <tool>Debug tool to request: kubectl, aws, gcloud, or az
--debug-namespace <namespace>Limit a kubectl debug request to one namespace
--debug-cloud-scope <scope>Limit an aws, gcloud, or az debug request to one account, project, or subscription
--duration <duration>Requested approval window, such as 30m or 1h
--title <text>, --reason <text>Text shown to the approver

alien access-requests wait waits up to --timeout seconds (default: 3600).

Only the principal that created a request can use its approval, for alien operations invoke and for alien debug. A user's request does not cover an API key, and an API key's request does not cover a user.

Debug a deployment

alien debug acme/production --request-access -- kubectl get pods -n my-product
alien debug acme/production --access-request ar_123 -- kubectl get pods -n my-product
alien debug acme/production --access-request ar_123

alien debug runs a local command, or a shell when you give no command, against a deployment. See Remote debugging.

FlagDescription
--access-request <id>Approved access request that authorizes the session
--request-accessCreate a debug access request for the tool in the command, wait for approval, then start the session
--access-duration <duration>Approval window to request with --request-access (default: 30m)
--access-cloud-scope <scope>With --request-access, limit an aws, gcloud, or az request to one account, project, or subscription
--jsonEmit errors as JSON

A session ends when its access request expires.

Preview operation permissions offline

Compile a plugin's metadata.json into the operation grants used during setup:

alien operations permissions ./my-plugin --cloud aws \
  --s3-bucket-arn arn:aws:s3:::customer-data \
  --sqs-queue-arn arn:aws:sqs:us-east-1:123456789012:customer-events \
  --json

alien operations permissions ./my-plugin --cloud gcp \
  --gcs-bucket customer-data --json

alien operations permissions ./my-plugin --cloud kubernetes \
  --permission diagnostics --json

This command needs no login or network connection. Repeat the bucket or queue flags to allow several resources. Missing resource limits, unknown capabilities, and unsupported wildcard grants fail instead of producing broader access.

The JSON result contains plugin, cloud, and permissions. AWS returns IAM statements with their reasons and operation sources. Google Cloud separates project grants from bucket grants and lists the selected buckets. Kubernetes returns RBAC grants; --permission remediation includes supported writes. Setup places these grants in the installation's selected namespace or cluster scope and adds the operator's own permissions, which are not in this output. See Kubernetes permissions.

Custom plugins declare reviewed AWS capabilities by name, such as operations/s3/head-object. Their inline AWS grants are rejected. Use --builtin only when inspecting reviewed built-in source definitions. Azure operation permissions are not supported yet.

Build and publish a custom operations plugin

alien operations init my-plugin
alien operations check ./my-plugin
alien operations test ./my-plugin
alien operations package ./my-plugin
alien operations publish ./my-plugin/my-plugin-0.1.0.zip
CommandDescription
alien operations init <name> [directory]Create a plugin with typed operations and a generate-metadata binary. The directory defaults to ./<name>.
alien operations check [directory]Validate metadata.json, then build and run the plugin's generate-metadata binary with --check. Fails when metadata.json differs from the generated metadata or the binary is missing. --manifest-only validates metadata.json without building or running plugin code.
alien operations test [directory]Validate metadata.json, then run cargo test in the plugin directory.
alien operations docs [directory]Generate MCP tool schemas and a Markdown reference page from metadata.json.
alien operations package [directory]Run the same metadata check as check, build a Linux release binary for the host architecture, and write <name>-<version>.zip in the plugin directory.
alien operations publish <bundle>Upload a bundle to the project. Rejects a bundle when an operation in its metadata.json has no inputSchema or outputSchema object.

init, check, test, docs, and package need no login. cargo may download the plugin's dependencies. See Build a custom plugin.

On this page