> ## Documentation Index
> Fetch the complete documentation index at: https://docs.envlink.projectinwork.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up a coding agent

> Install envctl and the envlink skill where your coding agent runs, then ask it to build and test remotely by itself.

Install envctl and the envlink skill on the machine your coding agent runs on, then ask for a change. The skill teaches the agent the whole loop: lease a box, sync the project, build and test there, read the results, and delete what it leased.

<Steps>
  <Step title="Install envctl">
    ```bash theme={null}
    curl -fsSL https://envlink.projectinwork.com/install/install.sh | sh
    ```
  </Step>

  <Step title="Log in">
    Create a CLI token in the console (**Settings → CLI tokens**) for this machine, and log in:

    ```bash theme={null}
    envctl login --api https://envlink-api.projectinwork.com --token elk_...
    ```

    For an agent in a container or a cloud session, set `ENVLINK_API` and `ENVLINK_TOKEN` in its environment instead.

    <Warning>
      The token can lease and delete environments for your organization. Give each machine its own, so you can revoke one without the others.
    </Warning>
  </Step>

  <Step title="Make the project folder the sandbox">
    ```bash theme={null}
    cd ~/code/my-app
    envctl sandbox up
    ```
  </Step>

  <Step title="Install the skill">
    From the project's root:

    ```bash theme={null}
    envctl skills install
    ```

    This writes `SKILL.md` into the skills folder of each agent the project already uses, or Claude Code's when none is set up:

    | Agent | Project scope (default) | Global scope |
    | - | - | - |
    | Claude Code | `.claude/skills/envlink/SKILL.md` | `~/.claude/skills/envlink/SKILL.md` |
    | Codex | `.codex/skills/envlink/SKILL.md` | `~/.codex/skills/envlink/SKILL.md` |

    | Flag | What it does |
    | - | - |
    | `--agents claude,codex` | Install for these agents |
    | `--scope project\|global` | Into this project (default) or your home folder |
    | `--dir <folder>` | Into another agent's skills folder |

    Running it again updates the skill to match your envctl and reports `unchanged` when there's nothing to do. Commit the project-scoped skill so every checkout has it.
  </Step>
</Steps>

## Ask for a change

Open the project in the agent and ask, saying it should use envlink:

```text theme={null}
Fix the failing test in ./billing, run the tests on an envlink build box, and tell me the result. Delete the box when you're done.
```

## What the agent does

1. Checks envctl is logged in with `envctl templates`.
2. Leases a box with a label for the task: `envctl env create linux-build --share src=. --label task=billing-fix`.
3. Runs the build and tests with `envctl exec`, reading the output and exit code.
4. Reads results from `.remote/<box>/out/`.
5. Shares outputs with `envctl artifact put … --link 24h` if you asked for a link.
6. Deletes the box with `envctl env delete`.

The skill tells the agent never to print tokens, and never to send secret files unless you ask, which it then does with `--file`. See [The envlink skill](/agents/skill) for its full text.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.