Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.compartment.dev/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you through the complete deployment workflow: initializing a project, deploying it, and checking that everything is running. By the end you’ll have a live app managed by Compartment.
You must be logged in before running any of these commands. If you haven’t authenticated yet, run compartment login and follow the prompts.
1

Initialize your project

Navigate to your repository root and run init to create a compartment.yml descriptor:
compartment init --name my-app
Pass --name a lowercase, hyphen-separated slug that uniquely identifies your project. If you omit the flag in an interactive terminal, the CLI will prompt you with a suggested name derived from the current directory.The command creates compartment.yml at the repository root:
name: my-app

services:
  web: .
This minimal descriptor tells Compartment to deploy one service named web from the repository root. The service name, build path, and additional options can all be expanded — run compartment descriptor schema to see the full schema.
2

Deploy your app

From the same directory, run:
compartment deploy
Compartment reads compartment.yml, builds your service, runs readiness checks, and promotes the new build to live traffic. The CLI streams progress as the deployment moves through each stage.If you have multiple projects and want to be explicit, pass --project:
compartment deploy --project my-app
To target a specific environment other than the default production, use --env:
compartment deploy --env staging
3

Check deployment status

Once the deploy command completes, confirm the project is live:
compartment status --project my-app
The output shows each service, its current promotion stage, health status, and the URL where it is reachable. A healthy deployment reports active as the promotion stage.
4

View logs

Inspect live or recent output from your service:
compartment logs --project my-app
Use --service to narrow output to a single service when your project has more than one:
compartment logs --project my-app --service web
Logs include both your application’s stdout/stderr and Compartment’s own runtime events.

Next steps