Environments

A box you start, a CI run and an agent at work all run on a machine made from one environment. So what passes in CI is what your agent works in and what you SSH into. One file, the Env Spec, says what that machine needs before work starts. It names the OS, the values every run gets, the stages that set the machine up, and the services it runs. Each stage, such as cloning a repository, runs in its own sandbox.

Check an Environment File

Check the file before you build an image, which saves the set-up machine for every box you make after it. The check reads the file and runs nothing on a cloud. You can follow the whole workflow, and Environment Files shows how the values, stages and services fit together.

mkdir link-env-example
cd link-env-example
cat > env.toml <<'EOF'
schema = 1
name = "app"
version = 1
EOF
lnk env check --spec env.toml

Create an Image

Connect your cloud account, then build a cloud image from the environment you checked. Your provider bills you for the stored image. The image and its hash explain the setup stages and how Local Link reuses an image.

lnk env image create --spec env.toml aws|gcp

Create a Box

lnk env create makes a box from the checked file on a connected cloud account. It builds the image when needed and waits for the services to start. Your provider bills you for these resources. You can also read how to make a box from the file, including what Local Link captures, when it asks you to confirm, and how a later restart works.

lnk env create --spec env.toml --cloud aws|gcp

More

An environment can hand secrets to its stages, and you decide which ones. It also keeps records and logs, and other programs can call it.

Give Secrets to an Environment

You save your permission for a file to receive a secret with Environment Approvals. The approval rules say what ties a permission to a file and when a change needs a new yes.

Find Records and Fix Failures

Configuration says where Local Link keeps records and logs. Security describes how stages are isolated and how secrets are handled. When setup, a service, or a job fails, Troubleshooting names the cause. Decisions gives the reasons environments use explicit files.

Call an Environment from Another Program

The Interface lists the commands other programs run. The Environment Contract defines the file and the shared types those programs use.