Skip to content

Environments

Configure the variables, files, skills and MCP servers loaded into each project run.

An Environment is a named bundle of variables, files, skills and MCP servers that every cycle run in a project loads into its checkout. A project can hold several, and exactly one is active at a time. Use it to supply consistent configuration to every run.

  • A project in your Workspace.
  • manage access on the project.
  • Credential values stored as project secrets.
Key Type What happens to it at run time
vars Map of name to value Merged into the project’s environment values and delivered the same way a project secret is
files List of { path, content } Written as-is into the run’s checkout, relative to the repository root
skills List of skill slugs Each named skill is copied from hlix’s skill library into .claude/skills/<slug>/ in the checkout
mcpServers List of server definitions Merged into the checkout’s .mcp.json, keeping anything the repository already declares
managedPaths List of paths The paths hlix writes and manages, so it can update them without touching your edits elsewhere
Terminal window
curl -sS -X POST "$HLIX_BASE_URL/v1/api/environments/project/$PROJECT_ID" \
-H "x-api-key: $HLIX_API_KEY" \
-H "X-Organization-Id: $HLIX_WORKSPACE_ID" \
-H 'content-type: application/json' \
-d '{
"label": "Default",
"isActive": true,
"config": {
"vars": { "NODE_ENV": "test" },
"files": [{ "path": ".nvmrc", "content": "22\n" }],
"skills": ["api-design-review"]
}
}'

Expected result: 201 and the stored Environment, with isActive: true.

label is required and capped at 100 characters. vars defaults to an empty map, and files, skills, mcpServers and managedPaths are all optional.

Terminal window
curl -sS "$HLIX_BASE_URL/v1/api/environments/project/$PROJECT_ID" \
-H "x-api-key: $HLIX_API_KEY" \
-H "X-Organization-Id: $HLIX_WORKSPACE_ID"

Expected result: 200 and the project’s Environments, newest first, each with its own isActive flag.

PATCH /v1/api/environments/project/{projectId}/{id} changes the label, the config or the active flag. DELETE /v1/api/environments/project/{projectId}/{id} removes one.

The active Environment applies to each cycle run, including its files, skills and MCP configuration. Project secrets override variables of the same name. All supported harnesses receive the bundle.

Use project-relative file paths. Absolute paths, .. segments and symlinked parent directories are rejected.

  • {"error":"Project not found"} with 404. The project is not in the Workspace named by X-Organization-Id.
  • {"error":"Environment not found"} with 404. The Environment id does not belong to that project.
  • {"error":"Failed to create environment"} with 500. Check the project’s Environment list before retrying. If no entry was created and the error repeats, contact support with the request ID.
  • A variable is missing inside the run. Only the active Environment is loaded. Check isActive, and check that a project secret of the same name is not overriding it with a different value.
  • A skill you listed is not in the checkout. The slug is not in the skill library, so it was skipped. Check the slug against Packs & skills; a Workspace custom skill is delivered as a file, not as a skills slug.
  • A file you listed is not in the checkout. Use a project-relative path within the repository, with no .. segments, and check permissions on its parent directory.
  • An MCP server is in the bundle and the harness does not see it. Check the server’s authorization, reachability and required secrets. See MCP servers.
  • A run fails naming a missing secret. MCP server … requires missing project secret … — an imported MCP server references an environment key that has no project secret behind it. Add the secret, or re-import the server.