Rules for agents
- Show the user each command you run. Nothing here needs sudo.
- Never ask for a box key, GitHub password or code in the chat. A GitLab runner token goes to box through stdin (step G2), never into a file, a commit or the shell history.
- Installing a GitHub App and topping up are the user’s actions. Give them the link and keep going; do not click for them.
- Change only the line that picks the machine (
runs-onortags) in jobs that need macOS. Leave Linux and Windows jobs as they are. - Open a branch and a pull request for the change. Do not push to the default branch.
1. box installed and signed in
accounts, balance, ci (exit 0): go to 2. box: command not found, or exit 4 (not signed in): follow steps 1 and 2 of Agent setup, then run box ci status again.
balance $0.00 means no CI job will start until the user runs box topup. Jobs wait in GitHub’s or GitLab’s queue and nothing is charged; tell the user once and carry on.
2. Which CI
Look at the repository:.github/workflows/*.yml is GitHub Actions (go to GitHub), .gitlab-ci.yml is GitLab CI (go to GitLab). Both: do both.
GitHub Actions
G1. Connect the account
Find the owner of the repository (git remote get-url origin). An organization uses --org; a personal account uses --personal.
<owner> and the repositories, press Install.” The two links are:
Then wait for it without asking the user:
provider github), for up to 10 minutes. If it never appears, ask the user once whether they pressed Install on the account that owns the repository.
The app asks only for what runner registration needs (see GitHub Actions); it cannot read or change code, pull requests or workflow files. That is why the workflow change in G2 is yours to make.
G2. Change the workflow in a pull request
In each workflow job that runs on macOS (runs-on: macos-latest, macos-15, macos-26 and so on), change only that line:
gh, push the branch and give the user the compare link GitHub prints.
G3. Watch the first job
The pull request starts the workflow. Within a minute:running or succeeded means it works: tell the user the pull request is ready to merge. If GitHub shows the job waiting with no row here after 5 minutes, check that runs-on is exactly xenoci and that the repository was picked in G1 (box ci accounts).
GitLab CI
L1. Ask for a runner token
GitLab makes runner tokens only in its web page, so this is the user’s step. Send them:In GitLab open the project (or group) Settings > CI/CD > Runners > New project runner. Set Tags toxenoci, leave Run untagged jobs off, press Create runner, and paste me the token that starts withglrt-.
L2. Connect it
Pass the token on stdin so it stays out of the shell history:--url https://gitlab.example.com. Check it:
provider gitlab is the runner. Do not keep the token anywhere after this.
L3. Tag the macOS jobs
In.gitlab-ci.yml, give each job that needs macOS the tag, on a branch with a merge request:
xenoci. An untagged job or one with other tags is failed before any Mac starts (no charge) and the runner is paused; fix the tags in GitLab, then connect again.
Watch the first job the same way: box ci jobs, then box ci logs <job id> --follow.
When a CI job fails
box ci debug prints the job, the step that failed, a hint and the last 200 log lines. Fix the cause in the repository and push again; to try a fix on a Mac without a CI run, use box exec or box test in the same folder.
MCP
With the box MCP server connected (box setup), the same steps are the tools ci_status, ci_connect (returns install_url at once), ci_accounts, ci_gitlab_connect, ci_jobs, ci_logs and ci_debug. Every CLI command above also takes --json.