Repositories
Attach repositories and configure their branches, setup commands and verification commands.
A project’s repositories contain the code its agents work on. A project can have several repositories; each cycle targets one. Configure a separate default branch, setup command and verification command for each repository—for example, npm test for a frontend and pytest for a service.
A project created without one of yours gets a managed repository instead — see Projects without a GitHub repository.
Prerequisites
Section titled “Prerequisites”- A project in your Workspace.
- An agency role with
manageaccess on the project. - For a GitHub-backed repository, the hlix GitHub App installed on the owning account — see GitHub.
What a repository carries
Section titled “What a repository carries”| Field | What it does |
|---|---|
owner / name |
Repository identity. Fixed for an attachment. Detach it and attach another repository to change the identity |
label |
An optional display name, for a project with several repositories |
defaultBranch |
The base branch for a cycle on this repository when nothing else says which. Per repository — a frontend on main beside a service on develop is normal |
setupCommand |
A shell command run in every fresh coding-run checkout before the harness starts. Up to 4,000 characters |
verifyCommand |
The build or test command run after the harness’s turn. See Verification |
isPrimary |
The project’s default repository for the surfaces that need one. Exactly one per project |
Attach a repository
Section titled “Attach a repository”curl -sS -X POST "$HLIX_BASE_URL/v1/api/projects/$PROJECT_ID/repos" \ -H "x-api-key: $HLIX_API_KEY" \ -H "X-Organization-Id: $HLIX_WORKSPACE_ID" \ -H 'content-type: application/json' \ -d '{"owner":"acme","name":"storefront","cloneUrl":"https://github.com/acme/storefront.git","defaultBranch":"main"}'Expected result: 201 and the repository, with isPrimary set to true when it is the project’s first.
The first repository attached becomes the primary. Change it with POST /v1/api/projects/{id}/repos/{repoId}/primary, which demotes the current primary and promotes the new one in one step.
Use a bare repository URL, such as https://github.com/owner/name.git. Hlix authenticates through the GitHub App installation; keep credentials out of clone URLs.
Branches and previews
Section titled “Branches and previews”Each repository has a cycle branch for the build agent’s changes and a project preview branch that collects reviewed work:
main your repository's default branch└── preview-<prefix>-<project-slug> the project's reviewed changes └── <prefix>/<cycle-title>-<id6> one cycle's workA cycle continues on the same branch after feedback or interruption. Its reviewed commit is integrated into preview; the final merge into the default branch requires your approval. Reviewing output shows the available pull requests and managed-repository merge actions.
<cycle-title> comes from the title when the cycle is created, followed by a short cycle ID. Renaming a cycle does not rename its branch. The preview branch’s project slug is also fixed once the branch exists.
Branch prefix
Section titled “Branch prefix”The prefix defaults to hlix. Set a Workspace default under Settings → Workspace, or a project’s prefix under Project settings → General, before its first branch is created. A project keeps that prefix once it has branches; changing the Workspace default affects only projects that have not created theirs.
Use 1–20 lowercase letters, digits, - or _, starting and ending with a letter or digit. An existing branch name, such as main, cannot be a prefix because Git cannot create main/… beside main.
Set the setup and verification commands
Section titled “Set the setup and verification commands”curl -sS -X PATCH "$HLIX_BASE_URL/v1/api/projects/$PROJECT_ID/repos/$REPO_ID" \ -H "x-api-key: $HLIX_API_KEY" \ -H "X-Organization-Id: $HLIX_WORKSPACE_ID" \ -H 'content-type: application/json' \ -d '{"setupCommand":"npm ci","verifyCommand":"npm test"}'Expected result: 200 and the updated repository.
setupCommand, verifyCommand, defaultBranch and label are the only patchable fields, and null clears either command.
The dashboard exposes the same fields in the project’s settings window under Environment, one row per repository, plus a project-wide verification default. See The dashboard.
Setup runs before the harness; verification runs after
Section titled “Setup runs before the harness; verification runs after”fresh checkout → setupCommand → the harness's turn → verifyCommandA failed setup command fails the run before the harness runs, and is safe to retry: the checkout is recreated on the next attempt. Both commands are bounded at 10 minutes each.
Both commands run for every harness alike. The setup command inherits the project’s resolved secrets, so an install against a private registry can authenticate.
Projects without a GitHub repository
Section titled “Projects without a GitHub repository”Every project has at least one repository. A project created without one of yours gets a managed repository that hlix hosts for it: cycles clone it, push their branches to it and review reads their diffs from it, exactly as with a connected repository. It appears in the project’s repositories as the primary one, with its own setup and verification commands.
The managed repository belongs to the project: it cannot be detached, and it is deleted with the project. Attach a GitHub repository whenever you want the work there as well.
A project-wide verifyCommand applies to every repository that does not set its own:
curl -sS -X PATCH "$HLIX_BASE_URL/v1/api/projects/$PROJECT_ID" \ -H "x-api-key: $HLIX_API_KEY" \ -H "X-Organization-Id: $HLIX_WORKSPACE_ID" \ -H 'content-type: application/json' \ -d '{"verifyCommand":"npm test"}'Expected result: 200 and the updated project.
Where a new project’s code starts
Section titled “Where a new project’s code starts”A project created without a GitHub repository gets a managed repository with a starter selected for the requested application. It includes the application structure, project instructions and verification configuration, so the first cycle can build on a prepared foundation.
| The brief asks for | The starter holds |
|---|---|
| A web application | apps/web (TanStack Start, Tailwind CSS) and apps/api (Hono), the web app calling the api through a typed client |
| A static or marketing site | apps/site (Astro, Tailwind CSS) |
| An API with no screens | apps/api (Hono) |
| A native mobile app | apps/native (Kotlin Multiplatform with SwiftUI and Jetpack Compose) |
| An iOS app | apps/ios (Swift, SwiftUI) |
| An Android app | apps/android (Kotlin, Jetpack Compose) |
| Flutter, React Native or Expo | The corresponding framework starter |
| Anything else, or it is not clear | The skeleton with no app yet |
A framework you name takes precedence over the default application starter. If there is no matching starter, hlix begins with the base project structure. The project’s preview and verification commands are filled in from the starter at creation, and the stack shown on the project names what the starter holds. Connected GitHub repositories start from their existing code.
Detach a repository
Section titled “Detach a repository”curl -sS -X DELETE "$HLIX_BASE_URL/v1/api/projects/$PROJECT_ID/repos/$REPO_ID" \ -H "x-api-key: $HLIX_API_KEY" \ -H "X-Organization-Id: $HLIX_WORKSPACE_ID"Expected result: 200 and {"message": "Repository detached."}.
Detaching removes the attachment, not the repository. Work already delivered to it stays where it is. A project always keeps at least one repository, so detaching the last one — or the managed repository — answers 409.
If attaching or updating a repository fails
Section titled “If attaching or updating a repository fails”{"error":"This repository is already attached to this project."}with409. Nothing to do — it is already there.{"error":"This repository is already attached to another project in this workspace."}with409. A repository belongs to exactly one project per Workspace. The response carries the holdingprojectId; detach it there first.{"error":"Repository not found"}with404. The repository id is not one of this project’s. A repository in another project answers404through this project’s URL.{"error":"Project not found"}with404. The project id is not in the Workspace named byX-Organization-Id. Check the selected Workspace and your project access.{"error":"No fields to update"}with400. The patch body was empty.- A
403on any write. These all needmanageaccess on the project. - Cycles fail with a branch error.
Branch "develop" not found in acme/storefront. Check that the branch exists and the GitHub token has access.— thedefaultBranchnames a branch that is not there, or the installation cannot see it. - Cycles fail naming a missing GitHub App installation. The account that owns the repository has no hlix GitHub App installation in this Workspace. Install the hlix GitHub App on that account. See GitHub.