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.
compartment init writes a compartment.yml descriptor file into the current directory. The file links your repository to a named Compartment project and defines a default service entry pointing at the project root. You can then edit the file to add services, configure builds, and set routing rules before running compartment deploy.
Usage
Options
| Flag | Type | Default | Description |
|---|---|---|---|
--name <slug> | string | — | Project name slug to use in the generated file. If omitted, Compartment derives a name from the current directory or prompts you interactively. |
--output <format> | text | json | text | Output format. Use json for machine-readable output in CI pipelines. |
If
--name is not provided and the terminal is non-interactive (for example, inside a CI job), Compartment falls back to deriving a slug from the directory name. If it cannot produce a valid slug, the command exits with an error and asks you to re-run with --name.Generated file
Runningcompartment init creates a compartment.yml file similar to the following:
compartment.yml
name field is the project slug. The web service entry points at the repository root (.), using the shorthand path form. Run compartment descriptor schema to view the full schema and add additional options such as build strategy, readiness checks, and access modes.