# StarSling Runners: agent-native CI (/)
## Introduction
StarSling speeds up GitHub Actions with hosted runners and coding-agent tools for CI. Use the [onboarding prompt](https://docs.starsling.dev/start) to install the GitHub App, set up Sling, and migrate your workflows with the correct runner labels. You can also follow the [manual quickstart](https://docs.starsling.dev/getting-started/quickstart). Learn more at [starsling.dev](https://starsling.dev).
[StarSling Runners](https://starsling.dev/products/runners) are an AI-native drop-in replacement for `ubuntu-latest`, `ubuntu-26.04`, and `ubuntu-24.04` that make your GitHub Actions up to 6x faster. StarSling agents do continuous deep scans of your CI setup and ship optimizations to keep speeding up your builds and save you minutes.
## Quick Start
2,000 free minutes for your first month — no credit card required.
### Onboarding Prompt
This prompt guides your coding agent through the complete StarSling setup: installing the [GitHub App](https://github.com/apps/starslingdev), installing and authenticating the [Sling CLI](https://docs.starsling.dev/sling-cli/installation), installing the [sling skill](https://docs.starsling.dev/skills/sling), and [migrating your workflows](https://docs.starsling.dev/configuration/migration-guide) with the correct runner labels. It pauses for the browser approvals and asks you to review the exact runner mapping before it creates a pull request.
````markdown title="AI prompt"
# Onboard a Repository to StarSling
Set up StarSling for the user's repository from start to finish: install the StarSling GitHub App, install and authenticate the Sling CLI, install the sling skill for the current coding agent, and migrate the repository's GitHub Actions workflows to StarSling Runners.
Pause whenever the user must approve something in a browser. Do not claim onboarding is complete until `sling doctor --agent` confirms the environment and the migration pull request has been created. If the Sling CLI cannot run on this machine (Step 3), still complete the migration and tell the user which Sling steps were skipped.
## Configuration
**Branch:** `migrate-starsling-runners`
**Label reference:** Before mapping any runner, fetch the current StarSling label reference:
```bash
curl -fsSL https://docs.starsling.dev/configuration/label-reference.md
```
It is the source of truth for which StarSling labels exist: OS versions, vCPU sizes, GPU labels, and the label recommended for `ubuntu-latest`. Only choose a target label that appears in it. If you cannot fetch it, tell the user, map only `ubuntu-latest`, `ubuntu-26.04`, and `ubuntu-24.04` to `starsling-ubuntu-26.04`, `starsling-ubuntu-26.04`, and `starsling-ubuntu-24.04`, and skip every sized label.
**Runner mapping:**
- This is a provider-only migration. The target must have the same Ubuntu version, CPU architecture, and vCPU count as the source, and no GPU unless the source has one. The only exceptions are GitHub's standard runners and `ubuntu-latest`, below. Treat a Linux label with no ARM marker (such as `arm` or `arm64`) as x64. If the label reference has no exact match, skip the label and flag it for manual review.
- Leave labels that already start with `starsling-` unchanged.
- GitHub's standard runners (`ubuntu-latest`, `ubuntu-26.04`, `ubuntu-24.04`) have 2 vCPU on private and internal repositories and 4 vCPU on public ones. Map them to the 4-vCPU StarSling label (no size suffix) in both cases. On a private or internal repository, say in the preview and the PR body that each job moves from 2 to 4 vCPU. On a public repository, say that GitHub's standard runners are free for public repositories, so StarSling minutes are a new cost. For every target, show its price per minute from the label reference.
- Map `ubuntu-latest` to the label the reference recommends for it. On GitHub, `ubuntu-latest` may still resolve to an older Ubuntu version for some repositories; in that case the migration is also an OS upgrade. Say so in the preview and the PR body, and ask the user to run the workflows before merging.
- When a source label explicitly names an Ubuntu version, preserve it, whatever the provider or label format (for example `2404` means Ubuntu 24.04).
- A label from another provider must state both its Ubuntu version and its vCPU count (for example `blacksmith-8vcpu-ubuntu-2404`). If either is missing, or you cannot tell whether a number is the vCPU count (for example `8x16` or a bare `-8`), skip the label. Never fall back to a default size.
- The organization's own runners are not migrated. GitHub larger runners have names the organization chooses (for example `ubuntu-latest-8-cores` or `ubuntu-24.04-16core`), so the name does not reliably state the OS version or size, and the runner may carry a static IP or private networking. An organization can even name one `ubuntu-24.04-8`. Before mapping, list the organization's larger runners:
```bash
gh api --paginate orgs/OWNER/actions/hosted-runners --jq '.runners[].name'
```
Skip any label that matches one of these names, and ask the user to check that runner's configuration in their GitHub organization settings. If you cannot list them (usually 403, because only organization owners can), say so in the preview. Do not use the self-hosted runner list to decide this: other providers' runners register as self-hosted runners too. Skip every label that is neither a GitHub standard runner label nor clearly named for another provider (such as a `blacksmith-` prefix), because it may be the organization's own runner.
- Skip macOS, Windows, ARM, and GPU runners from other providers, and Ubuntu versions the reference does not list (such as `ubuntu-22.04`). Flag each one for manual review.
Examples (labels must still be checked against the reference):
| Source | Target |
|---|---|
| `ubuntu-latest` | The label the reference recommends for `ubuntu-latest` (4 vCPU) |
| `ubuntu-24.04` | `starsling-ubuntu-24.04` (4 vCPU) |
| A third-party label that states Ubuntu 24.04 and 8 vCPU | `starsling-ubuntu-24.04-8` |
| A third-party label that states no vCPU count | Not migrated — size unknown |
| `starsling-ubuntu-24.04`, `starsling-ubuntu-24.04-gpu` | Unchanged — already StarSling |
| `ubuntu-latest-8-cores`, `ubuntu-24.04-16core` | Not migrated — the organization's own larger runner; check its configuration |
| `ubuntu-22.04` | Not migrated — no StarSling equivalent |
| `ubuntu-24.04-arm`, `macos-latest`, `windows-latest` | Not migrated — unsupported OS or architecture |
| `[self-hosted, linux, ubuntu-latest]` | Not migrated — targets the organization's own runners |
Replace all UPPERCASE placeholders (`OWNER`, `REPO`, `BRANCH_NAME`, `HEAD_OID`, `BASE64_CONTENT`, `FILE_NAME`, `N`, `DEFAULT_BRANCH`, `CURRENT_AGENT_ID`, `EDITED_FILE`, `PR_BODY_FILE`) with actual values from previous steps.
## Procedure
### Step 1: Verify GitHub Access and Get the Repository
Verify `gh auth status` succeeds. If `gh` is missing or unauthenticated, direct the user to install it from https://cli.github.com/ and run `gh auth login`. Wait for them to finish before continuing.
Check that `gh auth status` lists the `workflow` scope; changing files in `.github/workflows` requires it. If it is missing, ask the user to run `gh auth refresh -h github.com -s workflow` and wait for them. Fine-grained tokens and GitHub App tokens list no scopes; for those, continue, and treat a permissions error in Create PR as this cause.
If the current checkout's `origin` remote is a GitHub repository, suggest it: "Should I use `OWNER/REPO`?" Otherwise, ask the user for the repository (`owner/repo`). StarSling supports repositories on github.com only. If the repository is on another host (GitHub Enterprise Server or a `*.ghe.com` domain), stop and explain this.
Then run:
```bash
gh api repos/OWNER/REPO --jq '.owner.type, .visibility'
```
If the owner type is `User` rather than `Organization`, stop and explain: "StarSling Runners only work with GitHub organization repositories. You can create a free organization at https://github.com/account/organizations/new." Save the visibility (`public`, `private`, or `internal`) for the runner mapping.
### Step 2: Install the StarSling GitHub App
Check whether the App is installed:
```bash
gh api --paginate orgs/OWNER/installations --jq '.installations[] | select(.app_slug == "starslingdev") | .repository_selection'
```
- `all`: the App can access every repository in the organization. Tell the user and continue.
- `selected`: the App is installed for some repositories. Ask the user to confirm that `REPO` is one of them.
- No output: the App is not installed.
- An error (usually 403, because only organization owners can list installations): you cannot tell. Ask the user.
When the App is not installed or you cannot tell, ask the user: "Have you installed the [StarSling GitHub App](https://github.com/apps/starslingdev) on your org? It's required for runners to pick up jobs after merge. If not, please install it first and let me know when you're ready."
**Unless the check returned `all`, do not proceed until the user explicitly confirms the App is installed with access to the target repository.**
### Step 3: Install the Sling CLI
First run `command -v sling`. If Sling is already installed, run `sling --version` and continue.
The CLI supports Apple Silicon macOS and x64 glibc Linux. On another platform, tell the user the Sling CLI cannot be installed here, skip Steps 3 to 5, and continue with Step 6. The workflow migration only needs `gh`.
If Sling is missing on a supported platform, tell the user you are about to run the official installer, and run it once they agree:
```bash
curl -fsSL https://runners.starsling.dev/cli/install.sh | sh
```
After installation, confirm both `command -v sling` and `sling --version` succeed.
### Step 4: Install the sling skill
Determine the Skills CLI identifier for the coding agent currently running this prompt, such as `claude-code`, `codex`, or `cursor`. Before using project scope, compare the current checkout's `origin` remote with `OWNER/REPO`. If they match, install the sling skill for that agent in the current project:
```bash
npx skills add starslingdev/skills --skill sling --agent CURRENT_AGENT_ID --yes
```
Verify it appears for the current agent:
```bash
npx skills list --agent CURRENT_AGENT_ID
```
Also confirm that the install path the installer printed is inside the checkout of `OWNER/REPO`. `skills list` reports the project the command ran from, so it passes even when the skill was installed into a different directory.
If the checkout does not match `OWNER/REPO`, do not install into the unrelated project. Ask the user to open a checkout of the target repository, or ask whether they want a global installation instead. With their approval, install and verify globally:
```bash
npx skills add starslingdev/skills --skill sling --agent CURRENT_AGENT_ID --global --yes
npx skills list --agent CURRENT_AGENT_ID --global
```
If you cannot determine the current agent identifier, ask the user which Skills CLI identifier to use (for example `claude-code`). Do not run the installer without `--agent` and `--yes`: it prompts interactively, and you cannot answer those prompts. If the user prefers, give them the command without those flags to run in their own terminal.
### Step 5: Authenticate and Verify Sling
If the user's terminal and the coding agent share the same machine and user account, ask the user to run `sling login` in their own terminal and complete the GitHub browser approval. Do not run it yourself in this case. If the agent runs on a separate host or in a container whose credentials are not shared with the user's terminal, run `sling login` (without `--agent`) in the agent's CLI environment in the background, with its output redirected to a file, because it does not exit until the user approves. Read the device code and approval URL from that file, relay them to the user, wait for them to approve it in their browser, and poll `sling whoami --agent` until it succeeds. Never use `sling login --agent`. In either case, wait for approval before continuing, then run:
```bash
sling doctor --agent
sling whoami --agent
```
Read every doctor check. Exit `0` means the environment is healthy; exit `10` means a real check failed and still returns the checks. Resolve actionable failures before continuing. Advisory `version`, `auto_update`, or `agent_skill` checks do not make the environment unhealthy. Compare `local.org.slug` from `sling whoami --agent` with `OWNER`. If they differ, run `sling org switch OWNER --agent`, then run `sling whoami --agent` again and verify `local.org.slug` matches before continuing. If the switch exits `2`, show the user the organizations it lists and ask which one to use.
### Step 6: Discover Workflows
Fetch all workflow files in one API call:
```bash
cat <<'QUERY' | gh api graphql --input -
{
"query": "query($owner: String!, $repo: String!) { repository(owner: $owner, name: $repo) { id nameWithOwner defaultBranchRef { name target { oid } } object(expression: \"HEAD:.github/workflows\") { ... on Tree { entries { name object { ... on Blob { text isTruncated byteSize } } } } } } }",
"variables": { "owner": "OWNER", "repo": "REPO" }
}
QUERY
```
Note: `HEAD` in the GraphQL expression is a Git ref, not a placeholder — do not replace it.
If any entry has `isTruncated: true`, or the response errors due to size, fall back to the REST API. Never edit or commit a truncated file: the commit replaces each file with exactly the content you send. Fall back as follows: fetch the default branch and HEAD SHA via `gh api repos/OWNER/REPO --jq '.default_branch'` and `gh api repos/OWNER/REPO/git/ref/heads/DEFAULT_BRANCH --jq '.object.sha'`, then fetch workflow file names via `gh api repos/OWNER/REPO/contents/.github/workflows` and each file individually via `gh api repos/OWNER/REPO/contents/.github/workflows/FILE_NAME`. The response `content` field is base64-encoded — decode it before scanning for `runs-on:` values.
Save `defaultBranchRef.name` (or REST default branch), `.target.oid` / HEAD SHA, and workflow `entries[]`. Scan each `.yml`/`.yaml` file for:
- direct `runs-on:` string values that match the runner-mapping rules, and
- matrix-driven patterns (e.g., `runs-on: ${{ matrix.os }}`) where the matrix values match the runner-mapping rules.
Skip these and list each under "Not migrated" with its reason, so nothing is dropped silently:
- **Shared workflows.** A file triggered by `workflow_call` is a reusable workflow. Changing its runners also changes them for every workflow that calls it, including callers in other repositories that the GitHub App may not cover.
- **Jobs that call a reusable workflow** (`uses:` instead of `steps:`). They have no `runs-on` of their own; the called workflow sets the runner.
- **Any `runs-on` that is not a plain label or a hardcoded matrix value:** inputs (`${{ inputs.runner }}`), variables (`${{ vars.RUNNER }}`), ternaries, `fromJSON(...)`, YAML aliases (`*name`), and the anchors they point to (`&name`): changing an anchor's label also changes every job that uses its alias.
Get the default branch's required status checks, because migrating a matrix renames its checks (for example `test (ubuntu-latest)` becomes `test (starsling-ubuntu-26.04)`):
```bash
gh api repos/OWNER/REPO/rules/branches/DEFAULT_BRANCH --jq '.[] | select(.type == "required_status_checks") | .parameters.required_status_checks[].context'
gh api repos/OWNER/REPO/branches/DEFAULT_BRANCH/protection/required_status_checks --jq '.contexts[]'
```
A 404 on the second call means there is no classic branch protection. If a call returns 403, you cannot see the required checks: say so in the preview, and warn that check names for migrated matrix jobs will change.
For each workflow, note whether this migration PR exercises it. A `pull_request` workflow whose branch and path filters match runs on this PR. A `push` workflow whose branch and path filters match the migration branch also runs on that branch, because the migration commit is a push. A workflow triggered only by `pull_request_target`, `schedule`, `workflow_run`, `workflow_dispatch`, `release`, or a `push` filter that excludes the migration branch uses the default branch's copy, so it first runs on StarSling after merge.
Show the user a summary including:
- Workflows that will be migrated and the exact source → target mapping for each runner label
- The source and target OS version, architecture, vCPU size, and target price per minute for every mapping, plus any size or cost change required by the runner-mapping rules
- Whether each migrated workflow runs on this PR, or first runs after merge
- Everything listed as "Not migrated", with the reason
If no direct or matrix-backed runners match, show the "Not migrated" list, then stop.
### Step 7: Preview Changes
**Never create a PR without the user confirming changes first.**
Show what will change per workflow:
- Replace matching runners in `runs-on:` string values with the target selected by the runner-mapping rules (preserve quotes/comments)
- Replace matching matrix values as described under **Expressions** below
- Skip commented lines
**Provider-only migration:** This migration must preserve any explicitly named Ubuntu version, CPU architecture, and vCPU size. Do not combine a provider migration with an OS, architecture, or size change. The only exceptions are GitHub's standard runners, which move to 4 vCPU, and `ubuntu-latest`, which follows its own mapping rule above, including the OS-upgrade warning. State both in the preview. If an exact mapping is unavailable, skip the label and flag it for manual review.
**Complex `runs-on` patterns:**
- **Array syntax** (e.g., `runs-on: [linux, ubuntu-latest]`): If the array contains `self-hosted`, skip it and flag it for manual review, because it targets the organization's own runners. Otherwise replace only the matching label within the array; do not collapse it to a single string
- **Group/labels syntax** (e.g., `runs-on: { group: ..., labels: [...] }`): Skip and flag for manual review
- **Expressions** (`${{ matrix.os }}`): If `runs-on` uses a matrix value and the matrix values are hardcoded runner labels, first search the whole workflow file for each label you would replace. Inside the job's `strategy.matrix` block, the label may appear in the value list and in `include` and `exclude` entries; replace it in all of them, so they stay consistent. If the label appears anywhere outside that block (for example `if: matrix.os == 'ubuntu-latest'`, or a job `name:`), do not migrate that workflow: renaming the label would silently change those conditions. Skip it and flag it for manual review, naming the lines that reference the label. Also skip it if a required status check name contains the label. Otherwise, replace the labels and flag the workflow for manual verification. If the matrix values come from other expressions, skip entirely and flag for manual review. Every other expression is skipped as described in Discover Workflows
**YAML fidelity:** Change ONLY the `runs-on` and matrix values. Preserve the original file exactly: same indentation, key ordering, comments, blank lines, and trailing newline. The PR diff should show only the runner label changes.
### Step 8: Create PR
**Existing migration PR:** First check for an open PR from an earlier run:
```bash
gh pr list --repo OWNER/REPO --state open --json headRefName,url --jq '.[] | select(.headRefName | startswith("migrate-starsling-runners")) | .url'
```
If any exist, show them all to the user and ask whether to close them and open a new one, or stop. Do not open a second migration PR without their answer.
**Branch:** Before creating, check for existing branches: `gh api repos/OWNER/REPO/git/matching-refs/heads/migrate-starsling-runners --jq '.[].ref'`. If any exist, find the highest numeric suffix and increment by 1 (if none have a suffix, use `-2`). Then create: `gh api repos/OWNER/REPO/git/refs -f ref=refs/heads/BRANCH_NAME -f sha=HEAD_OID`.
**Atomic commit** — all files in one commit, contents base64-encoded. Write each edited workflow to a file and encode it from that file without line breaks, so trailing newlines survive and the JSON string stays on one line:
```bash
base64 < EDITED_FILE | tr -d '\n'
```
Build the mutation JSON with a tool that escapes strings correctly (such as `jq`), not by pasting into a shell string.
```bash
cat <<'MUTATION' | gh api graphql --input -
{
"query": "mutation($input: CreateCommitOnBranchInput!) { createCommitOnBranch(input: $input) { commit { oid url } } }",
"variables": {
"input": {
"branch": {
"repositoryNameWithOwner": "OWNER/REPO",
"branchName": "BRANCH_NAME"
},
"message": {
"headline": "Migrate N CI workflows to StarSling Runners",
"body": "Replaced runners per file:\n- file1.yml: ubuntu-latest → starsling-ubuntu-26.04\n- file2.yml: ubuntu-24.04 → starsling-ubuntu-24.04"
},
"expectedHeadOid": "HEAD_OID",
"fileChanges": {
"additions": [
{ "path": ".github/workflows/FILE_NAME", "contents": "BASE64_CONTENT" }
]
}
}
}
}
MUTATION
```
Verify the response contains a valid `commit.oid`. If the call fails, or its result is unclear (for example a timeout), the commit may still have landed. Read the branch before doing anything else:
```bash
gh api repos/OWNER/REPO/git/ref/heads/BRANCH_NAME --jq '.object.sha'
```
- Still `HEAD_OID`: no commit landed. Delete the branch so no empty branch is left behind, then report the error and stop:
```bash
gh api -X DELETE repos/OWNER/REPO/git/refs/heads/BRANCH_NAME
```
- Any other SHA: a commit landed, so never delete the branch. If that commit's headline is your `Migrate N CI workflows to StarSling Runners` message, continue to the PR. Otherwise something else changed the branch (this is also what an `expectedHeadOid` mismatch means): report and stop.
Do not create a PR against a failed commit.
A permissions error on a workflow file usually means the token lacks the `workflow` scope (see Verify GitHub Access and Get the Repository).
**Commit message:** The headline should read `Migrate N CI workflows to StarSling Runners` where N is the count of modified workflow files (`.yml` + `.yaml`). List each file and the runner label(s) replaced in the body, as shown in the example above.
**PR:** Write the body to a file, for example with a quoted heredoc (`cat > PR_BODY_FILE <<'EOF'`) or your own file-editing tool, so no shell runs its backticks or expands `${{ }}`. Then run `gh pr create --repo OWNER/REPO --head BRANCH_NAME --base DEFAULT_BRANCH --title "Migrate N CI workflows to StarSling Runners" --body-file PR_BODY_FILE`. Use this body structure:
```
## Summary
Migrates CI workflows to [StarSling Runners](https://docs.starsling.dev) for faster builds and AI-powered optimizations.
## Changes
- `file1.yml`: `ubuntu-latest` → `starsling-ubuntu-26.04` (2 → 4 vCPU, $X/min)
- `file2.yml`: `ubuntu-24.04` → `starsling-ubuntu-24.04` (2 → 4 vCPU, $X/min)
## Size and cost
(Every vCPU or cost change from the runner-mapping rules, and the OS-upgrade note for `ubuntu-latest`.)
## Not exercised by this PR
- `release.yml`: runs on `release` — first runs on StarSling after merge
(or "Every migrated workflow runs on this PR.")
## Not Migrated
- `file3.yml`: Uses `${{ matrix.os }}` — requires manual review
(or "All workflows migrated successfully.")
## After Merging
Workflows will automatically run on StarSling Runners. Ensure the [StarSling GitHub App](https://github.com/apps/starslingdev) is installed with access to this repo.
```
**Never push to or merge into `DEFAULT_BRANCH`.** After the pull request is created, give the user its link, then continue with Monitor.
### Step 9: Monitor (Optional)
Always ask this once the pull request is open, before you finish: ask the user if they'd like help monitoring after merge. If yes, explain they can return after merging and you'll check with:
```bash
gh run list --repo OWNER/REPO --branch DEFAULT_BRANCH --limit 5 --json status,conclusion,name,createdAt
```
Look for runs created after the merge. If any show `queued` for more than 2 minutes, suggest checking the GitHub App installation and repo access at https://github.com/apps/starslingdev.
## Error Handling
| Error | Solution |
|-------|----------|
| `gh` not found or not logged in | Install from https://cli.github.com/, run `gh auth login` |
| `sling` not found | Run the official installer from Step 3, then verify `sling --version` |
| Unsupported CLI platform | The Sling CLI requires Apple Silicon macOS or x64 glibc Linux — skip Steps 3 to 5, tell the user, and continue the migration from Step 6 |
| Sling default org differs from `OWNER` | Run `sling org switch OWNER --agent`, or ask the user which organization to use |
| Sling not authenticated | Ask the user to run `sling login` and complete the browser approval |
| sling skill missing for the current agent | Re-run Step 4 with the correct Skills CLI agent identifier |
| sling skill installed outside the target checkout | Remove it with `npx skills remove --skill sling --agent CURRENT_AGENT_ID --yes` from that directory, then re-run Step 4 from the checkout of `OWNER/REPO` |
| Label reference unavailable | Map only `ubuntu-latest`, `ubuntu-26.04`, and `ubuntu-24.04` to their base StarSling labels, and skip sized labels |
| 403 / insufficient permissions | User needs write access to the repository — check collaborator status or org role |
| App not installed | Install from https://github.com/apps/starslingdev |
| Personal repo (owner type `User`) | StarSling requires an org repo — create one at https://github.com/account/organizations/new |
| Repository not found | Check repo name and permissions |
| No workflows found | Ensure `.github/workflows/` exists |
| Runner not available after merge | Verify app has repo access at https://github.com/apps/starslingdev |
| Rate limit exceeded | Wait a few minutes and retry |
| 422 on branch creation | Branch exists — append a number suffix |
| `expectedHeadOid` mismatch | The new branch changed after you created it — do not delete it; report and stop |
| Commit fails on `.github/workflows` permissions | Token lacks the `workflow` scope — if the branch still points to `HEAD_OID`, delete it; ask the user to run `gh auth refresh -h github.com -s workflow`, then retry from Create PR |
| Repository not on github.com | StarSling supports github.com only — stop |
| Open migration PR already exists | Show it and ask the user before opening another |
| `${{ matrix.os }}` / complex `runs-on` | Require manual review — determined at runtime |
| GraphQL response or a file truncated (`isTruncated`) | Fall back to REST API for individual file fetches |
````
To set up StarSling yourself instead, follow the steps below.
### Step 1: Install the StarSling GitHub App
[Install StarSling GitHub App](https://github.com/apps/starslingdev)
StarSling Runners are not available for personal repositories, only GitHub organizations. If you install the GitHub App in a personal repo, StarSling Runners will not pick up the jobs. [Learn why →](https://docs.starsling.dev/troubleshooting/common-issues#personal-repositories-not-supported)
### Step 2: Update Your Workflow(s)
If you only want to migrate your workflows, paste this prompt into any AI coding agent (Claude Code, Cursor, Codex, etc.):
````markdown title="AI prompt"
# Migrate GitHub Actions to StarSling Runners
Migrate the user's repository from its current runners to StarSling Runners: confirm the StarSling GitHub App is installed, then prepare a reviewable pull request that changes each workflow's runner labels.
Pause whenever the user must approve something in a browser. Do not claim the migration is complete until the migration pull request has been created.
## Configuration
**Branch:** `migrate-starsling-runners`
**Label reference:** Before mapping any runner, fetch the current StarSling label reference:
```bash
curl -fsSL https://docs.starsling.dev/configuration/label-reference.md
```
It is the source of truth for which StarSling labels exist: OS versions, vCPU sizes, GPU labels, and the label recommended for `ubuntu-latest`. Only choose a target label that appears in it. If you cannot fetch it, tell the user, map only `ubuntu-latest`, `ubuntu-26.04`, and `ubuntu-24.04` to `starsling-ubuntu-26.04`, `starsling-ubuntu-26.04`, and `starsling-ubuntu-24.04`, and skip every sized label.
**Runner mapping:**
- This is a provider-only migration. The target must have the same Ubuntu version, CPU architecture, and vCPU count as the source, and no GPU unless the source has one. The only exceptions are GitHub's standard runners and `ubuntu-latest`, below. Treat a Linux label with no ARM marker (such as `arm` or `arm64`) as x64. If the label reference has no exact match, skip the label and flag it for manual review.
- Leave labels that already start with `starsling-` unchanged.
- GitHub's standard runners (`ubuntu-latest`, `ubuntu-26.04`, `ubuntu-24.04`) have 2 vCPU on private and internal repositories and 4 vCPU on public ones. Map them to the 4-vCPU StarSling label (no size suffix) in both cases. On a private or internal repository, say in the preview and the PR body that each job moves from 2 to 4 vCPU. On a public repository, say that GitHub's standard runners are free for public repositories, so StarSling minutes are a new cost. For every target, show its price per minute from the label reference.
- Map `ubuntu-latest` to the label the reference recommends for it. On GitHub, `ubuntu-latest` may still resolve to an older Ubuntu version for some repositories; in that case the migration is also an OS upgrade. Say so in the preview and the PR body, and ask the user to run the workflows before merging.
- When a source label explicitly names an Ubuntu version, preserve it, whatever the provider or label format (for example `2404` means Ubuntu 24.04).
- A label from another provider must state both its Ubuntu version and its vCPU count (for example `blacksmith-8vcpu-ubuntu-2404`). If either is missing, or you cannot tell whether a number is the vCPU count (for example `8x16` or a bare `-8`), skip the label. Never fall back to a default size.
- The organization's own runners are not migrated. GitHub larger runners have names the organization chooses (for example `ubuntu-latest-8-cores` or `ubuntu-24.04-16core`), so the name does not reliably state the OS version or size, and the runner may carry a static IP or private networking. An organization can even name one `ubuntu-24.04-8`. Before mapping, list the organization's larger runners:
```bash
gh api --paginate orgs/OWNER/actions/hosted-runners --jq '.runners[].name'
```
Skip any label that matches one of these names, and ask the user to check that runner's configuration in their GitHub organization settings. If you cannot list them (usually 403, because only organization owners can), say so in the preview. Do not use the self-hosted runner list to decide this: other providers' runners register as self-hosted runners too. Skip every label that is neither a GitHub standard runner label nor clearly named for another provider (such as a `blacksmith-` prefix), because it may be the organization's own runner.
- Skip macOS, Windows, ARM, and GPU runners from other providers, and Ubuntu versions the reference does not list (such as `ubuntu-22.04`). Flag each one for manual review.
Examples (labels must still be checked against the reference):
| Source | Target |
|---|---|
| `ubuntu-latest` | The label the reference recommends for `ubuntu-latest` (4 vCPU) |
| `ubuntu-24.04` | `starsling-ubuntu-24.04` (4 vCPU) |
| A third-party label that states Ubuntu 24.04 and 8 vCPU | `starsling-ubuntu-24.04-8` |
| A third-party label that states no vCPU count | Not migrated — size unknown |
| `starsling-ubuntu-24.04`, `starsling-ubuntu-24.04-gpu` | Unchanged — already StarSling |
| `ubuntu-latest-8-cores`, `ubuntu-24.04-16core` | Not migrated — the organization's own larger runner; check its configuration |
| `ubuntu-22.04` | Not migrated — no StarSling equivalent |
| `ubuntu-24.04-arm`, `macos-latest`, `windows-latest` | Not migrated — unsupported OS or architecture |
| `[self-hosted, linux, ubuntu-latest]` | Not migrated — targets the organization's own runners |
Replace all UPPERCASE placeholders (`OWNER`, `REPO`, `BRANCH_NAME`, `HEAD_OID`, `BASE64_CONTENT`, `FILE_NAME`, `N`, `DEFAULT_BRANCH`, `CURRENT_AGENT_ID`, `EDITED_FILE`, `PR_BODY_FILE`) with actual values from previous steps.
## Procedure
### Step 1: Verify GitHub Access and Get the Repository
Verify `gh auth status` succeeds. If `gh` is missing or unauthenticated, direct the user to install it from https://cli.github.com/ and run `gh auth login`. Wait for them to finish before continuing.
Check that `gh auth status` lists the `workflow` scope; changing files in `.github/workflows` requires it. If it is missing, ask the user to run `gh auth refresh -h github.com -s workflow` and wait for them. Fine-grained tokens and GitHub App tokens list no scopes; for those, continue, and treat a permissions error in Create PR as this cause.
If the current checkout's `origin` remote is a GitHub repository, suggest it: "Should I use `OWNER/REPO`?" Otherwise, ask the user for the repository (`owner/repo`). StarSling supports repositories on github.com only. If the repository is on another host (GitHub Enterprise Server or a `*.ghe.com` domain), stop and explain this.
Then run:
```bash
gh api repos/OWNER/REPO --jq '.owner.type, .visibility'
```
If the owner type is `User` rather than `Organization`, stop and explain: "StarSling Runners only work with GitHub organization repositories. You can create a free organization at https://github.com/account/organizations/new." Save the visibility (`public`, `private`, or `internal`) for the runner mapping.
### Step 2: Install the StarSling GitHub App
Check whether the App is installed:
```bash
gh api --paginate orgs/OWNER/installations --jq '.installations[] | select(.app_slug == "starslingdev") | .repository_selection'
```
- `all`: the App can access every repository in the organization. Tell the user and continue.
- `selected`: the App is installed for some repositories. Ask the user to confirm that `REPO` is one of them.
- No output: the App is not installed.
- An error (usually 403, because only organization owners can list installations): you cannot tell. Ask the user.
When the App is not installed or you cannot tell, ask the user: "Have you installed the [StarSling GitHub App](https://github.com/apps/starslingdev) on your org? It's required for runners to pick up jobs after merge. If not, please install it first and let me know when you're ready."
**Unless the check returned `all`, do not proceed until the user explicitly confirms the App is installed with access to the target repository.**
### Step 3: Discover Workflows
Fetch all workflow files in one API call:
```bash
cat <<'QUERY' | gh api graphql --input -
{
"query": "query($owner: String!, $repo: String!) { repository(owner: $owner, name: $repo) { id nameWithOwner defaultBranchRef { name target { oid } } object(expression: \"HEAD:.github/workflows\") { ... on Tree { entries { name object { ... on Blob { text isTruncated byteSize } } } } } } }",
"variables": { "owner": "OWNER", "repo": "REPO" }
}
QUERY
```
Note: `HEAD` in the GraphQL expression is a Git ref, not a placeholder — do not replace it.
If any entry has `isTruncated: true`, or the response errors due to size, fall back to the REST API. Never edit or commit a truncated file: the commit replaces each file with exactly the content you send. Fall back as follows: fetch the default branch and HEAD SHA via `gh api repos/OWNER/REPO --jq '.default_branch'` and `gh api repos/OWNER/REPO/git/ref/heads/DEFAULT_BRANCH --jq '.object.sha'`, then fetch workflow file names via `gh api repos/OWNER/REPO/contents/.github/workflows` and each file individually via `gh api repos/OWNER/REPO/contents/.github/workflows/FILE_NAME`. The response `content` field is base64-encoded — decode it before scanning for `runs-on:` values.
Save `defaultBranchRef.name` (or REST default branch), `.target.oid` / HEAD SHA, and workflow `entries[]`. Scan each `.yml`/`.yaml` file for:
- direct `runs-on:` string values that match the runner-mapping rules, and
- matrix-driven patterns (e.g., `runs-on: ${{ matrix.os }}`) where the matrix values match the runner-mapping rules.
Skip these and list each under "Not migrated" with its reason, so nothing is dropped silently:
- **Shared workflows.** A file triggered by `workflow_call` is a reusable workflow. Changing its runners also changes them for every workflow that calls it, including callers in other repositories that the GitHub App may not cover.
- **Jobs that call a reusable workflow** (`uses:` instead of `steps:`). They have no `runs-on` of their own; the called workflow sets the runner.
- **Any `runs-on` that is not a plain label or a hardcoded matrix value:** inputs (`${{ inputs.runner }}`), variables (`${{ vars.RUNNER }}`), ternaries, `fromJSON(...)`, YAML aliases (`*name`), and the anchors they point to (`&name`): changing an anchor's label also changes every job that uses its alias.
Get the default branch's required status checks, because migrating a matrix renames its checks (for example `test (ubuntu-latest)` becomes `test (starsling-ubuntu-26.04)`):
```bash
gh api repos/OWNER/REPO/rules/branches/DEFAULT_BRANCH --jq '.[] | select(.type == "required_status_checks") | .parameters.required_status_checks[].context'
gh api repos/OWNER/REPO/branches/DEFAULT_BRANCH/protection/required_status_checks --jq '.contexts[]'
```
A 404 on the second call means there is no classic branch protection. If a call returns 403, you cannot see the required checks: say so in the preview, and warn that check names for migrated matrix jobs will change.
For each workflow, note whether this migration PR exercises it. A `pull_request` workflow whose branch and path filters match runs on this PR. A `push` workflow whose branch and path filters match the migration branch also runs on that branch, because the migration commit is a push. A workflow triggered only by `pull_request_target`, `schedule`, `workflow_run`, `workflow_dispatch`, `release`, or a `push` filter that excludes the migration branch uses the default branch's copy, so it first runs on StarSling after merge.
Show the user a summary including:
- Workflows that will be migrated and the exact source → target mapping for each runner label
- The source and target OS version, architecture, vCPU size, and target price per minute for every mapping, plus any size or cost change required by the runner-mapping rules
- Whether each migrated workflow runs on this PR, or first runs after merge
- Everything listed as "Not migrated", with the reason
If no direct or matrix-backed runners match, show the "Not migrated" list, then stop.
### Step 4: Preview Changes
**Never create a PR without the user confirming changes first.**
Show what will change per workflow:
- Replace matching runners in `runs-on:` string values with the target selected by the runner-mapping rules (preserve quotes/comments)
- Replace matching matrix values as described under **Expressions** below
- Skip commented lines
**Provider-only migration:** This migration must preserve any explicitly named Ubuntu version, CPU architecture, and vCPU size. Do not combine a provider migration with an OS, architecture, or size change. The only exceptions are GitHub's standard runners, which move to 4 vCPU, and `ubuntu-latest`, which follows its own mapping rule above, including the OS-upgrade warning. State both in the preview. If an exact mapping is unavailable, skip the label and flag it for manual review.
**Complex `runs-on` patterns:**
- **Array syntax** (e.g., `runs-on: [linux, ubuntu-latest]`): If the array contains `self-hosted`, skip it and flag it for manual review, because it targets the organization's own runners. Otherwise replace only the matching label within the array; do not collapse it to a single string
- **Group/labels syntax** (e.g., `runs-on: { group: ..., labels: [...] }`): Skip and flag for manual review
- **Expressions** (`${{ matrix.os }}`): If `runs-on` uses a matrix value and the matrix values are hardcoded runner labels, first search the whole workflow file for each label you would replace. Inside the job's `strategy.matrix` block, the label may appear in the value list and in `include` and `exclude` entries; replace it in all of them, so they stay consistent. If the label appears anywhere outside that block (for example `if: matrix.os == 'ubuntu-latest'`, or a job `name:`), do not migrate that workflow: renaming the label would silently change those conditions. Skip it and flag it for manual review, naming the lines that reference the label. Also skip it if a required status check name contains the label. Otherwise, replace the labels and flag the workflow for manual verification. If the matrix values come from other expressions, skip entirely and flag for manual review. Every other expression is skipped as described in Discover Workflows
**YAML fidelity:** Change ONLY the `runs-on` and matrix values. Preserve the original file exactly: same indentation, key ordering, comments, blank lines, and trailing newline. The PR diff should show only the runner label changes.
### Step 5: Create PR
**Existing migration PR:** First check for an open PR from an earlier run:
```bash
gh pr list --repo OWNER/REPO --state open --json headRefName,url --jq '.[] | select(.headRefName | startswith("migrate-starsling-runners")) | .url'
```
If any exist, show them all to the user and ask whether to close them and open a new one, or stop. Do not open a second migration PR without their answer.
**Branch:** Before creating, check for existing branches: `gh api repos/OWNER/REPO/git/matching-refs/heads/migrate-starsling-runners --jq '.[].ref'`. If any exist, find the highest numeric suffix and increment by 1 (if none have a suffix, use `-2`). Then create: `gh api repos/OWNER/REPO/git/refs -f ref=refs/heads/BRANCH_NAME -f sha=HEAD_OID`.
**Atomic commit** — all files in one commit, contents base64-encoded. Write each edited workflow to a file and encode it from that file without line breaks, so trailing newlines survive and the JSON string stays on one line:
```bash
base64 < EDITED_FILE | tr -d '\n'
```
Build the mutation JSON with a tool that escapes strings correctly (such as `jq`), not by pasting into a shell string.
```bash
cat <<'MUTATION' | gh api graphql --input -
{
"query": "mutation($input: CreateCommitOnBranchInput!) { createCommitOnBranch(input: $input) { commit { oid url } } }",
"variables": {
"input": {
"branch": {
"repositoryNameWithOwner": "OWNER/REPO",
"branchName": "BRANCH_NAME"
},
"message": {
"headline": "Migrate N CI workflows to StarSling Runners",
"body": "Replaced runners per file:\n- file1.yml: ubuntu-latest → starsling-ubuntu-26.04\n- file2.yml: ubuntu-24.04 → starsling-ubuntu-24.04"
},
"expectedHeadOid": "HEAD_OID",
"fileChanges": {
"additions": [
{ "path": ".github/workflows/FILE_NAME", "contents": "BASE64_CONTENT" }
]
}
}
}
}
MUTATION
```
Verify the response contains a valid `commit.oid`. If the call fails, or its result is unclear (for example a timeout), the commit may still have landed. Read the branch before doing anything else:
```bash
gh api repos/OWNER/REPO/git/ref/heads/BRANCH_NAME --jq '.object.sha'
```
- Still `HEAD_OID`: no commit landed. Delete the branch so no empty branch is left behind, then report the error and stop:
```bash
gh api -X DELETE repos/OWNER/REPO/git/refs/heads/BRANCH_NAME
```
- Any other SHA: a commit landed, so never delete the branch. If that commit's headline is your `Migrate N CI workflows to StarSling Runners` message, continue to the PR. Otherwise something else changed the branch (this is also what an `expectedHeadOid` mismatch means): report and stop.
Do not create a PR against a failed commit.
A permissions error on a workflow file usually means the token lacks the `workflow` scope (see Verify GitHub Access and Get the Repository).
**Commit message:** The headline should read `Migrate N CI workflows to StarSling Runners` where N is the count of modified workflow files (`.yml` + `.yaml`). List each file and the runner label(s) replaced in the body, as shown in the example above.
**PR:** Write the body to a file, for example with a quoted heredoc (`cat > PR_BODY_FILE <<'EOF'`) or your own file-editing tool, so no shell runs its backticks or expands `${{ }}`. Then run `gh pr create --repo OWNER/REPO --head BRANCH_NAME --base DEFAULT_BRANCH --title "Migrate N CI workflows to StarSling Runners" --body-file PR_BODY_FILE`. Use this body structure:
```
## Summary
Migrates CI workflows to [StarSling Runners](https://docs.starsling.dev) for faster builds and AI-powered optimizations.
## Changes
- `file1.yml`: `ubuntu-latest` → `starsling-ubuntu-26.04` (2 → 4 vCPU, $X/min)
- `file2.yml`: `ubuntu-24.04` → `starsling-ubuntu-24.04` (2 → 4 vCPU, $X/min)
## Size and cost
(Every vCPU or cost change from the runner-mapping rules, and the OS-upgrade note for `ubuntu-latest`.)
## Not exercised by this PR
- `release.yml`: runs on `release` — first runs on StarSling after merge
(or "Every migrated workflow runs on this PR.")
## Not Migrated
- `file3.yml`: Uses `${{ matrix.os }}` — requires manual review
(or "All workflows migrated successfully.")
## After Merging
Workflows will automatically run on StarSling Runners. Ensure the [StarSling GitHub App](https://github.com/apps/starslingdev) is installed with access to this repo.
```
**Never push to or merge into `DEFAULT_BRANCH`.** After the pull request is created, give the user its link, then continue with Monitor.
### Step 6: Monitor (Optional)
Always ask this once the pull request is open, before you finish: ask the user if they'd like help monitoring after merge. If yes, explain they can return after merging and you'll check with:
```bash
gh run list --repo OWNER/REPO --branch DEFAULT_BRANCH --limit 5 --json status,conclusion,name,createdAt
```
Look for runs created after the merge. If any show `queued` for more than 2 minutes, suggest checking the GitHub App installation and repo access at https://github.com/apps/starslingdev.
## Error Handling
| Error | Solution |
|-------|----------|
| `gh` not found or not logged in | Install from https://cli.github.com/, run `gh auth login` |
| Label reference unavailable | Map only `ubuntu-latest`, `ubuntu-26.04`, and `ubuntu-24.04` to their base StarSling labels, and skip sized labels |
| 403 / insufficient permissions | User needs write access to the repository — check collaborator status or org role |
| App not installed | Install from https://github.com/apps/starslingdev |
| Personal repo (owner type `User`) | StarSling requires an org repo — create one at https://github.com/account/organizations/new |
| Repository not found | Check repo name and permissions |
| No workflows found | Ensure `.github/workflows/` exists |
| Runner not available after merge | Verify app has repo access at https://github.com/apps/starslingdev |
| Rate limit exceeded | Wait a few minutes and retry |
| 422 on branch creation | Branch exists — append a number suffix |
| `expectedHeadOid` mismatch | The new branch changed after you created it — do not delete it; report and stop |
| Commit fails on `.github/workflows` permissions | Token lacks the `workflow` scope — if the branch still points to `HEAD_OID`, delete it; ask the user to run `gh auth refresh -h github.com -s workflow`, then retry from Create PR |
| Repository not on github.com | StarSling supports github.com only — stop |
| Open migration PR already exists | Show it and ask the user before opening another |
| `${{ matrix.os }}` / complex `runs-on` | Require manual review — determined at runtime |
| GraphQL response or a file truncated (`isTruncated`) | Fall back to REST API for individual file fetches |
````
See the [full quickstart](https://docs.starsling.dev/getting-started/quickstart) for a manual `runs-on` label swap and other migration options.
## What You Get
### Up to 6x Faster CI Runs
* **[30% faster hardware](https://docs.starsling.dev/runners/compute-sizing)**
* **Unlimited concurrency** to minimize queue times
### AI-Powered Optimizations
* **[Optimizations](https://docs.starsling.dev/ai-agents/optimizations)** — AI agents scan your workflows to continuously improve CI speed ([see real examples](https://starsling.dev/#ai-prs)). For new accounts, AI-powered optimization PRs are only available to customers on paid plans and are not enabled by default.
* **[ci-speedup](https://docs.starsling.dev/skills/ci-speedup)** — Run a free, open-source audit directly with your coding agent, or launch StarSling's pinned, checksum-verified version with `sling speedup`, to find the GitHub Actions check gating your PRs.
* **[ci-score](https://docs.starsling.dev/skills/ci-score)** — Grade your GitHub Actions configuration against CI best practices with the same free, open-source skill set, and get a ranked fix for every gap.
* **[ci-secure](https://docs.starsling.dev/skills/ci-secure)** — Scan your workflows for the ten critical CI/CD attack vectors, each reported with the attack it enables and a fix you can apply.
* **[sling](https://docs.starsling.dev/skills/sling)** — Give your coding agent live CI failure diagnoses, timing breakdowns, and cost attribution through the Sling CLI.
Teams running StarSling see this compound in production:
### Up to 33% Lower Cost
Every StarSling runner is cheaper than GitHub's equivalent larger runner — up to 33%.
| Runner | vCPU | Memory | GitHub Price | StarSling Price | Savings |
| --------------------------- | ---- | ------ | ------------ | --------------- | ------- |
| `starsling-ubuntu-26.04-2` | 2 | 8 GB | $0.006/min | $0.004/min | **33%** |
| `starsling-ubuntu-26.04` | 4 | 16 GB | $0.012/min | **$0.008/min** | **33%** |
| `starsling-ubuntu-26.04-8` | 8 | 32 GB | $0.022/min | $0.016/min | **27%** |
| `starsling-ubuntu-26.04-16` | 16 | 64 GB | $0.042/min | $0.032/min | **24%** |
| `starsling-ubuntu-26.04-32` | 32 | 128 GB | $0.082/min | $0.064/min | **22%** |
| `starsling-ubuntu-26.04-64` | 64 | 256 GB | $0.162/min | $0.128/min | **21%** |
| Runner | vCPU | Memory | GitHub Price | StarSling Price | Savings |
| --------------------------- | ---- | ------ | ------------ | --------------- | ------- |
| `starsling-ubuntu-24.04-2` | 2 | 8 GB | $0.006/min | $0.004/min | **33%** |
| `starsling-ubuntu-24.04` | 4 | 16 GB | $0.012/min | **$0.008/min** | **33%** |
| `starsling-ubuntu-24.04-8` | 8 | 32 GB | $0.022/min | $0.016/min | **27%** |
| `starsling-ubuntu-24.04-16` | 16 | 64 GB | $0.042/min | $0.032/min | **24%** |
| `starsling-ubuntu-24.04-32` | 32 | 128 GB | $0.082/min | $0.064/min | **22%** |
| `starsling-ubuntu-24.04-64` | 64 | 256 GB | $0.162/min | $0.128/min | **21%** |
*GitHub prices reference [GitHub Actions runner pricing](https://docs.github.com/en/billing/reference/actions-runner-pricing) for Linux x64 larger runners (as of 2026-05-06).*
**2,000 free minutes for your first month** — no credit card required to start.
## Comparison to GitHub
| Feature | GitHub-hosted | StarSling |
| ------------------------- | ------------- | ------------------- |
| Queue time | 30-60s | **Under 30s (P50)** |
| Build speed | Baseline | **Up to 6x faster** |
| Optimization improvements | Manual | **AI-powered** |
## Get Started
# Quickstart (/getting-started/quickstart)
2,000 free minutes for your first month — no credit card required.
## Onboarding Prompt
This prompt guides your coding agent through the complete StarSling setup: installing the [GitHub App](https://github.com/apps/starslingdev), installing and authenticating the [Sling CLI](https://docs.starsling.dev/sling-cli/installation), installing the [sling skill](https://docs.starsling.dev/skills/sling), and [migrating your workflows](https://docs.starsling.dev/configuration/migration-guide) with the correct runner labels. It pauses for the browser approvals and asks you to review the exact runner mapping before it creates a pull request.
````markdown title="AI prompt"
# Onboard a Repository to StarSling
Set up StarSling for the user's repository from start to finish: install the StarSling GitHub App, install and authenticate the Sling CLI, install the sling skill for the current coding agent, and migrate the repository's GitHub Actions workflows to StarSling Runners.
Pause whenever the user must approve something in a browser. Do not claim onboarding is complete until `sling doctor --agent` confirms the environment and the migration pull request has been created. If the Sling CLI cannot run on this machine (Step 3), still complete the migration and tell the user which Sling steps were skipped.
## Configuration
**Branch:** `migrate-starsling-runners`
**Label reference:** Before mapping any runner, fetch the current StarSling label reference:
```bash
curl -fsSL https://docs.starsling.dev/configuration/label-reference.md
```
It is the source of truth for which StarSling labels exist: OS versions, vCPU sizes, GPU labels, and the label recommended for `ubuntu-latest`. Only choose a target label that appears in it. If you cannot fetch it, tell the user, map only `ubuntu-latest`, `ubuntu-26.04`, and `ubuntu-24.04` to `starsling-ubuntu-26.04`, `starsling-ubuntu-26.04`, and `starsling-ubuntu-24.04`, and skip every sized label.
**Runner mapping:**
- This is a provider-only migration. The target must have the same Ubuntu version, CPU architecture, and vCPU count as the source, and no GPU unless the source has one. The only exceptions are GitHub's standard runners and `ubuntu-latest`, below. Treat a Linux label with no ARM marker (such as `arm` or `arm64`) as x64. If the label reference has no exact match, skip the label and flag it for manual review.
- Leave labels that already start with `starsling-` unchanged.
- GitHub's standard runners (`ubuntu-latest`, `ubuntu-26.04`, `ubuntu-24.04`) have 2 vCPU on private and internal repositories and 4 vCPU on public ones. Map them to the 4-vCPU StarSling label (no size suffix) in both cases. On a private or internal repository, say in the preview and the PR body that each job moves from 2 to 4 vCPU. On a public repository, say that GitHub's standard runners are free for public repositories, so StarSling minutes are a new cost. For every target, show its price per minute from the label reference.
- Map `ubuntu-latest` to the label the reference recommends for it. On GitHub, `ubuntu-latest` may still resolve to an older Ubuntu version for some repositories; in that case the migration is also an OS upgrade. Say so in the preview and the PR body, and ask the user to run the workflows before merging.
- When a source label explicitly names an Ubuntu version, preserve it, whatever the provider or label format (for example `2404` means Ubuntu 24.04).
- A label from another provider must state both its Ubuntu version and its vCPU count (for example `blacksmith-8vcpu-ubuntu-2404`). If either is missing, or you cannot tell whether a number is the vCPU count (for example `8x16` or a bare `-8`), skip the label. Never fall back to a default size.
- The organization's own runners are not migrated. GitHub larger runners have names the organization chooses (for example `ubuntu-latest-8-cores` or `ubuntu-24.04-16core`), so the name does not reliably state the OS version or size, and the runner may carry a static IP or private networking. An organization can even name one `ubuntu-24.04-8`. Before mapping, list the organization's larger runners:
```bash
gh api --paginate orgs/OWNER/actions/hosted-runners --jq '.runners[].name'
```
Skip any label that matches one of these names, and ask the user to check that runner's configuration in their GitHub organization settings. If you cannot list them (usually 403, because only organization owners can), say so in the preview. Do not use the self-hosted runner list to decide this: other providers' runners register as self-hosted runners too. Skip every label that is neither a GitHub standard runner label nor clearly named for another provider (such as a `blacksmith-` prefix), because it may be the organization's own runner.
- Skip macOS, Windows, ARM, and GPU runners from other providers, and Ubuntu versions the reference does not list (such as `ubuntu-22.04`). Flag each one for manual review.
Examples (labels must still be checked against the reference):
| Source | Target |
|---|---|
| `ubuntu-latest` | The label the reference recommends for `ubuntu-latest` (4 vCPU) |
| `ubuntu-24.04` | `starsling-ubuntu-24.04` (4 vCPU) |
| A third-party label that states Ubuntu 24.04 and 8 vCPU | `starsling-ubuntu-24.04-8` |
| A third-party label that states no vCPU count | Not migrated — size unknown |
| `starsling-ubuntu-24.04`, `starsling-ubuntu-24.04-gpu` | Unchanged — already StarSling |
| `ubuntu-latest-8-cores`, `ubuntu-24.04-16core` | Not migrated — the organization's own larger runner; check its configuration |
| `ubuntu-22.04` | Not migrated — no StarSling equivalent |
| `ubuntu-24.04-arm`, `macos-latest`, `windows-latest` | Not migrated — unsupported OS or architecture |
| `[self-hosted, linux, ubuntu-latest]` | Not migrated — targets the organization's own runners |
Replace all UPPERCASE placeholders (`OWNER`, `REPO`, `BRANCH_NAME`, `HEAD_OID`, `BASE64_CONTENT`, `FILE_NAME`, `N`, `DEFAULT_BRANCH`, `CURRENT_AGENT_ID`, `EDITED_FILE`, `PR_BODY_FILE`) with actual values from previous steps.
## Procedure
### Step 1: Verify GitHub Access and Get the Repository
Verify `gh auth status` succeeds. If `gh` is missing or unauthenticated, direct the user to install it from https://cli.github.com/ and run `gh auth login`. Wait for them to finish before continuing.
Check that `gh auth status` lists the `workflow` scope; changing files in `.github/workflows` requires it. If it is missing, ask the user to run `gh auth refresh -h github.com -s workflow` and wait for them. Fine-grained tokens and GitHub App tokens list no scopes; for those, continue, and treat a permissions error in Create PR as this cause.
If the current checkout's `origin` remote is a GitHub repository, suggest it: "Should I use `OWNER/REPO`?" Otherwise, ask the user for the repository (`owner/repo`). StarSling supports repositories on github.com only. If the repository is on another host (GitHub Enterprise Server or a `*.ghe.com` domain), stop and explain this.
Then run:
```bash
gh api repos/OWNER/REPO --jq '.owner.type, .visibility'
```
If the owner type is `User` rather than `Organization`, stop and explain: "StarSling Runners only work with GitHub organization repositories. You can create a free organization at https://github.com/account/organizations/new." Save the visibility (`public`, `private`, or `internal`) for the runner mapping.
### Step 2: Install the StarSling GitHub App
Check whether the App is installed:
```bash
gh api --paginate orgs/OWNER/installations --jq '.installations[] | select(.app_slug == "starslingdev") | .repository_selection'
```
- `all`: the App can access every repository in the organization. Tell the user and continue.
- `selected`: the App is installed for some repositories. Ask the user to confirm that `REPO` is one of them.
- No output: the App is not installed.
- An error (usually 403, because only organization owners can list installations): you cannot tell. Ask the user.
When the App is not installed or you cannot tell, ask the user: "Have you installed the [StarSling GitHub App](https://github.com/apps/starslingdev) on your org? It's required for runners to pick up jobs after merge. If not, please install it first and let me know when you're ready."
**Unless the check returned `all`, do not proceed until the user explicitly confirms the App is installed with access to the target repository.**
### Step 3: Install the Sling CLI
First run `command -v sling`. If Sling is already installed, run `sling --version` and continue.
The CLI supports Apple Silicon macOS and x64 glibc Linux. On another platform, tell the user the Sling CLI cannot be installed here, skip Steps 3 to 5, and continue with Step 6. The workflow migration only needs `gh`.
If Sling is missing on a supported platform, tell the user you are about to run the official installer, and run it once they agree:
```bash
curl -fsSL https://runners.starsling.dev/cli/install.sh | sh
```
After installation, confirm both `command -v sling` and `sling --version` succeed.
### Step 4: Install the sling skill
Determine the Skills CLI identifier for the coding agent currently running this prompt, such as `claude-code`, `codex`, or `cursor`. Before using project scope, compare the current checkout's `origin` remote with `OWNER/REPO`. If they match, install the sling skill for that agent in the current project:
```bash
npx skills add starslingdev/skills --skill sling --agent CURRENT_AGENT_ID --yes
```
Verify it appears for the current agent:
```bash
npx skills list --agent CURRENT_AGENT_ID
```
Also confirm that the install path the installer printed is inside the checkout of `OWNER/REPO`. `skills list` reports the project the command ran from, so it passes even when the skill was installed into a different directory.
If the checkout does not match `OWNER/REPO`, do not install into the unrelated project. Ask the user to open a checkout of the target repository, or ask whether they want a global installation instead. With their approval, install and verify globally:
```bash
npx skills add starslingdev/skills --skill sling --agent CURRENT_AGENT_ID --global --yes
npx skills list --agent CURRENT_AGENT_ID --global
```
If you cannot determine the current agent identifier, ask the user which Skills CLI identifier to use (for example `claude-code`). Do not run the installer without `--agent` and `--yes`: it prompts interactively, and you cannot answer those prompts. If the user prefers, give them the command without those flags to run in their own terminal.
### Step 5: Authenticate and Verify Sling
If the user's terminal and the coding agent share the same machine and user account, ask the user to run `sling login` in their own terminal and complete the GitHub browser approval. Do not run it yourself in this case. If the agent runs on a separate host or in a container whose credentials are not shared with the user's terminal, run `sling login` (without `--agent`) in the agent's CLI environment in the background, with its output redirected to a file, because it does not exit until the user approves. Read the device code and approval URL from that file, relay them to the user, wait for them to approve it in their browser, and poll `sling whoami --agent` until it succeeds. Never use `sling login --agent`. In either case, wait for approval before continuing, then run:
```bash
sling doctor --agent
sling whoami --agent
```
Read every doctor check. Exit `0` means the environment is healthy; exit `10` means a real check failed and still returns the checks. Resolve actionable failures before continuing. Advisory `version`, `auto_update`, or `agent_skill` checks do not make the environment unhealthy. Compare `local.org.slug` from `sling whoami --agent` with `OWNER`. If they differ, run `sling org switch OWNER --agent`, then run `sling whoami --agent` again and verify `local.org.slug` matches before continuing. If the switch exits `2`, show the user the organizations it lists and ask which one to use.
### Step 6: Discover Workflows
Fetch all workflow files in one API call:
```bash
cat <<'QUERY' | gh api graphql --input -
{
"query": "query($owner: String!, $repo: String!) { repository(owner: $owner, name: $repo) { id nameWithOwner defaultBranchRef { name target { oid } } object(expression: \"HEAD:.github/workflows\") { ... on Tree { entries { name object { ... on Blob { text isTruncated byteSize } } } } } } }",
"variables": { "owner": "OWNER", "repo": "REPO" }
}
QUERY
```
Note: `HEAD` in the GraphQL expression is a Git ref, not a placeholder — do not replace it.
If any entry has `isTruncated: true`, or the response errors due to size, fall back to the REST API. Never edit or commit a truncated file: the commit replaces each file with exactly the content you send. Fall back as follows: fetch the default branch and HEAD SHA via `gh api repos/OWNER/REPO --jq '.default_branch'` and `gh api repos/OWNER/REPO/git/ref/heads/DEFAULT_BRANCH --jq '.object.sha'`, then fetch workflow file names via `gh api repos/OWNER/REPO/contents/.github/workflows` and each file individually via `gh api repos/OWNER/REPO/contents/.github/workflows/FILE_NAME`. The response `content` field is base64-encoded — decode it before scanning for `runs-on:` values.
Save `defaultBranchRef.name` (or REST default branch), `.target.oid` / HEAD SHA, and workflow `entries[]`. Scan each `.yml`/`.yaml` file for:
- direct `runs-on:` string values that match the runner-mapping rules, and
- matrix-driven patterns (e.g., `runs-on: ${{ matrix.os }}`) where the matrix values match the runner-mapping rules.
Skip these and list each under "Not migrated" with its reason, so nothing is dropped silently:
- **Shared workflows.** A file triggered by `workflow_call` is a reusable workflow. Changing its runners also changes them for every workflow that calls it, including callers in other repositories that the GitHub App may not cover.
- **Jobs that call a reusable workflow** (`uses:` instead of `steps:`). They have no `runs-on` of their own; the called workflow sets the runner.
- **Any `runs-on` that is not a plain label or a hardcoded matrix value:** inputs (`${{ inputs.runner }}`), variables (`${{ vars.RUNNER }}`), ternaries, `fromJSON(...)`, YAML aliases (`*name`), and the anchors they point to (`&name`): changing an anchor's label also changes every job that uses its alias.
Get the default branch's required status checks, because migrating a matrix renames its checks (for example `test (ubuntu-latest)` becomes `test (starsling-ubuntu-26.04)`):
```bash
gh api repos/OWNER/REPO/rules/branches/DEFAULT_BRANCH --jq '.[] | select(.type == "required_status_checks") | .parameters.required_status_checks[].context'
gh api repos/OWNER/REPO/branches/DEFAULT_BRANCH/protection/required_status_checks --jq '.contexts[]'
```
A 404 on the second call means there is no classic branch protection. If a call returns 403, you cannot see the required checks: say so in the preview, and warn that check names for migrated matrix jobs will change.
For each workflow, note whether this migration PR exercises it. A `pull_request` workflow whose branch and path filters match runs on this PR. A `push` workflow whose branch and path filters match the migration branch also runs on that branch, because the migration commit is a push. A workflow triggered only by `pull_request_target`, `schedule`, `workflow_run`, `workflow_dispatch`, `release`, or a `push` filter that excludes the migration branch uses the default branch's copy, so it first runs on StarSling after merge.
Show the user a summary including:
- Workflows that will be migrated and the exact source → target mapping for each runner label
- The source and target OS version, architecture, vCPU size, and target price per minute for every mapping, plus any size or cost change required by the runner-mapping rules
- Whether each migrated workflow runs on this PR, or first runs after merge
- Everything listed as "Not migrated", with the reason
If no direct or matrix-backed runners match, show the "Not migrated" list, then stop.
### Step 7: Preview Changes
**Never create a PR without the user confirming changes first.**
Show what will change per workflow:
- Replace matching runners in `runs-on:` string values with the target selected by the runner-mapping rules (preserve quotes/comments)
- Replace matching matrix values as described under **Expressions** below
- Skip commented lines
**Provider-only migration:** This migration must preserve any explicitly named Ubuntu version, CPU architecture, and vCPU size. Do not combine a provider migration with an OS, architecture, or size change. The only exceptions are GitHub's standard runners, which move to 4 vCPU, and `ubuntu-latest`, which follows its own mapping rule above, including the OS-upgrade warning. State both in the preview. If an exact mapping is unavailable, skip the label and flag it for manual review.
**Complex `runs-on` patterns:**
- **Array syntax** (e.g., `runs-on: [linux, ubuntu-latest]`): If the array contains `self-hosted`, skip it and flag it for manual review, because it targets the organization's own runners. Otherwise replace only the matching label within the array; do not collapse it to a single string
- **Group/labels syntax** (e.g., `runs-on: { group: ..., labels: [...] }`): Skip and flag for manual review
- **Expressions** (`${{ matrix.os }}`): If `runs-on` uses a matrix value and the matrix values are hardcoded runner labels, first search the whole workflow file for each label you would replace. Inside the job's `strategy.matrix` block, the label may appear in the value list and in `include` and `exclude` entries; replace it in all of them, so they stay consistent. If the label appears anywhere outside that block (for example `if: matrix.os == 'ubuntu-latest'`, or a job `name:`), do not migrate that workflow: renaming the label would silently change those conditions. Skip it and flag it for manual review, naming the lines that reference the label. Also skip it if a required status check name contains the label. Otherwise, replace the labels and flag the workflow for manual verification. If the matrix values come from other expressions, skip entirely and flag for manual review. Every other expression is skipped as described in Discover Workflows
**YAML fidelity:** Change ONLY the `runs-on` and matrix values. Preserve the original file exactly: same indentation, key ordering, comments, blank lines, and trailing newline. The PR diff should show only the runner label changes.
### Step 8: Create PR
**Existing migration PR:** First check for an open PR from an earlier run:
```bash
gh pr list --repo OWNER/REPO --state open --json headRefName,url --jq '.[] | select(.headRefName | startswith("migrate-starsling-runners")) | .url'
```
If any exist, show them all to the user and ask whether to close them and open a new one, or stop. Do not open a second migration PR without their answer.
**Branch:** Before creating, check for existing branches: `gh api repos/OWNER/REPO/git/matching-refs/heads/migrate-starsling-runners --jq '.[].ref'`. If any exist, find the highest numeric suffix and increment by 1 (if none have a suffix, use `-2`). Then create: `gh api repos/OWNER/REPO/git/refs -f ref=refs/heads/BRANCH_NAME -f sha=HEAD_OID`.
**Atomic commit** — all files in one commit, contents base64-encoded. Write each edited workflow to a file and encode it from that file without line breaks, so trailing newlines survive and the JSON string stays on one line:
```bash
base64 < EDITED_FILE | tr -d '\n'
```
Build the mutation JSON with a tool that escapes strings correctly (such as `jq`), not by pasting into a shell string.
```bash
cat <<'MUTATION' | gh api graphql --input -
{
"query": "mutation($input: CreateCommitOnBranchInput!) { createCommitOnBranch(input: $input) { commit { oid url } } }",
"variables": {
"input": {
"branch": {
"repositoryNameWithOwner": "OWNER/REPO",
"branchName": "BRANCH_NAME"
},
"message": {
"headline": "Migrate N CI workflows to StarSling Runners",
"body": "Replaced runners per file:\n- file1.yml: ubuntu-latest → starsling-ubuntu-26.04\n- file2.yml: ubuntu-24.04 → starsling-ubuntu-24.04"
},
"expectedHeadOid": "HEAD_OID",
"fileChanges": {
"additions": [
{ "path": ".github/workflows/FILE_NAME", "contents": "BASE64_CONTENT" }
]
}
}
}
}
MUTATION
```
Verify the response contains a valid `commit.oid`. If the call fails, or its result is unclear (for example a timeout), the commit may still have landed. Read the branch before doing anything else:
```bash
gh api repos/OWNER/REPO/git/ref/heads/BRANCH_NAME --jq '.object.sha'
```
- Still `HEAD_OID`: no commit landed. Delete the branch so no empty branch is left behind, then report the error and stop:
```bash
gh api -X DELETE repos/OWNER/REPO/git/refs/heads/BRANCH_NAME
```
- Any other SHA: a commit landed, so never delete the branch. If that commit's headline is your `Migrate N CI workflows to StarSling Runners` message, continue to the PR. Otherwise something else changed the branch (this is also what an `expectedHeadOid` mismatch means): report and stop.
Do not create a PR against a failed commit.
A permissions error on a workflow file usually means the token lacks the `workflow` scope (see Verify GitHub Access and Get the Repository).
**Commit message:** The headline should read `Migrate N CI workflows to StarSling Runners` where N is the count of modified workflow files (`.yml` + `.yaml`). List each file and the runner label(s) replaced in the body, as shown in the example above.
**PR:** Write the body to a file, for example with a quoted heredoc (`cat > PR_BODY_FILE <<'EOF'`) or your own file-editing tool, so no shell runs its backticks or expands `${{ }}`. Then run `gh pr create --repo OWNER/REPO --head BRANCH_NAME --base DEFAULT_BRANCH --title "Migrate N CI workflows to StarSling Runners" --body-file PR_BODY_FILE`. Use this body structure:
```
## Summary
Migrates CI workflows to [StarSling Runners](https://docs.starsling.dev) for faster builds and AI-powered optimizations.
## Changes
- `file1.yml`: `ubuntu-latest` → `starsling-ubuntu-26.04` (2 → 4 vCPU, $X/min)
- `file2.yml`: `ubuntu-24.04` → `starsling-ubuntu-24.04` (2 → 4 vCPU, $X/min)
## Size and cost
(Every vCPU or cost change from the runner-mapping rules, and the OS-upgrade note for `ubuntu-latest`.)
## Not exercised by this PR
- `release.yml`: runs on `release` — first runs on StarSling after merge
(or "Every migrated workflow runs on this PR.")
## Not Migrated
- `file3.yml`: Uses `${{ matrix.os }}` — requires manual review
(or "All workflows migrated successfully.")
## After Merging
Workflows will automatically run on StarSling Runners. Ensure the [StarSling GitHub App](https://github.com/apps/starslingdev) is installed with access to this repo.
```
**Never push to or merge into `DEFAULT_BRANCH`.** After the pull request is created, give the user its link, then continue with Monitor.
### Step 9: Monitor (Optional)
Always ask this once the pull request is open, before you finish: ask the user if they'd like help monitoring after merge. If yes, explain they can return after merging and you'll check with:
```bash
gh run list --repo OWNER/REPO --branch DEFAULT_BRANCH --limit 5 --json status,conclusion,name,createdAt
```
Look for runs created after the merge. If any show `queued` for more than 2 minutes, suggest checking the GitHub App installation and repo access at https://github.com/apps/starslingdev.
## Error Handling
| Error | Solution |
|-------|----------|
| `gh` not found or not logged in | Install from https://cli.github.com/, run `gh auth login` |
| `sling` not found | Run the official installer from Step 3, then verify `sling --version` |
| Unsupported CLI platform | The Sling CLI requires Apple Silicon macOS or x64 glibc Linux — skip Steps 3 to 5, tell the user, and continue the migration from Step 6 |
| Sling default org differs from `OWNER` | Run `sling org switch OWNER --agent`, or ask the user which organization to use |
| Sling not authenticated | Ask the user to run `sling login` and complete the browser approval |
| sling skill missing for the current agent | Re-run Step 4 with the correct Skills CLI agent identifier |
| sling skill installed outside the target checkout | Remove it with `npx skills remove --skill sling --agent CURRENT_AGENT_ID --yes` from that directory, then re-run Step 4 from the checkout of `OWNER/REPO` |
| Label reference unavailable | Map only `ubuntu-latest`, `ubuntu-26.04`, and `ubuntu-24.04` to their base StarSling labels, and skip sized labels |
| 403 / insufficient permissions | User needs write access to the repository — check collaborator status or org role |
| App not installed | Install from https://github.com/apps/starslingdev |
| Personal repo (owner type `User`) | StarSling requires an org repo — create one at https://github.com/account/organizations/new |
| Repository not found | Check repo name and permissions |
| No workflows found | Ensure `.github/workflows/` exists |
| Runner not available after merge | Verify app has repo access at https://github.com/apps/starslingdev |
| Rate limit exceeded | Wait a few minutes and retry |
| 422 on branch creation | Branch exists — append a number suffix |
| `expectedHeadOid` mismatch | The new branch changed after you created it — do not delete it; report and stop |
| Commit fails on `.github/workflows` permissions | Token lacks the `workflow` scope — if the branch still points to `HEAD_OID`, delete it; ask the user to run `gh auth refresh -h github.com -s workflow`, then retry from Create PR |
| Repository not on github.com | StarSling supports github.com only — stop |
| Open migration PR already exists | Show it and ask the user before opening another |
| `${{ matrix.os }}` / complex `runs-on` | Require manual review — determined at runtime |
| GraphQL response or a file truncated (`isTruncated`) | Fall back to REST API for individual file fetches |
````
To set up StarSling yourself instead, follow the steps below.
## Step 1: Install the StarSling GitHub App
Install the StarSling GitHub App in your organization:
[Install StarSling GitHub App](https://github.com/apps/starslingdev)
Grant access to the org repositories where you want to use [StarSling Runners](https://starsling.dev/products/runners).
StarSling Runners are not available for personal repositories, only GitHub organizations. If you install the GitHub App in a personal repo, StarSling Runners will not pick up the jobs. [Learn why →](https://docs.starsling.dev/troubleshooting/common-issues#personal-repositories-not-supported)
## Step 2: Update Your Workflow(s)
### Option A: Use an AI Prompt
If you only want to migrate your workflows, paste this prompt into any AI coding agent (Claude Code, Cursor, Codex, etc.):
````markdown title="AI prompt"
# Migrate GitHub Actions to StarSling Runners
Migrate the user's repository from its current runners to StarSling Runners: confirm the StarSling GitHub App is installed, then prepare a reviewable pull request that changes each workflow's runner labels.
Pause whenever the user must approve something in a browser. Do not claim the migration is complete until the migration pull request has been created.
## Configuration
**Branch:** `migrate-starsling-runners`
**Label reference:** Before mapping any runner, fetch the current StarSling label reference:
```bash
curl -fsSL https://docs.starsling.dev/configuration/label-reference.md
```
It is the source of truth for which StarSling labels exist: OS versions, vCPU sizes, GPU labels, and the label recommended for `ubuntu-latest`. Only choose a target label that appears in it. If you cannot fetch it, tell the user, map only `ubuntu-latest`, `ubuntu-26.04`, and `ubuntu-24.04` to `starsling-ubuntu-26.04`, `starsling-ubuntu-26.04`, and `starsling-ubuntu-24.04`, and skip every sized label.
**Runner mapping:**
- This is a provider-only migration. The target must have the same Ubuntu version, CPU architecture, and vCPU count as the source, and no GPU unless the source has one. The only exceptions are GitHub's standard runners and `ubuntu-latest`, below. Treat a Linux label with no ARM marker (such as `arm` or `arm64`) as x64. If the label reference has no exact match, skip the label and flag it for manual review.
- Leave labels that already start with `starsling-` unchanged.
- GitHub's standard runners (`ubuntu-latest`, `ubuntu-26.04`, `ubuntu-24.04`) have 2 vCPU on private and internal repositories and 4 vCPU on public ones. Map them to the 4-vCPU StarSling label (no size suffix) in both cases. On a private or internal repository, say in the preview and the PR body that each job moves from 2 to 4 vCPU. On a public repository, say that GitHub's standard runners are free for public repositories, so StarSling minutes are a new cost. For every target, show its price per minute from the label reference.
- Map `ubuntu-latest` to the label the reference recommends for it. On GitHub, `ubuntu-latest` may still resolve to an older Ubuntu version for some repositories; in that case the migration is also an OS upgrade. Say so in the preview and the PR body, and ask the user to run the workflows before merging.
- When a source label explicitly names an Ubuntu version, preserve it, whatever the provider or label format (for example `2404` means Ubuntu 24.04).
- A label from another provider must state both its Ubuntu version and its vCPU count (for example `blacksmith-8vcpu-ubuntu-2404`). If either is missing, or you cannot tell whether a number is the vCPU count (for example `8x16` or a bare `-8`), skip the label. Never fall back to a default size.
- The organization's own runners are not migrated. GitHub larger runners have names the organization chooses (for example `ubuntu-latest-8-cores` or `ubuntu-24.04-16core`), so the name does not reliably state the OS version or size, and the runner may carry a static IP or private networking. An organization can even name one `ubuntu-24.04-8`. Before mapping, list the organization's larger runners:
```bash
gh api --paginate orgs/OWNER/actions/hosted-runners --jq '.runners[].name'
```
Skip any label that matches one of these names, and ask the user to check that runner's configuration in their GitHub organization settings. If you cannot list them (usually 403, because only organization owners can), say so in the preview. Do not use the self-hosted runner list to decide this: other providers' runners register as self-hosted runners too. Skip every label that is neither a GitHub standard runner label nor clearly named for another provider (such as a `blacksmith-` prefix), because it may be the organization's own runner.
- Skip macOS, Windows, ARM, and GPU runners from other providers, and Ubuntu versions the reference does not list (such as `ubuntu-22.04`). Flag each one for manual review.
Examples (labels must still be checked against the reference):
| Source | Target |
|---|---|
| `ubuntu-latest` | The label the reference recommends for `ubuntu-latest` (4 vCPU) |
| `ubuntu-24.04` | `starsling-ubuntu-24.04` (4 vCPU) |
| A third-party label that states Ubuntu 24.04 and 8 vCPU | `starsling-ubuntu-24.04-8` |
| A third-party label that states no vCPU count | Not migrated — size unknown |
| `starsling-ubuntu-24.04`, `starsling-ubuntu-24.04-gpu` | Unchanged — already StarSling |
| `ubuntu-latest-8-cores`, `ubuntu-24.04-16core` | Not migrated — the organization's own larger runner; check its configuration |
| `ubuntu-22.04` | Not migrated — no StarSling equivalent |
| `ubuntu-24.04-arm`, `macos-latest`, `windows-latest` | Not migrated — unsupported OS or architecture |
| `[self-hosted, linux, ubuntu-latest]` | Not migrated — targets the organization's own runners |
Replace all UPPERCASE placeholders (`OWNER`, `REPO`, `BRANCH_NAME`, `HEAD_OID`, `BASE64_CONTENT`, `FILE_NAME`, `N`, `DEFAULT_BRANCH`, `CURRENT_AGENT_ID`, `EDITED_FILE`, `PR_BODY_FILE`) with actual values from previous steps.
## Procedure
### Step 1: Verify GitHub Access and Get the Repository
Verify `gh auth status` succeeds. If `gh` is missing or unauthenticated, direct the user to install it from https://cli.github.com/ and run `gh auth login`. Wait for them to finish before continuing.
Check that `gh auth status` lists the `workflow` scope; changing files in `.github/workflows` requires it. If it is missing, ask the user to run `gh auth refresh -h github.com -s workflow` and wait for them. Fine-grained tokens and GitHub App tokens list no scopes; for those, continue, and treat a permissions error in Create PR as this cause.
If the current checkout's `origin` remote is a GitHub repository, suggest it: "Should I use `OWNER/REPO`?" Otherwise, ask the user for the repository (`owner/repo`). StarSling supports repositories on github.com only. If the repository is on another host (GitHub Enterprise Server or a `*.ghe.com` domain), stop and explain this.
Then run:
```bash
gh api repos/OWNER/REPO --jq '.owner.type, .visibility'
```
If the owner type is `User` rather than `Organization`, stop and explain: "StarSling Runners only work with GitHub organization repositories. You can create a free organization at https://github.com/account/organizations/new." Save the visibility (`public`, `private`, or `internal`) for the runner mapping.
### Step 2: Install the StarSling GitHub App
Check whether the App is installed:
```bash
gh api --paginate orgs/OWNER/installations --jq '.installations[] | select(.app_slug == "starslingdev") | .repository_selection'
```
- `all`: the App can access every repository in the organization. Tell the user and continue.
- `selected`: the App is installed for some repositories. Ask the user to confirm that `REPO` is one of them.
- No output: the App is not installed.
- An error (usually 403, because only organization owners can list installations): you cannot tell. Ask the user.
When the App is not installed or you cannot tell, ask the user: "Have you installed the [StarSling GitHub App](https://github.com/apps/starslingdev) on your org? It's required for runners to pick up jobs after merge. If not, please install it first and let me know when you're ready."
**Unless the check returned `all`, do not proceed until the user explicitly confirms the App is installed with access to the target repository.**
### Step 3: Discover Workflows
Fetch all workflow files in one API call:
```bash
cat <<'QUERY' | gh api graphql --input -
{
"query": "query($owner: String!, $repo: String!) { repository(owner: $owner, name: $repo) { id nameWithOwner defaultBranchRef { name target { oid } } object(expression: \"HEAD:.github/workflows\") { ... on Tree { entries { name object { ... on Blob { text isTruncated byteSize } } } } } } }",
"variables": { "owner": "OWNER", "repo": "REPO" }
}
QUERY
```
Note: `HEAD` in the GraphQL expression is a Git ref, not a placeholder — do not replace it.
If any entry has `isTruncated: true`, or the response errors due to size, fall back to the REST API. Never edit or commit a truncated file: the commit replaces each file with exactly the content you send. Fall back as follows: fetch the default branch and HEAD SHA via `gh api repos/OWNER/REPO --jq '.default_branch'` and `gh api repos/OWNER/REPO/git/ref/heads/DEFAULT_BRANCH --jq '.object.sha'`, then fetch workflow file names via `gh api repos/OWNER/REPO/contents/.github/workflows` and each file individually via `gh api repos/OWNER/REPO/contents/.github/workflows/FILE_NAME`. The response `content` field is base64-encoded — decode it before scanning for `runs-on:` values.
Save `defaultBranchRef.name` (or REST default branch), `.target.oid` / HEAD SHA, and workflow `entries[]`. Scan each `.yml`/`.yaml` file for:
- direct `runs-on:` string values that match the runner-mapping rules, and
- matrix-driven patterns (e.g., `runs-on: ${{ matrix.os }}`) where the matrix values match the runner-mapping rules.
Skip these and list each under "Not migrated" with its reason, so nothing is dropped silently:
- **Shared workflows.** A file triggered by `workflow_call` is a reusable workflow. Changing its runners also changes them for every workflow that calls it, including callers in other repositories that the GitHub App may not cover.
- **Jobs that call a reusable workflow** (`uses:` instead of `steps:`). They have no `runs-on` of their own; the called workflow sets the runner.
- **Any `runs-on` that is not a plain label or a hardcoded matrix value:** inputs (`${{ inputs.runner }}`), variables (`${{ vars.RUNNER }}`), ternaries, `fromJSON(...)`, YAML aliases (`*name`), and the anchors they point to (`&name`): changing an anchor's label also changes every job that uses its alias.
Get the default branch's required status checks, because migrating a matrix renames its checks (for example `test (ubuntu-latest)` becomes `test (starsling-ubuntu-26.04)`):
```bash
gh api repos/OWNER/REPO/rules/branches/DEFAULT_BRANCH --jq '.[] | select(.type == "required_status_checks") | .parameters.required_status_checks[].context'
gh api repos/OWNER/REPO/branches/DEFAULT_BRANCH/protection/required_status_checks --jq '.contexts[]'
```
A 404 on the second call means there is no classic branch protection. If a call returns 403, you cannot see the required checks: say so in the preview, and warn that check names for migrated matrix jobs will change.
For each workflow, note whether this migration PR exercises it. A `pull_request` workflow whose branch and path filters match runs on this PR. A `push` workflow whose branch and path filters match the migration branch also runs on that branch, because the migration commit is a push. A workflow triggered only by `pull_request_target`, `schedule`, `workflow_run`, `workflow_dispatch`, `release`, or a `push` filter that excludes the migration branch uses the default branch's copy, so it first runs on StarSling after merge.
Show the user a summary including:
- Workflows that will be migrated and the exact source → target mapping for each runner label
- The source and target OS version, architecture, vCPU size, and target price per minute for every mapping, plus any size or cost change required by the runner-mapping rules
- Whether each migrated workflow runs on this PR, or first runs after merge
- Everything listed as "Not migrated", with the reason
If no direct or matrix-backed runners match, show the "Not migrated" list, then stop.
### Step 4: Preview Changes
**Never create a PR without the user confirming changes first.**
Show what will change per workflow:
- Replace matching runners in `runs-on:` string values with the target selected by the runner-mapping rules (preserve quotes/comments)
- Replace matching matrix values as described under **Expressions** below
- Skip commented lines
**Provider-only migration:** This migration must preserve any explicitly named Ubuntu version, CPU architecture, and vCPU size. Do not combine a provider migration with an OS, architecture, or size change. The only exceptions are GitHub's standard runners, which move to 4 vCPU, and `ubuntu-latest`, which follows its own mapping rule above, including the OS-upgrade warning. State both in the preview. If an exact mapping is unavailable, skip the label and flag it for manual review.
**Complex `runs-on` patterns:**
- **Array syntax** (e.g., `runs-on: [linux, ubuntu-latest]`): If the array contains `self-hosted`, skip it and flag it for manual review, because it targets the organization's own runners. Otherwise replace only the matching label within the array; do not collapse it to a single string
- **Group/labels syntax** (e.g., `runs-on: { group: ..., labels: [...] }`): Skip and flag for manual review
- **Expressions** (`${{ matrix.os }}`): If `runs-on` uses a matrix value and the matrix values are hardcoded runner labels, first search the whole workflow file for each label you would replace. Inside the job's `strategy.matrix` block, the label may appear in the value list and in `include` and `exclude` entries; replace it in all of them, so they stay consistent. If the label appears anywhere outside that block (for example `if: matrix.os == 'ubuntu-latest'`, or a job `name:`), do not migrate that workflow: renaming the label would silently change those conditions. Skip it and flag it for manual review, naming the lines that reference the label. Also skip it if a required status check name contains the label. Otherwise, replace the labels and flag the workflow for manual verification. If the matrix values come from other expressions, skip entirely and flag for manual review. Every other expression is skipped as described in Discover Workflows
**YAML fidelity:** Change ONLY the `runs-on` and matrix values. Preserve the original file exactly: same indentation, key ordering, comments, blank lines, and trailing newline. The PR diff should show only the runner label changes.
### Step 5: Create PR
**Existing migration PR:** First check for an open PR from an earlier run:
```bash
gh pr list --repo OWNER/REPO --state open --json headRefName,url --jq '.[] | select(.headRefName | startswith("migrate-starsling-runners")) | .url'
```
If any exist, show them all to the user and ask whether to close them and open a new one, or stop. Do not open a second migration PR without their answer.
**Branch:** Before creating, check for existing branches: `gh api repos/OWNER/REPO/git/matching-refs/heads/migrate-starsling-runners --jq '.[].ref'`. If any exist, find the highest numeric suffix and increment by 1 (if none have a suffix, use `-2`). Then create: `gh api repos/OWNER/REPO/git/refs -f ref=refs/heads/BRANCH_NAME -f sha=HEAD_OID`.
**Atomic commit** — all files in one commit, contents base64-encoded. Write each edited workflow to a file and encode it from that file without line breaks, so trailing newlines survive and the JSON string stays on one line:
```bash
base64 < EDITED_FILE | tr -d '\n'
```
Build the mutation JSON with a tool that escapes strings correctly (such as `jq`), not by pasting into a shell string.
```bash
cat <<'MUTATION' | gh api graphql --input -
{
"query": "mutation($input: CreateCommitOnBranchInput!) { createCommitOnBranch(input: $input) { commit { oid url } } }",
"variables": {
"input": {
"branch": {
"repositoryNameWithOwner": "OWNER/REPO",
"branchName": "BRANCH_NAME"
},
"message": {
"headline": "Migrate N CI workflows to StarSling Runners",
"body": "Replaced runners per file:\n- file1.yml: ubuntu-latest → starsling-ubuntu-26.04\n- file2.yml: ubuntu-24.04 → starsling-ubuntu-24.04"
},
"expectedHeadOid": "HEAD_OID",
"fileChanges": {
"additions": [
{ "path": ".github/workflows/FILE_NAME", "contents": "BASE64_CONTENT" }
]
}
}
}
}
MUTATION
```
Verify the response contains a valid `commit.oid`. If the call fails, or its result is unclear (for example a timeout), the commit may still have landed. Read the branch before doing anything else:
```bash
gh api repos/OWNER/REPO/git/ref/heads/BRANCH_NAME --jq '.object.sha'
```
- Still `HEAD_OID`: no commit landed. Delete the branch so no empty branch is left behind, then report the error and stop:
```bash
gh api -X DELETE repos/OWNER/REPO/git/refs/heads/BRANCH_NAME
```
- Any other SHA: a commit landed, so never delete the branch. If that commit's headline is your `Migrate N CI workflows to StarSling Runners` message, continue to the PR. Otherwise something else changed the branch (this is also what an `expectedHeadOid` mismatch means): report and stop.
Do not create a PR against a failed commit.
A permissions error on a workflow file usually means the token lacks the `workflow` scope (see Verify GitHub Access and Get the Repository).
**Commit message:** The headline should read `Migrate N CI workflows to StarSling Runners` where N is the count of modified workflow files (`.yml` + `.yaml`). List each file and the runner label(s) replaced in the body, as shown in the example above.
**PR:** Write the body to a file, for example with a quoted heredoc (`cat > PR_BODY_FILE <<'EOF'`) or your own file-editing tool, so no shell runs its backticks or expands `${{ }}`. Then run `gh pr create --repo OWNER/REPO --head BRANCH_NAME --base DEFAULT_BRANCH --title "Migrate N CI workflows to StarSling Runners" --body-file PR_BODY_FILE`. Use this body structure:
```
## Summary
Migrates CI workflows to [StarSling Runners](https://docs.starsling.dev) for faster builds and AI-powered optimizations.
## Changes
- `file1.yml`: `ubuntu-latest` → `starsling-ubuntu-26.04` (2 → 4 vCPU, $X/min)
- `file2.yml`: `ubuntu-24.04` → `starsling-ubuntu-24.04` (2 → 4 vCPU, $X/min)
## Size and cost
(Every vCPU or cost change from the runner-mapping rules, and the OS-upgrade note for `ubuntu-latest`.)
## Not exercised by this PR
- `release.yml`: runs on `release` — first runs on StarSling after merge
(or "Every migrated workflow runs on this PR.")
## Not Migrated
- `file3.yml`: Uses `${{ matrix.os }}` — requires manual review
(or "All workflows migrated successfully.")
## After Merging
Workflows will automatically run on StarSling Runners. Ensure the [StarSling GitHub App](https://github.com/apps/starslingdev) is installed with access to this repo.
```
**Never push to or merge into `DEFAULT_BRANCH`.** After the pull request is created, give the user its link, then continue with Monitor.
### Step 6: Monitor (Optional)
Always ask this once the pull request is open, before you finish: ask the user if they'd like help monitoring after merge. If yes, explain they can return after merging and you'll check with:
```bash
gh run list --repo OWNER/REPO --branch DEFAULT_BRANCH --limit 5 --json status,conclusion,name,createdAt
```
Look for runs created after the merge. If any show `queued` for more than 2 minutes, suggest checking the GitHub App installation and repo access at https://github.com/apps/starslingdev.
## Error Handling
| Error | Solution |
|-------|----------|
| `gh` not found or not logged in | Install from https://cli.github.com/, run `gh auth login` |
| Label reference unavailable | Map only `ubuntu-latest`, `ubuntu-26.04`, and `ubuntu-24.04` to their base StarSling labels, and skip sized labels |
| 403 / insufficient permissions | User needs write access to the repository — check collaborator status or org role |
| App not installed | Install from https://github.com/apps/starslingdev |
| Personal repo (owner type `User`) | StarSling requires an org repo — create one at https://github.com/account/organizations/new |
| Repository not found | Check repo name and permissions |
| No workflows found | Ensure `.github/workflows/` exists |
| Runner not available after merge | Verify app has repo access at https://github.com/apps/starslingdev |
| Rate limit exceeded | Wait a few minutes and retry |
| 422 on branch creation | Branch exists — append a number suffix |
| `expectedHeadOid` mismatch | The new branch changed after you created it — do not delete it; report and stop |
| Commit fails on `.github/workflows` permissions | Token lacks the `workflow` scope — if the branch still points to `HEAD_OID`, delete it; ask the user to run `gh auth refresh -h github.com -s workflow`, then retry from Create PR |
| Repository not on github.com | StarSling supports github.com only — stop |
| Open migration PR already exists | Show it and ask the user before opening another |
| `${{ matrix.os }}` / complex `runs-on` | Require manual review — determined at runtime |
| GraphQL response or a file truncated (`isTruncated`) | Fall back to REST API for individual file fetches |
````
### Option B: Manual Update
Change your `runs-on` label from GitHub-hosted to StarSling:
```
starsling-ubuntu-26.04
```
### Before
```yaml title=".github/workflows/ci.yml"
jobs:
build:
runs-on: ubuntu-latest # [!code highlight]
steps:
- uses: actions/checkout@v4
# ... your build steps
```
### After
```yaml title=".github/workflows/ci.yml"
jobs:
build:
runs-on: starsling-ubuntu-26.04 # [!code highlight]
steps:
- uses: actions/checkout@v4
# ... your build steps
```
That's it. Push your changes and watch your builds fly.
## Label Mapping
Use `starsling-ubuntu-26.04` (4 vCPU / 16 GB) for `ubuntu-latest` or `ubuntu-26.04`. To keep Ubuntu 24.04, use its matching label:
| GitHub-hosted Label | StarSling Label |
| ------------------- | ------------------------ |
| `ubuntu-latest` | `starsling-ubuntu-26.04` |
| `ubuntu-26.04` | `starsling-ubuntu-26.04` |
| `ubuntu-24.04` | `starsling-ubuntu-24.04` |
Ubuntu 26.04 is the recommended default. Moving from Ubuntu 24.04 changes the OS image; review the [upgrade notes](https://docs.starsling.dev/configuration/migration-guide#upgrading-from-ubuntu-2404) and test before merging.
StarSling also offers additional runner sizes (2, 8, 16, 32, and 64 vCPU). See [Instance Types](https://docs.starsling.dev/runners/instance-types) for the full label reference.
## What's Next?
# Onboard a Repository to StarSling
Set up StarSling for the user's repository from start to finish: install the StarSling GitHub App, install and authenticate the Sling CLI, install the sling skill for the current coding agent, and migrate the repository's GitHub Actions workflows to StarSling Runners.
Pause whenever the user must approve something in a browser. Do not claim onboarding is complete until `sling doctor --agent` confirms the environment and the migration pull request has been created. If the Sling CLI cannot run on this machine (Step 3), still complete the migration and tell the user which Sling steps were skipped.
## Configuration
**Branch:** `migrate-starsling-runners`
**Label reference:** Before mapping any runner, fetch the current StarSling label reference:
```bash
curl -fsSL https://docs.starsling.dev/configuration/label-reference.md
```
It is the source of truth for which StarSling labels exist: OS versions, vCPU sizes, GPU labels, and the label recommended for `ubuntu-latest`. Only choose a target label that appears in it. If you cannot fetch it, tell the user, map only `ubuntu-latest`, `ubuntu-26.04`, and `ubuntu-24.04` to `starsling-ubuntu-26.04`, `starsling-ubuntu-26.04`, and `starsling-ubuntu-24.04`, and skip every sized label.
**Runner mapping:**
- This is a provider-only migration. The target must have the same Ubuntu version, CPU architecture, and vCPU count as the source, and no GPU unless the source has one. The only exceptions are GitHub's standard runners and `ubuntu-latest`, below. Treat a Linux label with no ARM marker (such as `arm` or `arm64`) as x64. If the label reference has no exact match, skip the label and flag it for manual review.
- Leave labels that already start with `starsling-` unchanged.
- GitHub's standard runners (`ubuntu-latest`, `ubuntu-26.04`, `ubuntu-24.04`) have 2 vCPU on private and internal repositories and 4 vCPU on public ones. Map them to the 4-vCPU StarSling label (no size suffix) in both cases. On a private or internal repository, say in the preview and the PR body that each job moves from 2 to 4 vCPU. On a public repository, say that GitHub's standard runners are free for public repositories, so StarSling minutes are a new cost. For every target, show its price per minute from the label reference.
- Map `ubuntu-latest` to the label the reference recommends for it. On GitHub, `ubuntu-latest` may still resolve to an older Ubuntu version for some repositories; in that case the migration is also an OS upgrade. Say so in the preview and the PR body, and ask the user to run the workflows before merging.
- When a source label explicitly names an Ubuntu version, preserve it, whatever the provider or label format (for example `2404` means Ubuntu 24.04).
- A label from another provider must state both its Ubuntu version and its vCPU count (for example `blacksmith-8vcpu-ubuntu-2404`). If either is missing, or you cannot tell whether a number is the vCPU count (for example `8x16` or a bare `-8`), skip the label. Never fall back to a default size.
- The organization's own runners are not migrated. GitHub larger runners have names the organization chooses (for example `ubuntu-latest-8-cores` or `ubuntu-24.04-16core`), so the name does not reliably state the OS version or size, and the runner may carry a static IP or private networking. An organization can even name one `ubuntu-24.04-8`. Before mapping, list the organization's larger runners:
```bash
gh api --paginate orgs/OWNER/actions/hosted-runners --jq '.runners[].name'
```
Skip any label that matches one of these names, and ask the user to check that runner's configuration in their GitHub organization settings. If you cannot list them (usually 403, because only organization owners can), say so in the preview. Do not use the self-hosted runner list to decide this: other providers' runners register as self-hosted runners too. Skip every label that is neither a GitHub standard runner label nor clearly named for another provider (such as a `blacksmith-` prefix), because it may be the organization's own runner.
- Skip macOS, Windows, ARM, and GPU runners from other providers, and Ubuntu versions the reference does not list (such as `ubuntu-22.04`). Flag each one for manual review.
Examples (labels must still be checked against the reference):
| Source | Target |
|---|---|
| `ubuntu-latest` | The label the reference recommends for `ubuntu-latest` (4 vCPU) |
| `ubuntu-24.04` | `starsling-ubuntu-24.04` (4 vCPU) |
| A third-party label that states Ubuntu 24.04 and 8 vCPU | `starsling-ubuntu-24.04-8` |
| A third-party label that states no vCPU count | Not migrated — size unknown |
| `starsling-ubuntu-24.04`, `starsling-ubuntu-24.04-gpu` | Unchanged — already StarSling |
| `ubuntu-latest-8-cores`, `ubuntu-24.04-16core` | Not migrated — the organization's own larger runner; check its configuration |
| `ubuntu-22.04` | Not migrated — no StarSling equivalent |
| `ubuntu-24.04-arm`, `macos-latest`, `windows-latest` | Not migrated — unsupported OS or architecture |
| `[self-hosted, linux, ubuntu-latest]` | Not migrated — targets the organization's own runners |
Replace all UPPERCASE placeholders (`OWNER`, `REPO`, `BRANCH_NAME`, `HEAD_OID`, `BASE64_CONTENT`, `FILE_NAME`, `N`, `DEFAULT_BRANCH`, `CURRENT_AGENT_ID`, `EDITED_FILE`, `PR_BODY_FILE`) with actual values from previous steps.
## Procedure
### Step 1: Verify GitHub Access and Get the Repository
Verify `gh auth status` succeeds. If `gh` is missing or unauthenticated, direct the user to install it from https://cli.github.com/ and run `gh auth login`. Wait for them to finish before continuing.
Check that `gh auth status` lists the `workflow` scope; changing files in `.github/workflows` requires it. If it is missing, ask the user to run `gh auth refresh -h github.com -s workflow` and wait for them. Fine-grained tokens and GitHub App tokens list no scopes; for those, continue, and treat a permissions error in Create PR as this cause.
If the current checkout's `origin` remote is a GitHub repository, suggest it: "Should I use `OWNER/REPO`?" Otherwise, ask the user for the repository (`owner/repo`). StarSling supports repositories on github.com only. If the repository is on another host (GitHub Enterprise Server or a `*.ghe.com` domain), stop and explain this.
Then run:
```bash
gh api repos/OWNER/REPO --jq '.owner.type, .visibility'
```
If the owner type is `User` rather than `Organization`, stop and explain: "StarSling Runners only work with GitHub organization repositories. You can create a free organization at https://github.com/account/organizations/new." Save the visibility (`public`, `private`, or `internal`) for the runner mapping.
### Step 2: Install the StarSling GitHub App
Check whether the App is installed:
```bash
gh api --paginate orgs/OWNER/installations --jq '.installations[] | select(.app_slug == "starslingdev") | .repository_selection'
```
- `all`: the App can access every repository in the organization. Tell the user and continue.
- `selected`: the App is installed for some repositories. Ask the user to confirm that `REPO` is one of them.
- No output: the App is not installed.
- An error (usually 403, because only organization owners can list installations): you cannot tell. Ask the user.
When the App is not installed or you cannot tell, ask the user: "Have you installed the [StarSling GitHub App](https://github.com/apps/starslingdev) on your org? It's required for runners to pick up jobs after merge. If not, please install it first and let me know when you're ready."
**Unless the check returned `all`, do not proceed until the user explicitly confirms the App is installed with access to the target repository.**
### Step 3: Install the Sling CLI
First run `command -v sling`. If Sling is already installed, run `sling --version` and continue.
The CLI supports Apple Silicon macOS and x64 glibc Linux. On another platform, tell the user the Sling CLI cannot be installed here, skip Steps 3 to 5, and continue with Step 6. The workflow migration only needs `gh`.
If Sling is missing on a supported platform, tell the user you are about to run the official installer, and run it once they agree:
```bash
curl -fsSL https://runners.starsling.dev/cli/install.sh | sh
```
After installation, confirm both `command -v sling` and `sling --version` succeed.
### Step 4: Install the sling skill
Determine the Skills CLI identifier for the coding agent currently running this prompt, such as `claude-code`, `codex`, or `cursor`. Before using project scope, compare the current checkout's `origin` remote with `OWNER/REPO`. If they match, install the sling skill for that agent in the current project:
```bash
npx skills add starslingdev/skills --skill sling --agent CURRENT_AGENT_ID --yes
```
Verify it appears for the current agent:
```bash
npx skills list --agent CURRENT_AGENT_ID
```
Also confirm that the install path the installer printed is inside the checkout of `OWNER/REPO`. `skills list` reports the project the command ran from, so it passes even when the skill was installed into a different directory.
If the checkout does not match `OWNER/REPO`, do not install into the unrelated project. Ask the user to open a checkout of the target repository, or ask whether they want a global installation instead. With their approval, install and verify globally:
```bash
npx skills add starslingdev/skills --skill sling --agent CURRENT_AGENT_ID --global --yes
npx skills list --agent CURRENT_AGENT_ID --global
```
If you cannot determine the current agent identifier, ask the user which Skills CLI identifier to use (for example `claude-code`). Do not run the installer without `--agent` and `--yes`: it prompts interactively, and you cannot answer those prompts. If the user prefers, give them the command without those flags to run in their own terminal.
### Step 5: Authenticate and Verify Sling
If the user's terminal and the coding agent share the same machine and user account, ask the user to run `sling login` in their own terminal and complete the GitHub browser approval. Do not run it yourself in this case. If the agent runs on a separate host or in a container whose credentials are not shared with the user's terminal, run `sling login` (without `--agent`) in the agent's CLI environment in the background, with its output redirected to a file, because it does not exit until the user approves. Read the device code and approval URL from that file, relay them to the user, wait for them to approve it in their browser, and poll `sling whoami --agent` until it succeeds. Never use `sling login --agent`. In either case, wait for approval before continuing, then run:
```bash
sling doctor --agent
sling whoami --agent
```
Read every doctor check. Exit `0` means the environment is healthy; exit `10` means a real check failed and still returns the checks. Resolve actionable failures before continuing. Advisory `version`, `auto_update`, or `agent_skill` checks do not make the environment unhealthy. Compare `local.org.slug` from `sling whoami --agent` with `OWNER`. If they differ, run `sling org switch OWNER --agent`, then run `sling whoami --agent` again and verify `local.org.slug` matches before continuing. If the switch exits `2`, show the user the organizations it lists and ask which one to use.
### Step 6: Discover Workflows
Fetch all workflow files in one API call:
```bash
cat <<'QUERY' | gh api graphql --input -
{
"query": "query($owner: String!, $repo: String!) { repository(owner: $owner, name: $repo) { id nameWithOwner defaultBranchRef { name target { oid } } object(expression: \"HEAD:.github/workflows\") { ... on Tree { entries { name object { ... on Blob { text isTruncated byteSize } } } } } } }",
"variables": { "owner": "OWNER", "repo": "REPO" }
}
QUERY
```
Note: `HEAD` in the GraphQL expression is a Git ref, not a placeholder — do not replace it.
If any entry has `isTruncated: true`, or the response errors due to size, fall back to the REST API. Never edit or commit a truncated file: the commit replaces each file with exactly the content you send. Fall back as follows: fetch the default branch and HEAD SHA via `gh api repos/OWNER/REPO --jq '.default_branch'` and `gh api repos/OWNER/REPO/git/ref/heads/DEFAULT_BRANCH --jq '.object.sha'`, then fetch workflow file names via `gh api repos/OWNER/REPO/contents/.github/workflows` and each file individually via `gh api repos/OWNER/REPO/contents/.github/workflows/FILE_NAME`. The response `content` field is base64-encoded — decode it before scanning for `runs-on:` values.
Save `defaultBranchRef.name` (or REST default branch), `.target.oid` / HEAD SHA, and workflow `entries[]`. Scan each `.yml`/`.yaml` file for:
- direct `runs-on:` string values that match the runner-mapping rules, and
- matrix-driven patterns (e.g., `runs-on: ${{ matrix.os }}`) where the matrix values match the runner-mapping rules.
Skip these and list each under "Not migrated" with its reason, so nothing is dropped silently:
- **Shared workflows.** A file triggered by `workflow_call` is a reusable workflow. Changing its runners also changes them for every workflow that calls it, including callers in other repositories that the GitHub App may not cover.
- **Jobs that call a reusable workflow** (`uses:` instead of `steps:`). They have no `runs-on` of their own; the called workflow sets the runner.
- **Any `runs-on` that is not a plain label or a hardcoded matrix value:** inputs (`${{ inputs.runner }}`), variables (`${{ vars.RUNNER }}`), ternaries, `fromJSON(...)`, YAML aliases (`*name`), and the anchors they point to (`&name`): changing an anchor's label also changes every job that uses its alias.
Get the default branch's required status checks, because migrating a matrix renames its checks (for example `test (ubuntu-latest)` becomes `test (starsling-ubuntu-26.04)`):
```bash
gh api repos/OWNER/REPO/rules/branches/DEFAULT_BRANCH --jq '.[] | select(.type == "required_status_checks") | .parameters.required_status_checks[].context'
gh api repos/OWNER/REPO/branches/DEFAULT_BRANCH/protection/required_status_checks --jq '.contexts[]'
```
A 404 on the second call means there is no classic branch protection. If a call returns 403, you cannot see the required checks: say so in the preview, and warn that check names for migrated matrix jobs will change.
For each workflow, note whether this migration PR exercises it. A `pull_request` workflow whose branch and path filters match runs on this PR. A `push` workflow whose branch and path filters match the migration branch also runs on that branch, because the migration commit is a push. A workflow triggered only by `pull_request_target`, `schedule`, `workflow_run`, `workflow_dispatch`, `release`, or a `push` filter that excludes the migration branch uses the default branch's copy, so it first runs on StarSling after merge.
Show the user a summary including:
- Workflows that will be migrated and the exact source → target mapping for each runner label
- The source and target OS version, architecture, vCPU size, and target price per minute for every mapping, plus any size or cost change required by the runner-mapping rules
- Whether each migrated workflow runs on this PR, or first runs after merge
- Everything listed as "Not migrated", with the reason
If no direct or matrix-backed runners match, show the "Not migrated" list, then stop.
### Step 7: Preview Changes
**Never create a PR without the user confirming changes first.**
Show what will change per workflow:
- Replace matching runners in `runs-on:` string values with the target selected by the runner-mapping rules (preserve quotes/comments)
- Replace matching matrix values as described under **Expressions** below
- Skip commented lines
**Provider-only migration:** This migration must preserve any explicitly named Ubuntu version, CPU architecture, and vCPU size. Do not combine a provider migration with an OS, architecture, or size change. The only exceptions are GitHub's standard runners, which move to 4 vCPU, and `ubuntu-latest`, which follows its own mapping rule above, including the OS-upgrade warning. State both in the preview. If an exact mapping is unavailable, skip the label and flag it for manual review.
**Complex `runs-on` patterns:**
- **Array syntax** (e.g., `runs-on: [linux, ubuntu-latest]`): If the array contains `self-hosted`, skip it and flag it for manual review, because it targets the organization's own runners. Otherwise replace only the matching label within the array; do not collapse it to a single string
- **Group/labels syntax** (e.g., `runs-on: { group: ..., labels: [...] }`): Skip and flag for manual review
- **Expressions** (`${{ matrix.os }}`): If `runs-on` uses a matrix value and the matrix values are hardcoded runner labels, first search the whole workflow file for each label you would replace. Inside the job's `strategy.matrix` block, the label may appear in the value list and in `include` and `exclude` entries; replace it in all of them, so they stay consistent. If the label appears anywhere outside that block (for example `if: matrix.os == 'ubuntu-latest'`, or a job `name:`), do not migrate that workflow: renaming the label would silently change those conditions. Skip it and flag it for manual review, naming the lines that reference the label. Also skip it if a required status check name contains the label. Otherwise, replace the labels and flag the workflow for manual verification. If the matrix values come from other expressions, skip entirely and flag for manual review. Every other expression is skipped as described in Discover Workflows
**YAML fidelity:** Change ONLY the `runs-on` and matrix values. Preserve the original file exactly: same indentation, key ordering, comments, blank lines, and trailing newline. The PR diff should show only the runner label changes.
### Step 8: Create PR
**Existing migration PR:** First check for an open PR from an earlier run:
```bash
gh pr list --repo OWNER/REPO --state open --json headRefName,url --jq '.[] | select(.headRefName | startswith("migrate-starsling-runners")) | .url'
```
If any exist, show them all to the user and ask whether to close them and open a new one, or stop. Do not open a second migration PR without their answer.
**Branch:** Before creating, check for existing branches: `gh api repos/OWNER/REPO/git/matching-refs/heads/migrate-starsling-runners --jq '.[].ref'`. If any exist, find the highest numeric suffix and increment by 1 (if none have a suffix, use `-2`). Then create: `gh api repos/OWNER/REPO/git/refs -f ref=refs/heads/BRANCH_NAME -f sha=HEAD_OID`.
**Atomic commit** — all files in one commit, contents base64-encoded. Write each edited workflow to a file and encode it from that file without line breaks, so trailing newlines survive and the JSON string stays on one line:
```bash
base64 < EDITED_FILE | tr -d '\n'
```
Build the mutation JSON with a tool that escapes strings correctly (such as `jq`), not by pasting into a shell string.
```bash
cat <<'MUTATION' | gh api graphql --input -
{
"query": "mutation($input: CreateCommitOnBranchInput!) { createCommitOnBranch(input: $input) { commit { oid url } } }",
"variables": {
"input": {
"branch": {
"repositoryNameWithOwner": "OWNER/REPO",
"branchName": "BRANCH_NAME"
},
"message": {
"headline": "Migrate N CI workflows to StarSling Runners",
"body": "Replaced runners per file:\n- file1.yml: ubuntu-latest → starsling-ubuntu-26.04\n- file2.yml: ubuntu-24.04 → starsling-ubuntu-24.04"
},
"expectedHeadOid": "HEAD_OID",
"fileChanges": {
"additions": [
{ "path": ".github/workflows/FILE_NAME", "contents": "BASE64_CONTENT" }
]
}
}
}
}
MUTATION
```
Verify the response contains a valid `commit.oid`. If the call fails, or its result is unclear (for example a timeout), the commit may still have landed. Read the branch before doing anything else:
```bash
gh api repos/OWNER/REPO/git/ref/heads/BRANCH_NAME --jq '.object.sha'
```
- Still `HEAD_OID`: no commit landed. Delete the branch so no empty branch is left behind, then report the error and stop:
```bash
gh api -X DELETE repos/OWNER/REPO/git/refs/heads/BRANCH_NAME
```
- Any other SHA: a commit landed, so never delete the branch. If that commit's headline is your `Migrate N CI workflows to StarSling Runners` message, continue to the PR. Otherwise something else changed the branch (this is also what an `expectedHeadOid` mismatch means): report and stop.
Do not create a PR against a failed commit.
A permissions error on a workflow file usually means the token lacks the `workflow` scope (see Verify GitHub Access and Get the Repository).
**Commit message:** The headline should read `Migrate N CI workflows to StarSling Runners` where N is the count of modified workflow files (`.yml` + `.yaml`). List each file and the runner label(s) replaced in the body, as shown in the example above.
**PR:** Write the body to a file, for example with a quoted heredoc (`cat > PR_BODY_FILE <<'EOF'`) or your own file-editing tool, so no shell runs its backticks or expands `${{ }}`. Then run `gh pr create --repo OWNER/REPO --head BRANCH_NAME --base DEFAULT_BRANCH --title "Migrate N CI workflows to StarSling Runners" --body-file PR_BODY_FILE`. Use this body structure:
```
## Summary
Migrates CI workflows to [StarSling Runners](https://docs.starsling.dev) for faster builds and AI-powered optimizations.
## Changes
- `file1.yml`: `ubuntu-latest` → `starsling-ubuntu-26.04` (2 → 4 vCPU, $X/min)
- `file2.yml`: `ubuntu-24.04` → `starsling-ubuntu-24.04` (2 → 4 vCPU, $X/min)
## Size and cost
(Every vCPU or cost change from the runner-mapping rules, and the OS-upgrade note for `ubuntu-latest`.)
## Not exercised by this PR
- `release.yml`: runs on `release` — first runs on StarSling after merge
(or "Every migrated workflow runs on this PR.")
## Not Migrated
- `file3.yml`: Uses `${{ matrix.os }}` — requires manual review
(or "All workflows migrated successfully.")
## After Merging
Workflows will automatically run on StarSling Runners. Ensure the [StarSling GitHub App](https://github.com/apps/starslingdev) is installed with access to this repo.
```
**Never push to or merge into `DEFAULT_BRANCH`.** After the pull request is created, give the user its link, then continue with Monitor.
### Step 9: Monitor (Optional)
Always ask this once the pull request is open, before you finish: ask the user if they'd like help monitoring after merge. If yes, explain they can return after merging and you'll check with:
```bash
gh run list --repo OWNER/REPO --branch DEFAULT_BRANCH --limit 5 --json status,conclusion,name,createdAt
```
Look for runs created after the merge. If any show `queued` for more than 2 minutes, suggest checking the GitHub App installation and repo access at https://github.com/apps/starslingdev.
## Error Handling
| Error | Solution |
|-------|----------|
| `gh` not found or not logged in | Install from https://cli.github.com/, run `gh auth login` |
| `sling` not found | Run the official installer from Step 3, then verify `sling --version` |
| Unsupported CLI platform | The Sling CLI requires Apple Silicon macOS or x64 glibc Linux — skip Steps 3 to 5, tell the user, and continue the migration from Step 6 |
| Sling default org differs from `OWNER` | Run `sling org switch OWNER --agent`, or ask the user which organization to use |
| Sling not authenticated | Ask the user to run `sling login` and complete the browser approval |
| sling skill missing for the current agent | Re-run Step 4 with the correct Skills CLI agent identifier |
| sling skill installed outside the target checkout | Remove it with `npx skills remove --skill sling --agent CURRENT_AGENT_ID --yes` from that directory, then re-run Step 4 from the checkout of `OWNER/REPO` |
| Label reference unavailable | Map only `ubuntu-latest`, `ubuntu-26.04`, and `ubuntu-24.04` to their base StarSling labels, and skip sized labels |
| 403 / insufficient permissions | User needs write access to the repository — check collaborator status or org role |
| App not installed | Install from https://github.com/apps/starslingdev |
| Personal repo (owner type `User`) | StarSling requires an org repo — create one at https://github.com/account/organizations/new |
| Repository not found | Check repo name and permissions |
| No workflows found | Ensure `.github/workflows/` exists |
| Runner not available after merge | Verify app has repo access at https://github.com/apps/starslingdev |
| Rate limit exceeded | Wait a few minutes and retry |
| 422 on branch creation | Branch exists — append a number suffix |
| `expectedHeadOid` mismatch | The new branch changed after you created it — do not delete it; report and stop |
| Commit fails on `.github/workflows` permissions | Token lacks the `workflow` scope — if the branch still points to `HEAD_OID`, delete it; ask the user to run `gh auth refresh -h github.com -s workflow`, then retry from Create PR |
| Repository not on github.com | StarSling supports github.com only — stop |
| Open migration PR already exists | Show it and ask the user before opening another |
| `${{ matrix.os }}` / complex `runs-on` | Require manual review — determined at runtime |
| GraphQL response or a file truncated (`isTruncated`) | Fall back to REST API for individual file fetches |
# Instance Types (/runners/instance-types)
[StarSling Runners](https://starsling.dev/products/runners) are built on Linux Ubuntu with pre-installed tools for common CI/CD workflows. The [Sandbox Router](https://docs.starsling.dev/runners/sandbox-router) selects the environment behind each label for the job you run, and [Afterburner](https://docs.starsling.dev/runners/afterburner) adds up to 25% more CPU and 50% more RAM during intensive steps, at no extra cost.
## Runner Labels
Choose a runner label based on the compute resources your job requires. For non-default sizes, the numeric suffix on each label indicates the vCPU count (e.g. `-8` = 8 vCPU). The label without a suffix is the 4 vCPU default.
| Label | OS | vCPU | Memory | Price per minute |
| --------------------------- | ------------ | ---- | ------ | ---------------- |
| `starsling-ubuntu-26.04-2` | Ubuntu 26.04 | 2 | 8 GB | $0.004 |
| `starsling-ubuntu-26.04` | Ubuntu 26.04 | 4 | 16 GB | $0.008 |
| `starsling-ubuntu-26.04-8` | Ubuntu 26.04 | 8 | 32 GB | $0.016 |
| `starsling-ubuntu-26.04-16` | Ubuntu 26.04 | 16 | 64 GB | $0.032 |
| `starsling-ubuntu-26.04-32` | Ubuntu 26.04 | 32 | 128 GB | $0.064 |
| `starsling-ubuntu-26.04-64` | Ubuntu 26.04 | 64 | 256 GB | $0.128 |
| Label | OS | vCPU | Memory | Price per minute |
| --------------------------- | ------------ | ---- | ------ | ---------------- |
| `starsling-ubuntu-24.04-2` | Ubuntu 24.04 | 2 | 8 GB | $0.004 |
| `starsling-ubuntu-24.04` | Ubuntu 24.04 | 4 | 16 GB | $0.008 |
| `starsling-ubuntu-24.04-8` | Ubuntu 24.04 | 8 | 32 GB | $0.016 |
| `starsling-ubuntu-24.04-16` | Ubuntu 24.04 | 16 | 64 GB | $0.032 |
| `starsling-ubuntu-24.04-32` | Ubuntu 24.04 | 32 | 128 GB | $0.064 |
| `starsling-ubuntu-24.04-64` | Ubuntu 24.04 | 64 | 256 GB | $0.128 |
The `starsling-ubuntu-26.04` label (4 vCPU / 16 GB) is the default and replaces the following GitHub-hosted runner labels:
* `ubuntu-latest`
* `ubuntu-26.04`
To keep Ubuntu 24.04, select its tab above and use `starsling-ubuntu-24.04` or the matching size suffix.
## Example Usage
```yaml title=".github/workflows/build.yml"
jobs:
build:
runs-on: starsling-ubuntu-26.04
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install and Build
run: |
npm ci
npm run build
```
# Sandbox Router (/runners/sandbox-router)
[StarSling Runners](https://starsling.dev/products/runners) and StarSling's agentic compute run on multiple high-performance sandbox providers. StarSling Runner labels automatically select the highest-performance environment for the workload you run. You pick a [label](https://docs.starsling.dev/runners/instance-types) for the size of the job. The Sandbox Router selects the environment behind it.
## Distributed & Resilient Compute
Most CI providers buy hardware and lock you into a specific hardware shape. StarSling does the opposite. Our agents distribute your CI jobs across high-performance sandbox providers in multiple regions and failover at the job level in under 1 second.
A regional power or cooling failure at a single-operator datacenter can take down every runner hosted there. StarSling routes around that failure: when a provider cannot start a sandbox, the job falls back to another provider. The result is higher resilience and availability than a CI platform that depends on a limited number of datacenters.
Failover is automatic. If a provider rejects a job or has an outage, the job goes to the next healthy provider.
## Telemetry Drives Routing
The same granular telemetry StarSling's AI agents use to open [optimization PRs](https://docs.starsling.dev/ai-agents/optimizations) also determines the fastest environment for each job. Routing keeps a preferred provider for each workflow, and provider weights for the organization. Both update from jobs that have already run, and both place the next job.
## High-Performance Wall-Clock Time
The wall-clock time of a CI job is queue time plus the job's own execution time. The Sandbox Router optimizes that total.
The examples below are illustrative. The timings are hypothetical, and they do not describe a specific customer or a measured result.
### Queue time between phases
A workflow with several dependent jobs, chained with `needs:`, waits in queue again at every handoff.
```yaml
jobs:
install:
runs-on: starsling-ubuntu-26.04
test:
needs: install
runs-on: starsling-ubuntu-26.04
package:
needs: test
runs-on: starsling-ubuntu-26.04
```
In a hypothetical three-job chain, each job runs for 60 seconds, and each `needs:` handoff waits 45 seconds in queue. Those two handoffs add 90 seconds of queue time to 3 minutes of execution, so a third of the wall clock is waiting between phases. For an organization whose workflows look like this, the Sandbox Router shifts that organization's provider weights toward a provider with a faster time-to-start.
### Disk-bound jobs on the same CPU
Two sandbox providers can run the same bare-metal CPU and still finish a disk-bound CI job at different speeds. The job is limited by disk I/O — installing dependencies, writing a large build output, or running tests that create thousands of files — so it is not waiting on the CPU. Suppose the same job takes 3 minutes on one provider and 5 minutes on the other. The Sandbox Router places it on the faster provider. For disk-bound workloads, StarSling Runners may also provision sandboxes with extreme disk performance, such as tmpfs (RAM-backed) workspaces.
## Zero Configuration
StarSling believes agent-native CI should be automatic and feel like magic. The Sandbox Router is zero-configuration. It is enabled by default on StarSling Runner labels, and it needs no YAML change. Keep the `runs-on` label you already use:
```yaml
runs-on: starsling-ubuntu-26.04
```
## Afterburner
The Sandbox Router also makes [Afterburner](https://docs.starsling.dev/runners/afterburner) possible. Because each job runs in its own sandbox, its resources can be resized every second. During intensive steps, Afterburner adds up to 25% more CPU and 50% more RAM, at no extra cost.
## Need exotic hardware for your CI?
If a workload needs hardware performance the existing StarSling Runner labels do not provide, contact [founders@starsling.dev](mailto:founders@starsling.dev).
StarSling's dynamic routing architecture enables us to source specialized hardware. The industry-leading [GPU Runners](https://docs.starsling.dev/runners/compute-sizing#gpu-specifications) started exactly this way.
## FAQ
### Do I have to change my workflows?
No. The Sandbox Router needs no configuration. The only change is the `runs-on` label that moves a job onto StarSling Runners. If your jobs already use a StarSling Runner label, there is nothing to change.
### Can I pin a provider or region?
Yes. If a workload needs a specific provider or region, contact [founders@starsling.dev](mailto:founders@starsling.dev).
### What happens during a provider outage?
Jobs waiting to start go to a healthy provider first. A provider that rejects jobs or has no capacity is skipped, and a degraded provider is tried only after the healthy ones, as described in [Distributed & Resilient Compute](#distributed--resilient-compute). No workflow change is needed.
# Afterburner (/runners/afterburner)
[StarSling Runners](https://starsling.dev/products/runners) run exclusively on high-performance sandboxes, not the fixed hardware shapes of GitHub and traditional CI providers. That architecture is what makes Afterburner possible.
Afterburner boosts performance during the intensive CI steps that put pressure on memory and compute. Your [label](https://docs.starsling.dev/runners/instance-types) sets the resources you pay for. When a step comes under CPU or memory pressure, Afterburner engages up to 25% more CPU cores and 50% more RAM, at *no extra cost*. When the pressure passes, the job returns to its label's resources. You get a higher-performance CI job without moving to a larger label.
Afterburner is on for every organization. Read the [launch post](https://starsling.dev/blog/adaptive-compute#afterburner) for the background.
## Fixed Fleets Lock You Into Fixed Shapes
Typical CI providers run fixed fleets of identical machines, so every job runs on one of a few fixed shapes. That forces a bad trade-off:
* **CPU-bound spikes cost you a bigger shape.** If a workload is short on CPU cores for only part of the job, the only fix is a larger fixed shape. You then pay for those cores for the whole job, including the parts that never use them.
* **Memory spikes fail jobs.** If a job sometimes uses more memory than the machine's RAM and swap, the job fails. A job that passes most of the time and sometimes runs out of memory is a flaky job.
## Adaptive, Not Overprovisioned
Afterburner is not overprovisioning. StarSling Runners resize resources live, every second, in response to the pressure each step puts on CPU and memory. Resources follow demand within the job, step by step, instead of staying fixed for the whole job.
* **A compile step that saturates every core** gets up to 25% more CPU cores while it runs.
* **A test step with a memory spike** gets up to 50% more RAM before it runs out of memory and swap.
The same label, at the same price, compared with GitHub-hosted `ubuntu-latest`:
| Runner | Afterburner | vCPU | Memory | Speedup vs. `ubuntu-latest` |
| ------------------------ | ----------- | ------- | ----------- | --------------------------- |
| `starsling-ubuntu-26.04` | Off | 4 | 16 GB | Up to 1.7x |
| `starsling-ubuntu-26.04` | Engaged | Up to 5 | Up to 24 GB | Up to 2.32x |
### Built on the Sandbox Router
StarSling Runners run on sandbox providers in multiple regions instead of one fixed fleet. Afterburner is only possible because of StarSling's [Sandbox Router](https://docs.starsling.dev/runners/sandbox-router) and its sandbox-oriented architecture. Each job runs in its own sandbox, not on a shared host with a fixed shape, so each job's resources can be resized on their own. This elasticity gets better value from the hardware, and Afterburner passes some of that value back to you.
## Telemetry Picks the Jobs That Benefit
The same machine-level telemetry that StarSling's [AI agents](https://docs.starsling.dev/ai-agents/optimizations) and the [Sandbox Router](https://docs.starsling.dev/runners/sandbox-router#telemetry-drives-routing) use also records how much CPU and memory a job usually uses. That tells us which jobs are most likely to benefit from more resources, so Afterburner engages where it helps most.
## Measure Afterburner with the CLI
The [sling CLI](https://docs.starsling.dev/sling-cli) compares jobs that ran with Afterburner against jobs that ran without it:
```bash
sling time --repo acme/api --workflow Build --group-by afterburner
```
See [Group by Afterburner](https://docs.starsling.dev/sling-cli/commands/analyze#group-by-afterburner) for how to read the output, and the other commands that show Afterburner.
## FAQ
### Do I have to change my workflows?
No. Afterburner needs no YAML change. Keep the `runs-on` label you already use:
```yaml
runs-on: starsling-ubuntu-26.04
```
### Can Afterburner reduce my resources?
No. Afterburner carries zero risk: a job never gets fewer resources than the label you pay for. Afterburner only adds resources above that.
### How often does Afterburner engage?
It depends on the job's typical resource use and on the resources available when the CI job starts. Use the [sling CLI](#measure-afterburner-with-the-cli) to see how often Afterburner engages for each job. The job logs also show when Afterburner was engaged.
### Is this a replacement for right-sizing workloads?
No. If a workload is always short on resources, the StarSling AI agents send a PR that recommends the right [label](https://docs.starsling.dev/runners/instance-types). Afterburner is for CI jobs where the runner label is right overall, but individual steps are short on resources.
# Compute Specifications (/runners/compute-sizing)
[StarSling Runners](https://starsling.dev/products/runners) come in three families:
* **CPU runners** on 5th Gen AMD EPYC processors, for CI workloads that need maximum performance.
* **GPU runners** backed by NVIDIA cards.
* **Review Runners**, optimized for code review workloads at a lower cost.
Choose a runner based on the compute resources your job requires.
## CPU Specifications
| Label | vCPU | Memory | Price per minute |
| --------------------------- | ---- | ------ | ---------------- |
| `starsling-ubuntu-26.04-2` | 2 | 8 GB | $0.004 |
| `starsling-ubuntu-26.04` | 4 | 16 GB | $0.008 |
| `starsling-ubuntu-26.04-8` | 8 | 32 GB | $0.016 |
| `starsling-ubuntu-26.04-16` | 16 | 64 GB | $0.032 |
| `starsling-ubuntu-26.04-32` | 32 | 128 GB | $0.064 |
| `starsling-ubuntu-26.04-64` | 64 | 256 GB | $0.128 |
| Label | vCPU | Memory | Price per minute |
| --------------------------- | ---- | ------ | ---------------- |
| `starsling-ubuntu-24.04-2` | 2 | 8 GB | $0.004 |
| `starsling-ubuntu-24.04` | 4 | 16 GB | $0.008 |
| `starsling-ubuntu-24.04-8` | 8 | 32 GB | $0.016 |
| `starsling-ubuntu-24.04-16` | 16 | 64 GB | $0.032 |
| `starsling-ubuntu-24.04-32` | 32 | 128 GB | $0.064 |
| `starsling-ubuntu-24.04-64` | 64 | 256 GB | $0.128 |
The numeric suffix on each label indicates the vCPU count (e.g. `-8` = 8 vCPU). The label without a suffix is the 4 vCPU default and is recommended for `ubuntu-latest` and `ubuntu-26.04`.
All CPU sizes run Ubuntu 26.04 or Ubuntu 24.04 on 5th Gen AMD EPYC. Ubuntu 26.04 is the default shown here.
## GPU Specifications
GPU runners are in **private beta**. Contact [founders@starsling.dev](mailto:founders@starsling.dev) to request access.
| Label | GPU | vCPU | Memory | Disk | Price per minute |
| -------------------------------------------- | ------------ | ---- | ------ | ------ | ---------------- |
| `starsling-ubuntu-26.04-gpu` | RTX PRO 6000 | 4 | 16 GB | 100 GB | $0.05922 |
| `starsling-ubuntu-26.04-gpu/gpus=rtx-5090:1` | RTX 5090 | 4 | 16 GB | 100 GB | $0.03022 |
| `starsling-ubuntu-26.04-gpu/gpus=rtx-4090:1` | RTX 4090 | 4 | 16 GB | 100 GB | $0.02522 |
| Label | GPU | vCPU | Memory | Disk | Price per minute |
| -------------------------------------------- | ------------ | ---- | ------ | ------ | ---------------- |
| `starsling-ubuntu-24.04-gpu` | RTX PRO 6000 | 4 | 16 GB | 100 GB | $0.05922 |
| `starsling-ubuntu-24.04-gpu/gpus=rtx-5090:1` | RTX 5090 | 4 | 16 GB | 100 GB | $0.03022 |
| `starsling-ubuntu-24.04-gpu/gpus=rtx-4090:1` | RTX 4090 | 4 | 16 GB | 100 GB | $0.02522 |
All cards are NVIDIA. Prices are all-in: each rate covers the GPU and the host it runs on, billed per minute like any other runner.
### Selecting a card
The `gpus=` selector takes a card SKU and a card count, `gpus=:`. While GPU runners are in beta they are single-card, so the count is always `1`.
`starsling-ubuntu-26.04-gpu` is shorthand for the default card — it is equivalent to `starsling-ubuntu-26.04-gpu/gpus=rtx-pro-6000:1`. See the [Label Reference](https://docs.starsling.dev/configuration/label-reference#gpu-labels) for the full label grammar and the list of card SKUs.
## Review Specifications
Review Runners are in **private beta**. Contact [founders@starsling.dev](mailto:founders@starsling.dev) to request access.
| Label | vCPU | Memory | Price per minute |
| ------------------ | ---- | ------ | ---------------- |
| `starsling-review` | 4 | 16 GB | $0.004 |
Review Runners are optimized for code review jobs. Rather than a single processor generation, they run on a blend of CPUs selected for cost, which makes them half the price of the equivalent 4 vCPU CPU runner.
Use `starsling-review` for code review workloads. For builds, tests, and other CI jobs where speed matters, use the [CPU runners](#cpu-specifications), which are sized for maximum performance.
## Performance Characteristics
StarSling CPU runners deliver excellent performance for most CI workloads:
* **Web Applications (React, Next.js, Vue)**: Fast installs and builds
* **Backend Services (Go, Rust, Java)**: Efficient parallel compilation
* **Test Suites**: Parallel test execution
Larger sizes (8 vCPU and above) are well-suited for monorepo builds, large test matrices, and compilation-heavy workloads.
## Example Usage
```yaml
runs-on: starsling-ubuntu-26.04
```
For a larger size:
```yaml
runs-on: starsling-ubuntu-26.04-8
```
On a GPU runner:
```yaml
runs-on: starsling-ubuntu-26.04-gpu
```
To pick a specific card:
```yaml
runs-on: starsling-ubuntu-26.04-gpu/gpus=rtx-5090:1
```
For a code review job:
```yaml
runs-on: starsling-review
```
## Optimization Tips
1. **Cache dependencies**: Use `actions/cache` to avoid repeated downloads
2. **Use matrix builds**: Split tests across multiple runners for parallelism
3. **Right-size your runner**: Larger isn't always better — measure before scaling up
# Disks (/runners/disks)
StarSling Disks are persistent filesystems mounted into [StarSling Runners](https://starsling.dev/products/runners) as ordinary directories. Jobs read and write files in place, without packing, uploading, downloading, or extracting an archive. Use them for dependency stores, build output, toolchains, datasets, and reference data shared across a repository's jobs.
Each disk has a name scoped to its repository. A job can mount several disks, with one [Disks action][disks-action] step per disk. Many jobs can read the same published generation concurrently; each job's writes stay private until a successful publication makes them available to later jobs.
Disks are separate from the disk size on a runner label. Those tables describe the runner's local disk. See [Compute Specifications](https://docs.starsling.dev/runners/compute-sizing).
Set up billing to use Disks at the [metered rate](#price). Examples use [`starslingdev/disks@v0`][disks-action]; pin a full commit SHA for production workflows.
## Get started
Use a [StarSling runner label](https://docs.starsling.dev/runners/instance-types), grant the job `id-token: write`, and put the Disks step before the tool writes to the target directory. The OIDC token lets StarSling verify the job; the action does not need a separate StarSling API token.
This workflow keeps pnpm's store warm. It asks to publish from the repository's default branch, while pull requests and other branches use the published contents and discard their own writes.
```yaml
name: Build
on: [push, pull_request]
jobs:
build:
runs-on: starsling-ubuntu-26.04
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: starslingdev/disks@v0
with:
preset: pnpm-store
publish: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && 'on-change' || 'never' }}
- run: pnpm install --frozen-lockfile
- run: pnpm test
```
The first use of a new name mounts an empty directory. We call that a **cold** mount. The first successful publication populates the disk; later jobs mount its published generation **warm**. A step with `publish` omitted defaults to `never` and does not keep its writes for later jobs.
## How jobs share a disk
A **generation** is the disk's single published state. Each job reads one fixed generation, selected at its first mount. Another job publishing while it runs does not change the files it sees. Disks currently allow one publisher at a time and many concurrent readers.
* **Only a default-branch job can publish.** Same-repository pull requests and jobs on other branches or tags can read, but cannot publish. A request to publish from those jobs is denied while the disk remains usable.
* **One publisher at a time.** If concurrent jobs ask to publish the same disk, only one gets the publisher lease. The others report `lease-held` and discard their writes at job end. Writes are never merged; serialize publishing jobs for a disk when every job's changes must land.
* **Publication waits for success.** StarSling publishes after the job succeeds. Failed or cancelled jobs leave the shared generation unchanged. There is no save step, and a publication failure does not change the job's result.
Fork pull requests, Dependabot pull requests, and events outside the read allow-list receive no mount. A job without `id-token: write` also runs without its disks. See the action's [error codes and failure handling][disks-errors] for how to handle these cases.
[Let us know](mailto:founders@starsling.dev) if you need hundreds of CI jobs to write to distinct files in the same generation concurrently.
## Auto-mount and paths
Before the steps of a trusted job with `id-token: write`, the runner mounts published disks under the job user's home whose last publication allowed auto-mount. These mounts are read-write; writes remain private and are discarded unless a step asks to publish them. The job log's StarSling group lists each disk's path, access, and generation, or the reason it did not mount.
Workspace disks and disks published with `auto-mount: false` always need an explicit action step. If job verification is still in progress before the steps run, home-directory disks also need the step for reads; the job log reports that case.
The action resolves the mount path in this order:
1. The step's explicit `path`.
2. The disk's stored path.
3. The preset's default path.
4. `~/.disks/` when no stored path or preset supplies one.
A leading `~/` resolves under the job user's home; a relative path resolves under `GITHUB_WORKSPACE`. Targets must be empty and within the job home or workspace, and cannot overlap another disk. The workspace root itself, Docker's data root, and container jobs are outside the action's scope.
Resolved paths must contain only printable ASCII characters without spaces. Paths containing whitespace or non-ASCII characters, and `~user` paths, fail with `invalid-input` even when `on-degraded: continue` is set.
If the disk is already mounted, the step can attach a publish intent to it. Earlier writes in the same job count toward publication too. A repeat asking for a different path or access fails with `conflicting-repeat`; it cannot turn a pre-job read-write mount into a read-only one.
### Build output in the workspace
Mount workspace disks after checkout and before the build tool writes to the directory. For example, a Rust job can keep `target/` across runs. This step belongs in a job with the same runner and permissions as the quickstart:
```yaml
- uses: actions/checkout@v4
- uses: starslingdev/disks@v0
with:
name: rust-target
path: target
publish: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && 'on-change' || 'never' }}
- run: cargo test --locked
```
For dependencies, the `cargo` preset mounts the registry, rather than all of `~/.cargo`, where the runner keeps rustup's binaries. Leave `CARGO_HOME` unset. Cargo Git dependencies need a separate named disk; build output uses a workspace path as above.
### Read-only reference data
Use `access: read-only` with `publish: never` for datasets or fixtures the job must not rewrite. If the disk lives under the home directory, its publisher must store `auto-mount: false` so the reader can request read-only access before it is mounted. `on-degraded: fail` stops the step if that access cannot be supplied.
A cold mount is still a successful mount: strict handling does not prove that reference data exists. Check the `mount` output or validate the expected files when the job requires an existing generation.
## Publish modes
Every publishing mode waits until the job succeeds and requires the job to be the disk's publisher.
| `publish` | When writes become a new generation |
| ------------ | ------------------------------------------------------------------------------------------ |
| `never` | Never; changes stay private to this job and are discarded. |
| `on-change` | The change test detects a change, or the step's settings differ from the stored ones. |
| `always` | After success, even if nothing changed. |
| `if-missing` | Only when no usable generation exists. An existing usable generation reports `not-needed`. |
The change test is what `publish: on-change` counts as a change. `content-only` counts file contents, types, owners, modes, and links. `content-and-mtime` also counts modification times, for tools that read them as freshness. The preset supplies the change test; the action has no separate change-test input.
The last successful default-branch publication stores the preset, size cap, change test, and auto-mount setting. Omitted settings return to their defaults: an omitted `size-cap` uses the preset's or API default, rather than keeping a previously customized cap.
## Disk lifetime and changes
A disk retires after a publication over its size cap, after 30 days without any step naming it, or when a new name's first publication takes its path. A retired disk mounts cold; its next publication starts again from that job's writes. Rewriting files can still grow the disk toward its cap.
To move a published disk, use a new name. Publishing the old name at a different path reports `settings-mismatch`. To replace a name at the same path, first publish the old name with `auto-mount: false`, then publish the new name there; that first publication retires the old disk. A reader can choose another path for one job only if the runner has not already mounted the disk.
## Presets
[List StarSling Disks presets](https://docs.starsling.dev/api/disks/get-disk-presets) returns every preset a step may name in `preset`, plus the limits every disk is held to. The catalog is the same for every caller.
[List an org's StarSling Disks](https://docs.starsling.dev/api/disks/list-disks) returns the disks an organization's repositories keep. Each entry includes the mount path, what the disk currently holds, and when that was published. Pass `repository_id` to limit the list to one repository. The caller must be a member of the org.
## Limits
There is no per-org disk count limit. However, single job is soft limited to mounting 10 disks.
| Limit | Value |
| ------------------------- | ------ |
| Max Disks mounted per job | 10 |
| Max size per disk | 200 GB |
An 11th new disk in one job fails the step with `disk : not mounted (mount-limit)`. Each mount takes \~1 second, so 10 disks take about 8 - 10s. Remounting a disk the job already has does not count.
## Security and deletion
StarSling Disks encrypts file contents and filenames at rest using a unique encryption key for each immutable storage layer. Deleted Disks data is removed within **48 hours**, and account deletion includes stored Disks.
See [Data Handling](https://docs.starsling.dev/security/data-handling#starsling-disks) for key scope, retention, and the [deletion process](https://docs.starsling.dev/security/data-handling#disks-deletion). The 48-hour billing delay below is separate from the data-deletion guarantee.
## Price
Storage is **$0.50 per GB-month**, with no per-job attach fee. We calculate usage by snapshotting your total storage once a day, so billed usage reflects changes in the amount you store over the month. When you delete data, you may still be billed for that storage for up to **48 hours**.
Set up billing to use Disks. The free trial does not include storage. See [Pricing](https://docs.starsling.dev/pricing#disks).
[disks-action]: https://github.com/starslingdev/disks
[disks-errors]: https://github.com/starslingdev/disks/blob/main/docs/errors-and-failures.md
# Benchmarks (/performance/benchmarks)
[StarSling Runners](https://starsling.dev/products/runners) can deliver up to 6x faster build times compared to GitHub-hosted runners, depending on workload characteristics. The best way to see the difference is to benchmark your own workflows — the guide below shows how.
## Real-World Results
What StarSling delivered for real teams after they switched `runs-on` — faster runners plus the optimizations StarSling agents shipped and the team merged:
| Repo | Metric | GitHub-hosted | StarSling | Improvement |
| ---------------------------------------------------------- | -------------------- | ------------- | --------- | ---------------- |
| [Mastra](https://starsling.dev/customers/mastra) | Slowest test suite | \~30m | \~5m | **\~6x faster** |
| [Mastra](https://starsling.dev/customers/mastra) | Job queue under load | \~15m | under 2m | **\~8x shorter** |
| [Better Auth](https://starsling.dev/customers/better-auth) | E2E runtime per job | 2m 22s | 1m 04s | **\~2x faster** |
Across all its CI and E2E jobs, Better Auth saves roughly **20,000 CI minutes every month**.
These are live customer results — each links to its case study with the full methodology and the agent-authored PRs behind the numbers.
## Why StarSling is Faster
### 1. 30% Faster Hardware
| Spec | GitHub-hosted | StarSling |
| ------ | ----------------------------- | ---------------- |
| CPU | 4th Gen AMD EPYC\* | 5th Gen AMD EPYC |
| Cores | 4 vCPU | 4 vCPU |
| Memory | 16 GB | 16 GB |
5th Gen AMD EPYC processors deliver \~30% better single-threaded performance over 4th Gen, directly improving build and test execution times.
** Not publicly disclosed by GitHub in [their docs](https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners) but inferred based on publicly available information.*
### 2. Unlimited Concurrency
No concurrency limits means every job gets a runner quicker, even during peak CI loads.
## Run Your Own Benchmark
Compare your actual workflows side by side — run the same steps on a GitHub-hosted runner and a StarSling runner, then compare the timings:
```yaml title=".github/workflows/benchmark.yml"
jobs:
github-hosted:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: time npm ci && time npm run build
starsling:
runs-on: starsling-ubuntu-26.04
steps:
- uses: actions/checkout@v4
- run: time npm ci && time npm run build
```
# Optimizations (/ai-agents/optimizations)
StarSling's AI agents continuously perform deep scans of your workflows and open PRs to optimize your CI speed. See [real examples of AI-authored PRs](https://starsling.dev/#ai-prs) or browse the [customer case studies](https://starsling.dev/customers).
This page covers StarSling's paid, hosted, continuous optimization service. To run a free, local audit on demand, launch the pinned audit with [`sling speedup`](https://docs.starsling.dev/sling-cli/commands/analyze#sling-speedup) (StarSling customers) or invoke [ci-speedup](https://docs.starsling.dev/skills/ci-speedup) directly with your own coding agent. To grade your workflow configuration against CI best practices, use [ci-score](https://docs.starsling.dev/skills/ci-score).
For new accounts, AI-powered optimization PRs are only available to customers on paid plans and are not enabled by default.
## How It Works
StarSling monitors your CI workflows and identifies opportunities to improve performance, reliability, and efficiency. When an optimization is found, StarSling opens a pull request with the suggested changes and an explanation.
## What Gets Optimized
### Caching
Detect missing or misconfigured caches and add them automatically.
* [Better Auth](https://starsling.dev/customers/better-auth): fixed a Turborepo cache that wasn't hitting between runs and cached Playwright browser installs.
* [Partcl](https://starsling.dev/customers/partcl): cached build artifacts across shards.
### Dependency installation
Suggest faster install strategies (e.g., frozen lockfiles, parallel installs).
### Build steps
Identify redundant or slow steps that can be parallelized or removed.
* [Mastra](https://starsling.dev/customers/mastra): sharded the E2E kitchen-sink suite across 3 parallel jobs.
* [Partcl](https://starsling.dev/customers/partcl): parallelized a test suite the team had never had time to split.
### Test reliability
Replace fixed `sleep` calls with real readiness checks and add service healthchecks.
* [Mastra](https://starsling.dev/customers/mastra): swapped blind sleeps for polling across MongoDB and Chroma and added Docker healthchecks.
* [Better Auth](https://starsling.dev/customers/better-auth): added Docker Compose healthchecks.
### Workflow structure
Recommend job splitting, matrix strategies, and dependency ordering.
### Runner image upgrades
StarSling agents are opening PRs to migrate customers from `starsling-ubuntu-24.04` to `starsling-ubuntu-26.04`, preserving the runner size. Review and test these OS upgrades before merging. See the [Migration Guide](https://docs.starsling.dev/configuration/migration-guide#upgrading-from-ubuntu-2404) for details and how to stay on Ubuntu 24.04.
### Runner configuration
Flag suboptimal runner labels or resource usage.
* [Partcl](https://starsling.dev/customers/partcl): right-sized the heaviest jobs from 64-core down to 8-core machines.
## How Optimizations Are Delivered
1. StarSling analyzes your workflow runs and configuration
2. When an optimization is identified, a PR is opened with the changes
3. Each PR includes an explanation of what changed and why
4. You review and merge at your own pace
> "Within a day of migrating to [StarSling Runners](https://starsling.dev/products/runners), their agents opened up a PR that literally made our Rust CI tests 2x faster!"
>
> — Vamshi Balanaga, Co-founder & CTO, [Partcl](https://starsling.dev/customers/partcl)
## See It In Action
Real CI optimizations StarSling agents have shipped, with measured before/after numbers:
See all [StarSling case studies →](https://starsling.dev/customers).
# ci-speedup (/skills/ci-speedup)
[ci-speedup](https://github.com/starslingdev/skills) is a free, open-source, MIT-licensed agent skill that runs on your machine, analyzes GitHub Actions, and gives your coding agent evidence to draft a fix. When you run the skill directly, it works independently of [StarSling Runners](https://starsling.dev/products/runners) and does not require StarSling or the StarSling GitHub App.
[See the ci-speedup overview](https://starsling.dev/ci-speedup) for a quick introduction before following the operational guide below.
## Installation Prompt
Paste this prompt into your coding agent:
```text title="AI prompt"
Run `npx skills use "https://github.com/starslingdev/skills" --skill "ci-speedup"` and follow the generated skill instructions now. Read its complete output, redirecting it to a temporary file first if necessary. Resolve relative paths from the supporting-files directory it provides.
```
[View ci-speedup on skills.sh](https://www.skills.sh/starslingdev/skills/ci-speedup).
ci-speedup is a local, on-demand audit that you invoke with your own coding agent. To grade your workflow configuration against CI best practices instead, use [ci-score](https://docs.starsling.dev/skills/ci-score); to scan it for attack vectors, use [ci-secure](https://docs.starsling.dev/skills/ci-secure). [StarSling optimization PRs](https://docs.starsling.dev/ai-agents/optimizations) are a separate paid, hosted service that continuously analyzes your CI and opens reviewable PRs once enabled.
## Before you start
You need:
* The [GitHub CLI](https://cli.github.com/) authenticated to GitHub. Run `gh auth status` to check.
* Read access to the target repository's GitHub Actions runs, jobs, and logs.
* Python 3.9 or newer and [PyYAML](https://pypi.org/project/PyYAML/).
* Node.js and npm to install or invoke the skill with `npx`.
## Install and run
Install the skill with Vercel's Skills CLI:
```bash
npx skills add starslingdev/skills
```
The CLI lets you select the coding agent and whether to install the skill for the current project or globally. It [supports a long list of coding agents](https://github.com/vercel-labs/skills#supported-agents), including Claude Code, Codex, Cursor, and OpenCode.
In a repository, invoke the installed skill from your coding agent:
```text
/ci-speedup
```
The skill confirms the repository before it starts reading run data.
## Recommended for StarSling customers
From a checkout of a repository in your StarSling organization, run:
```bash
sling speedup
```
The Sling CLI resolves the repository from its `origin` remote, asks StarSling for the current pinned ci-speedup release, downloads that release directly from GitHub, verifies its SHA-256 digest, and launches Claude Code or Codex with the audit instructions. The pin is the same for every organization; the organization check only controls access to it.
Common variants:
```bash
sling speedup --repo acme/api
sling speedup --agent-cli codex
sling speedup --agent-cli claude
```
You need:
* A signed-in [Sling CLI](https://docs.starsling.dev/sling-cli/installation).
* A github.com repository that belongs to a GitHub organization with the StarSling GitHub App installed, and you must be a member of it. Personal repositories and repositories outside your StarSling organization are refused.
* Python 3.9 or newer with PyYAML importable.
* The [GitHub CLI](https://cli.github.com/) installed and signed in to github.com.
* Claude Code or Codex on `PATH` for an interactive launch.
Already inside a coding agent? Sling hands the audit to your current agent instead of opening another one. See [launch plan mode](https://docs.starsling.dev/sling-cli/commands/analyze#launch-plan-mode) for the technical details.
The launcher supports Claude Code and Codex. For another coding agent, a repository outside your StarSling organization, or a direct open-source workflow, use the installation prompt above.
## Data handling
The audit runs on your machine through your coding agent and uses your authenticated GitHub CLI to read repository and CI data. When you invoke the skill directly, it makes no request to StarSling. When you use `sling speedup`, the launcher sends your Sling credential, organization slug, and the requested skill name to StarSling to check access and return the pinned release; it downloads that release from GitHub. Neither path sends repository contents or CI logs to StarSling. Your coding-agent provider can see the prompt and files or command output the agent reads, so that provider's data policy applies.
## Ways to run ci-speedup
| | Sling launcher | Direct skill | StarSling optimization PRs |
| ------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| **Delivery** | `sling speedup` | Agent skill you install or invoke | Hosted optimization service |
| **Execution environment** | Your machine, coding agent, authenticated `gh`, and an authenticated pin lookup through StarSling | Your machine, coding agent, and authenticated `gh` CLI | StarSling's hosted agents and GitHub App |
| **Availability** | StarSling customers auditing a repository in their organization; Claude Code or Codex | Free, open source, any repository, and any Skills-compatible coding agent | Paid plans once enabled; not enabled by default for new accounts |
| **Version and integrity** | StarSling-selected commit, downloaded once from GitHub and checksum-verified on every run | The version you install or invoke | Managed by StarSling |
| **Trigger** | On demand, when you run the command | On demand, when you invoke the skill | Continuous analysis as workflows change |
| **Output** | Local audit in Claude Code or Codex, or a JSON launch plan for agents and scripts | Local audit in your coding agent | Reviewable optimization PRs opened by StarSling |
## Resources
# ci-score (/skills/ci-score)
[ci-score](https://github.com/starslingdev/skills) is a free, open-source, MIT-licensed agent skill that runs on your machine, grades a repository's GitHub Actions configuration against CI best practices, and hands your coding agent a concrete fix for every gap. It works independently of [StarSling Runners](https://starsling.dev/products/runners) and does not require the StarSling GitHub App.
[See the ci-score overview](https://starsling.dev/ci-score) for a quick introduction before following the operational guide below.
## Installation Prompt
Paste this prompt into your coding agent:
```text title="AI prompt"
Run `npx skills use "https://github.com/starslingdev/skills" --skill "ci-score"` and follow the generated skill instructions now. Read its complete output, redirecting it to a temporary file first if necessary. Resolve relative paths from the supporting-files directory it provides.
```
[View ci-score on skills.sh](https://www.skills.sh/starslingdev/skills/ci-score).
ci-score grades configuration adherence, not speed — a fast repo can hold a low score. For a measured audit of what actually makes your CI slow, use [ci-speedup](https://docs.starsling.dev/skills/ci-speedup); for the ten critical attack vectors, use [ci-secure](https://docs.starsling.dev/skills/ci-secure). All three are local, on-demand skills; [StarSling optimization PRs](https://docs.starsling.dev/ai-agents/optimizations) are a separate paid, hosted service.
## Before you start
You need:
* A full local checkout of the repository you want to score. The score reads workflow YAML, local composite actions, and repo-root build-tool configs, so a partial view understates your setup.
* Python 3.9 or newer and [PyYAML](https://pypi.org/project/PyYAML/).
* Node.js and npm to install or invoke the skill with `npx`.
## Install and run
Install the skill with Vercel's Skills CLI:
```bash
npx skills add starslingdev/skills
```
The CLI lets you select the coding agent and whether to install the skill for the current project or globally. It [supports a long list of coding agents](https://github.com/vercel-labs/skills#supported-agents), including Claude Code, Codex, Cursor, and OpenCode.
In a repository, invoke the installed skill from your coding agent:
```text
/ci-score
```
The skill confirms the repository before it starts scoring.
## Data handling
Scoring reads only files in your local checkout and makes no network requests. Nothing is sent to StarSling. Your coding agent can see the files and results it works with, so your coding-agent provider's data policy applies.
## What the score measures
The CI Score is a pass/fail rubric of eleven configuration facts, each verifiable in your own workflow files in under a minute:
* **Dependency caching** — a cache action or a `setup-*` cache input is configured
* **Build caching** — a build-tool cache (Turbo, Nx, Gradle, sccache, Bazel) is configured
* **Shallow checkout** — no PR-gating checkout pulls full history with `fetch-depth: 0`
* **Test sharding / matrix** — a test job runs a matrix or a shard-like axis
* **Change-scoped builds** — CI scopes work to what changed
* **Concurrency groups** — a PR-triggered workflow declares a concurrency group
* **Superseded runs cancelled** — that concurrency group sets `cancel-in-progress`
* **Path filters** — a PR-triggered workflow scopes itself with `paths` / `paths-ignore`
* **Job timeouts** — jobs set `timeout-minutes` instead of GitHub's 360-minute default
* **Scoped OIDC id-token** — `id-token: write` is granted per job, never workflow-wide
* **Pinned action SHAs** — at least 95% of remote action references are pinned to a commit SHA
A check whose subject doesn't exist in your repo is not applicable and leaves the denominator. Your score is checks passed over checks applicable. The report ranks one fix per failed check by impact × risk, each with a fix recipe and a paste-able agent prompt.
Two caveats the report repeats beside the score: it measures **adherence, not speed**, and it is **not a security audit** — exactly two of the eleven checks (action pinning and OIDC token scoping) happen to be security-related.
## ci-score versus ci-speedup
| | ci-score | ci-speedup |
| ------------ | ----------------------------------------------- | ---------------------------------------------------------- |
| **Question** | Does my CI config follow best practices? | What actually makes my CI slow? |
| **Input** | Your local checkout's workflow YAML and configs | Real run history sampled over the `gh` API |
| **Output** | A score plus one ranked fix per failed check | A measured root-cause report of the merge-gating long pole |
| **Requires** | A full checkout, Python, and PyYAML | The above plus an authenticated `gh` CLI |
| **Runtime** | Seconds, fully offline | Minutes, scaling with repo size |
Both are free, open source, run on your machine, and send nothing to StarSling.
## Resources
# ci-secure (/skills/ci-secure)
[ci-secure](https://github.com/starslingdev/skills) is a free, open-source, MIT-licensed agent skill that runs on your machine, scans a repository's GitHub Actions workflows for the ten critical CI/CD attack vectors, and offers your coding agent a fix for every finding. It works independently of [StarSling Runners](https://starsling.dev/products/runners) and does not require the StarSling GitHub App.
[See the ci-secure overview](https://starsling.dev/ci-secure) for a quick introduction before following the operational guide below.
## Installation Prompt
Paste this prompt into your coding agent:
```text title="AI prompt"
Run `npx skills use "https://github.com/starslingdev/skills" --skill "ci-secure"` and follow the generated skill instructions now. Read its complete output, redirecting it to a temporary file first if necessary. Resolve relative paths from the supporting-files directory it provides.
```
[View ci-secure on skills.sh](https://www.skills.sh/starslingdev/skills/ci-secure).
ci-secure is deliberately **not** a comprehensive security audit. It checks critical exploit-chain vectors only — complete outsider-to-compromise paths with real incidents behind them. A clean ci-secure report means those ten paths are closed, not that your CI is secure. The [selection criteria and the rejection record](https://github.com/starslingdev/skills/blob/main/skills/ci-secure/references/why-these-ten.md) document what was left out and why.
ci-secure scans for attack vectors. To grade your workflow configuration against CI best practices, use [ci-score](https://docs.starsling.dev/skills/ci-score); to find what actually makes your CI slow, use [ci-speedup](https://docs.starsling.dev/skills/ci-speedup). All three are local, on-demand skills; [StarSling optimization PRs](https://docs.starsling.dev/ai-agents/optimizations) are a separate paid, hosted service.
## Before you start
You need:
* A full local checkout of the repository you want to scan, with a `.github/workflows/` directory. The skill stops early if the repo has no GitHub Actions workflows.
* Python 3.9 or newer and [PyYAML](https://pypi.org/project/PyYAML/) — the scanner's only third-party dependency.
* Node.js and npm to install or invoke the skill with `npx`.
The [GitHub CLI](https://cli.github.com/) is **optional but recommended**. Four checks need it: the impostor-SHA vector, which cannot be answered from YAML alone, the dormancy note on findings, and two repository settings read over the API. Without `gh`, the scan still runs — the impostor-SHA check reports as skipped, and the two API-gated settings report as unmeasured coverage gaps rather than as passes.
## Install and run
Install the skill with Vercel's Skills CLI:
```bash
npx skills add starslingdev/skills
```
The CLI lets you select the coding agent and whether to install the skill for the current project or globally. It [supports a long list of coding agents](https://github.com/vercel-labs/skills#supported-agents), including Claude Code, Codex, Cursor, and OpenCode.
In a repository, invoke the installed skill from your coding agent:
```text
/ci-secure
```
## Data handling
The scan reads workflow files from your local checkout. Four checks use your authenticated GitHub CLI to query GitHub for action provenance or repository settings; without `gh`, those checks are skipped or reported as unmeasured. The skill sends nothing to StarSling. Your coding agent can see the files and results it works with, so your coding-agent provider's data policy applies.
## What it scans for
Each of the ten vectors is a complete path from outside your organization to compromise, and each has a documented real-world incident behind it. Every finding renders with a "what an attacker could do" scenario rather than a rule name, so you can judge the risk without reading the detector.
* **Template injection in `run:` blocks** — attacker-controlled text is interpolated into a shell script before the shell ever sees it, so a crafted branch name or issue title executes as code on the runner.
* **Fork code executed with privileges** — a workflow on an untrusted trigger checks out and runs the attacker's head ref while holding secrets and a write token, the classic "pwn request".
* **Cache poisoning from `pull_request_target`** — a job with fork code writes the shared cache, and the poisoned entry is then restored by trusted builds on your default branch.
* **Impostor or unreachable action SHAs** — an action is pinned to a commit that is not reachable from the action's own repository, which looks like the safest possible pin while resolving to code its maintainers never published.
* **Whole-context secret dumps** — `toJSON(secrets)`, `toJSON(github)`, or `toJSON(env)` written into logs or an artifact, exposing every secret at once.
* **`$GITHUB_ENV` and `$GITHUB_PATH` hijack** — attacker-influenced text is appended to those files, letting an attacker set environment variables or prepend a directory to `PATH` for every later step.
* **Write tokens on untrusted triggers** — `pull-requests: write` and similar grants handed to a workflow anyone can trigger from a fork.
* **Credentials in caches and artifacts** — a cache or artifact `path:` that sweeps in known credential files such as `.npmrc`, `.git/config`, or a cloud credentials directory.
* **Unverified remote code execution** — `curl | bash`, and fetch-and-run against a mutable ref, where whoever controls the remote host or branch controls what runs in your job.
* **Dependency install scripts in privileged jobs** — lifecycle scripts from the dependency tree executing in a job that holds secrets, so one compromised transitive package reaches them.
## Configuration hygiene checks
Alongside the vector scan, ci-secure reports eight pass/fail configuration facts. These are hygiene, not exploit chains — a failure is a weakened defense rather than a demonstrated path in:
* **`permissions:` declared** — every workflow declares `permissions`, instead of inheriting a repository default that may be read-write everything.
* **Write grants scoped to jobs** — no workflow-level `write` for any scope except `id-token`, which is [ci-score](https://docs.starsling.dev/skills/ci-score)'s check rather than this one, and no `permissions: write-all`. Write grants belong on the jobs that need them.
* **CODEOWNERS covers workflows** — a CODEOWNERS entry covers `.github/workflows/`, so workflow changes need a specific approval rather than any approval.
* **No fork code checked out on untrusted triggers** — bare untrusted triggers pass; checking out the attacker's ref is what fails.
* **No blanket `secrets: inherit`** — reusable workflows are passed secrets by name, so a called workflow's blast radius is visible in the caller.
* **Checkout credentials not persisted** — untrusted-trigger workflows set `persist-credentials: false`, keeping the token out of `.git/config` where a later step could read it.
* **Required checks cannot be skipped** — every required status check is produced by a job that always runs. GitHub counts a skipped required check as a pass, so a check only a conditional job reports can be satisfied by never running it.
* **Fork-PR approval is effective** — the repository's approval gate covers more than accounts brand new to GitHub, a setting that otherwise gates nobody real.
Two of these read repository settings over the API, so they report as unmeasured rather than as passes when `gh` is unavailable. An unmeasured check is a coverage gap, not a clean bill.
## How the three skills differ
| | ci-secure | ci-score | ci-speedup |
| ----------------------- | ------------------------------------------------------------- | ----------------------------------------------- | ---------------------------------------------------------- |
| **Question** | Can someone outside my org compromise my CI? | Does my CI config follow best practices? | What actually makes my CI slow? |
| **Input** | Workflow YAML, plus four checks over the `gh` API | Your local checkout's workflow YAML and configs | Real run history sampled over the `gh` API |
| **Output** | Findings with attacker scenarios, and a fix offer per finding | A score plus one ranked fix per failed check | A measured root-cause report of the merge-gating long pole |
| **Requires** | A checkout, Python, and PyYAML; `gh` recommended | A full checkout, Python, and PyYAML | The above plus an authenticated `gh` CLI |
| **Zero findings means** | Those ten paths are closed, not that CI is secure | Nothing — the score is the output | No single dominant long pole was found |
All three are free, open source, run on your machine, and send nothing to StarSling.
## What it will and will not do
The skill asks which findings you want fixed and dispatches one subagent per finding group. It **never commits, pushes, or opens a pull request unasked** — by default you review the working-tree diff yourself.
Zero findings is a first-class result, reported as such rather than padded with lower-severity noise.
## Resources
# sling (/skills/sling)
[sling](https://github.com/starslingdev/skills/blob/main/skills/sling/SKILL.md) is a free, open-source, MIT-licensed agent skill that teaches your coding agent to use the [Sling CLI](https://docs.starsling.dev/sling-cli). It answers questions about live GitHub Actions runs, failed jobs, runner minutes, and cost using data collected by StarSling.
## Installation Prompt
Paste this prompt into your coding agent:
```text title="AI prompt"
Run `npx skills use "https://github.com/starslingdev/skills" --skill "sling"` and follow the generated skill instructions now. Read its complete output, redirecting it to a temporary file first if necessary. Resolve relative paths from the supporting-files directory it provides.
```
[View sling on skills.sh](https://www.skills.sh/starslingdev/skills/sling).
The skill reads live CI data from StarSling's control plane and requires the StarSling GitHub App on your organization. For a repo-wide performance audit of a repository in your StarSling organization, run [`sling speedup`](https://docs.starsling.dev/sling-cli/commands/analyze#sling-speedup); otherwise invoke [ci-speedup](https://docs.starsling.dev/skills/ci-speedup) directly. Use [ci-score](https://docs.starsling.dev/skills/ci-score) for configuration best practices or [ci-secure](https://docs.starsling.dev/skills/ci-secure) for security.
## Before you start
You need:
* The [Sling CLI installed](https://docs.starsling.dev/sling-cli/installation) on Apple Silicon macOS or x64 glibc Linux.
* The [StarSling GitHub App](https://github.com/apps/starslingdev) installed on the organization whose CI you want to inspect, with access to that organization. Personal repositories are not supported by the skill's StarSling data path.
* Node.js 22.20 or later and npm to install the skill with `npx`.
* An authenticated [GitHub CLI](https://cli.github.com/) if you want your agent to rerun or cancel runs, trigger workflows, or download artifacts.
Sign in from your own terminal, then check your setup:
```bash
sling login
sling doctor
```
Complete the browser approval yourself. The saved credential is per user, so a coding agent running as you can use it without signing in again. Signing in alone does not install the GitHub App.
## Install and run
From the target project's root directory, install the skill with Vercel's Skills CLI:
```bash
npx skills add starslingdev/skills --skill sling
```
Choose your coding agent and whether to install for the current project or globally. Then ask your agent to use the sling skill with a run or job URL, or a question about your organization's CI:
```text
Use the sling skill to explain why this GitHub Actions job failed:
```
```text
Use the sling skill to show where this run spent its time:
```
```text
Use the sling skill to find the biggest runner-minute hotspots in acme/api over the last 7 days.
```
## What the skill does
| Your question | How the skill investigates |
| ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Why did this job fail? | Starts with `sling why` for the server-classified cause, evidence, and suggested follow-up commands. |
| Where did the time go? | Uses `sling time` to break down queue wait, provisioning, steps, and teardown. |
| Which log lines matter? | Filters with `sling logs` instead of pulling an entire transcript. |
| What is using our runner minutes? | Uses `sling top` and `sling usage` to attribute time and cost. |
| What do we owe this period? | Reads `sling bill` and distinguishes the amount due from the total before credits. |
| What makes this repository's CI slow? | Names [ci-speedup](https://docs.starsling.dev/skills/ci-speedup) for a repo-wide speed audit and lets you run it, instead of approximating one from run data. |
The agent checks its environment first, requests structured JSON with `--agent`, and reads exit codes alongside the result. It reports incomplete telemetry and missing coverage instead of treating an empty response as proof that nothing happened. For a run with multiple jobs, it checks the job set before presenting one job's diagnosis as the cause of the whole run.
## Data handling and actions
The skill uses the Sling CLI to read CI data from StarSling's control plane. That data and the command output are visible to your coding agent, so your coding-agent provider's data policy applies. Reading and analysis do not change GitHub or CI state. When you ask to rerun or cancel a run, trigger a workflow, or download an artifact, the skill routes that action to `gh`, which needs its own authentication.
For a request such as “explain this failure, then rerun it,” the agent reports the diagnosis first and announces the action separately. You handle interactive login, logout, and CLI updates in your own terminal.
If Sling cannot provide a diagnosis, the skill explains what is unavailable. A GitHub CLI fallback can read accessible runs and logs, but does not provide Sling's failure classification or phase breakdown.
## Resources
# Overview (/sling-cli)
`sling` is the primary interface to the StarSling platform for agents and humans. The questions you ask most often are each a single command: [why](https://docs.starsling.dev/sling-cli/commands/analyze#sling-why) a job failed, where the [time](https://docs.starsling.dev/sling-cli/commands/analyze#sling-time) went, and what sits at the [top](https://docs.starsling.dev/sling-cli/commands/analyze#sling-top) of your spend.
## Install
### Installation Prompt
Paste this prompt into your coding agent:
```text title="AI prompt"
Install the Sling CLI on this machine.
1. Check whether `sling` is already installed. If it is, show me `sling --version` and do not reinstall it.
2. Confirm this machine is supported: Apple Silicon macOS or x64 glibc Linux. If it is not, stop and explain that the CLI cannot be installed here.
3. Before making changes, show me the official installer command and ask for approval. Once I approve, run:
curl -fsSL https://runners.starsling.dev/cli/install.sh | sh
4. Follow any PATH instructions printed by the installer, then verify both `command -v sling` and `sling --version` succeed.
5. Determine whether your environment and my terminal share the same machine and user account. If they do, give me a login command that works in my terminal—use the absolute path returned by `command -v sling`, or include the installer's PATH update—then ask me to run it and complete the GitHub browser approval. Wait for me to confirm. If you run on a separate host or in a container whose credentials my terminal cannot share, run `sling login` in your environment, relay its device code and approval URL to me, and wait for me to approve it. Do not attempt to approve the login for me.
6. Run `sling whoami` and `sling doctor`. Report the identity, organization, and every doctor result, including advisory checks.
Do not claim the installation is complete unless the binary works and the authentication checks finish successfully. If a step fails, explain the exact failure and the next action instead of skipping it.
```
### Install manually
On Apple Silicon macOS and x64 glibc Linux:
```bash
curl -fsSL https://runners.starsling.dev/cli/install.sh | sh
```
**Using Sling with a coding agent?** Install the skill with the command below. [Read the sling skill guide](https://docs.starsling.dev/skills/sling) for prerequisites, examples, and details about how it works.
From the target project's root directory, run:
```bash
npx skills add starslingdev/skills --skill sling
```
Then sign in and confirm the install:
```bash
sling login
sling --version
```
`sling login` runs the GitHub device-code flow and saves your session **per user, not per shell** — so an agent running on the same machine inherits it with no further setup.
For `PATH` setup, upgrades, digest verification, and `sling doctor`, see [Installation](https://docs.starsling.dev/sling-cli/installation).
## What you can do with it
```console copy="sling time"
$ sling time 93165914090
Job Name: Lint, typecheck, test & spell · Wall-Clock: 58s · Queue-Wait: 2s
PHASES TIME %-SHARE TIMELINE
provision 4.0s 7.14% ██░░░░░░░░░░░░░░░░░░░░░░
checkout+patch 2.0s 3.57% ░░█░░░░░░░░░░░░░░░░░░░░░
steps 46.0s 82.14% ░░░███████████████████░░
Set up Bun 1.0s ░░░█░░░░░░░░░░░░░░░░░░░░
Set up mise tools 2.0s ░░░█░░░░░░░░░░░░░░░░░░░░
Install dependencies 1.0s ░░░░█░░░░░░░░░░░░░░░░░░░
Lint (Biome) 2.0s ░░░░█░░░░░░░░░░░░░░░░░░░
Lint shell (shellcheck) 14.0s ░░░░░██████░░░░░░░░░░░░░
Lint Dockerfiles (hadolint) 0.0s ░░░░░░░░░░░█░░░░░░░░░░░░
▸ Typecheck 18.0s ░░░░░░░░░░░████████░░░░░
Test 7.0s ░░░░░░░░░░░░░░░░░░░███░░
Catalog drift 1.0s ░░░░░░░░░░░░░░░░░░░░░░█░
Spell (typos) 0.0s ░░░░░░░░░░░░░░░░░░░░░░█░
teardown 4.0s 7.14% ░░░░░░░░░░░░░░░░░░░░░░██
```
* [`sling why`](https://docs.starsling.dev/sling-cli/commands/analyze#sling-why) classifies why a job failed, with evidence and a fix to run.
* [`sling logs`](https://docs.starsling.dev/sling-cli/commands/inspect#sling-logs) filters server-side, returning only the logs that matter.
* [`sling time`](https://docs.starsling.dev/sling-cli/commands/analyze#sling-time) decomposes where the time went, phase by phase.
* [`sling top`](https://docs.starsling.dev/sling-cli/commands/analyze#sling-top) ranks what sits at the top of your spend.
* [`sling usage`](https://docs.starsling.dev/sling-cli/commands/analyze#sling-usage) attributes runner minutes and cost, grouped how you ask.
* [`sling speedup`](https://docs.starsling.dev/sling-cli/commands/analyze#sling-speedup) launches the pinned ci-speedup audit locally in Claude Code or Codex.
* [`sling bill`](https://docs.starsling.dev/sling-cli/commands/billing#sling-bill) is a read-only budget check for the open period.
## Why it exists
AI agents working inside CI jobs on [StarSling Runners](https://starsling.dev/products/runners), and the humans supervising them, have no first-class way to answer the questions CI work actually consists of: why did this job fail, where does the wall-clock go, what is burning our runner minutes, show me the logs that matter.
Those answers otherwise live behind the GitHub UI (hostile to agents), raw APIs (no diagnosis, no aggregation), and dashboards (exports, not interfaces). Agents end up screen-scraping logs into their context windows, guessing at failure causes, and unable to branch on outcomes without parsing prose. Humans get no leverage from the telemetry StarSling already collects.
## Learn more
# Installation (/sling-cli/installation)
## Installation Prompt
Paste this prompt into your coding agent:
```text title="AI prompt"
Install the Sling CLI on this machine.
1. Check whether `sling` is already installed. If it is, show me `sling --version` and do not reinstall it.
2. Confirm this machine is supported: Apple Silicon macOS or x64 glibc Linux. If it is not, stop and explain that the CLI cannot be installed here.
3. Before making changes, show me the official installer command and ask for approval. Once I approve, run:
curl -fsSL https://runners.starsling.dev/cli/install.sh | sh
4. Follow any PATH instructions printed by the installer, then verify both `command -v sling` and `sling --version` succeed.
5. Determine whether your environment and my terminal share the same machine and user account. If they do, give me a login command that works in my terminal—use the absolute path returned by `command -v sling`, or include the installer's PATH update—then ask me to run it and complete the GitHub browser approval. Wait for me to confirm. If you run on a separate host or in a container whose credentials my terminal cannot share, run `sling login` in your environment, relay its device code and approval URL to me, and wait for me to approve it. Do not attempt to approve the login for me.
6. Run `sling whoami` and `sling doctor`. Report the identity, organization, and every doctor result, including advisory checks.
Do not claim the installation is complete unless the binary works and the authentication checks finish successfully. If a step fails, explain the exact failure and the next action instead of skipping it.
```
## Install manually
On Apple Silicon macOS and x64 glibc Linux:
```bash
curl -fsSL https://runners.starsling.dev/cli/install.sh | sh
```
The installer detects your platform, downloads the matching build, verifies its SHA-256 digest, and activates it. If `~/.local/bin` is not on your `PATH`, the installer prints the `export` line to add.
It supports Apple Silicon macOS and x64 glibc Linux.
Check the install:
```bash
sling --version
```
To upgrade, rerun the same command.
## Get Started
### Authenticate
```bash
sling login
```
This runs the GitHub device-code flow: it opens an approval page, waits for you to confirm the device code, saves the session token to `~/.config/sling/credentials`, and links your default organization.
The credential is stored **per user, not per shell**, with owner-only permissions. So an AI agent running on the same machine as you inherits it: once you have signed in, the agent can run any `sling` command with no further setup. See [Configuration](https://docs.starsling.dev/sling-cli/configuration#how-agents-authenticate) for how that differs in CI.
### Check your identity
```bash
sling whoami
```
Reports your identity, org, plan, token scopes, and token expiry, so you can see exactly what the credential you just saved can reach.
### Verify
```bash
sling doctor
```
`doctor` checks your token, the control plane's reachability, clock skew, git remote, patch tooling, version, auto-update state, org resolution, whether the [sling agent skill](https://docs.starsling.dev/skills/sling) is installed for a coding agent, and whether Python 3.9+, PyYAML, and `gh` are available for `sling speedup`. Exit `0` means healthy; exit `10` means a real check failed. A row marked `!` is an advisory — a newer CLI, a coding agent without the skill, or a missing speedup prerequisite — and still counts as healthy; `○` marks a check that could not run. The speedup row checks that `gh` is installed, not that it is signed in.
```console
$ sling doctor
✓ token valid session (expires 4 Aug 2026, 17:45)
✓ control_plane reachable (https://runners.starsling.dev)
✓ clock_skew 0s vs server
✓ git_remote origin → https://github.com/acme/api.git
✓ patch_tooling git found (/usr/bin/git)
✓ version up to date (0.1.129)
✓ auto_update on; last checked 2026-08-04 17:00 UTC: sling is up to date (0.1.129).
✓ org starslingdev (paid)
✓ agent_skill sling skill installed for Claude Code
✓ speedup Python 3.9+, PyYAML and gh available for sling speedup
Environment healthy!
```
## Next steps
# Authentication and setup (/sling-cli/commands/auth)
Five commands cover getting `sling` working and confirming it still is.
## `sling login`
```text
sling login [--force] [--clear]
```
Signs in with the **GitHub device-code flow**: requests a code, opens the approval page, waits for you to approve in the browser, saves the credential to `~/.config/sling/credentials`, then makes a best-effort attempt to set your default org. If you are already signed in it short-circuits — verifying the token still works rather than re-running the flow.
The device-code flow is deliberate: it needs no localhost callback, so you can sign in from any terminal, including over SSH.
| Flag | Meaning |
| ----------------------- | --------------------------------------------------------------------- |
| `--force` | Re-authenticate even when a valid session exists. |
| `--clear` | Clear the stored credential; an alias for `logout --yes`. |
| `--agent`, `--no-input` | Refuse: the device-code flow cannot run non-interactively (exit `2`). |
```console
$ sling login
Opened https://runners.starsling.dev/cli-login?user_code=AB58-LRFS in your browser.
Confirm code AB58-LRFS to continue.
Waiting for you to approve…
Sling CLI v0.1.0
✓ Successfully authenticated!
✓ Token saved to ~/.config/sling/credentials
✓ You're now linked to acme organization!
```
An agent on this machine inherits the credential this writes, so signing in once covers both of you. A fresh CI container has no session and no browser: see [how agents authenticate](https://docs.starsling.dev/sling-cli/configuration#how-agents-authenticate).
## `sling logout`
```text
sling logout [--yes]
```
Clears the stored credential **and the persisted default org**, so a stale org cannot leak into the next login under a different account. On a terminal it asks first.
| Flag | Meaning |
| ------------ | ------------------------------------------------------------------------------------ |
| `--yes` | Skip the confirmation — explicit consent to clear. |
| `--agent` | Machine-mode consent; bundles `--yes`. |
| `--no-input` | **Not** consent. Fails with exit `2` rather than prompting when a credential exists. |
```console
$ sling logout
Are you sure you want to sign out? (y/N) y
✓ Successfully signed out!
✓ Token cleared from ~/.config/sling/credentials
```
## `sling whoami`
```text
sling whoami [--json]
```
Your identity, org, plan, token scopes, and token expiry — so you can debug access issues without guessing. Session callers see the default org enriched with its plan; API-key callers also see the key id and its scopes.
| Flag | Meaning |
| ------------------- | ----------------------------------------------------------------------- |
| `--json`, `--agent` | Machine output — the `/api/whoami` payload on stdout, errors on stderr. |
```console
$ sling whoami
Identity
Name Lionel Messi
GitHub leo_messi
Email leomessi@example.com
User ID leo_messi_10
Organization
Default arg
Plan enterprise
Credential
Type session
Expires 1 Aug 2026, 00:00
```
The human table renders on stderr, so stdout stays pipe-clean. Calls [`GET /api/whoami`](https://docs.starsling.dev/api/identity/get-whoami).
## `sling doctor`
```text
sling doctor [--json]
```
Diagnoses a broken setup in one command: **binary version, token validity and scopes, org resolution, git remote detection, control-plane reachability, clock skew, patch-tooling presence, auto-update state**, whether the [sling agent skill](https://github.com/starslingdev/skills/tree/main/skills/sling) is installed for a coding agent, and the local prerequisites for `sling speedup`. Exit `0` when healthy, **`10`** when a real check fails — so an agent harness can preflight the environment before starting work.
Each row carries a mark: `✓` passed, `○` **skipped** — the check could not run, like the version comparison when the control plane is unreachable, or `agent_skill` when no coding agent is installed — and `!` **advisory**, a suggestion worth acting on. Only `✗` fails the run.
| Flag | Meaning |
| ------------------- | ---------------------------------------------------------------------------------------------- |
| `--json`, `--agent` | Machine output — `{ checks: [{ key, ok, detail, skipped?, warn?, fix_command? }] }` on stdout. |
```console
$ sling doctor --json
{
"checks": [
{ "key": "token", "ok": true, "detail": "valid session (expires 2026-08-04T17:45:00.000Z)" },
{ "key": "control_plane", "ok": true, "detail": "reachable (https://runners.starsling.dev)" },
{ "key": "clock_skew", "ok": true, "detail": "0s vs server" },
{ "key": "git_remote", "ok": true, "detail": "origin → https://github.com/acme/api.git" },
{ "key": "patch_tooling", "ok": true, "detail": "git found (/usr/bin/git)" },
{ "key": "version", "ok": true, "detail": "up to date (0.1.129)" },
{ "key": "auto_update", "ok": true, "detail": "on; not checked yet" },
{ "key": "org", "ok": true, "detail": "starslingdev (paid)" },
{ "key": "agent_skill", "ok": true, "detail": "sling skill installed for Claude Code" },
{ "key": "speedup", "ok": true, "detail": "Python 3.9+, PyYAML and gh available for sling speedup" }
]
}
```
A real failing check carries a `fix_command` and flips the exit code to `10`. A skipped check — `ok: false` with `skipped: true` — is informational and keeps the run healthy.
An **advisory** check is the third state: `ok: true` with `warn: true` and the exit code still `0`. An outdated binary suggests the installer one-liner; `agent_skill` suggests the skill install when a coding agent is present but the skill is not. With no coding agent on the machine, `agent_skill` is skipped rather than nagging.
The `speedup` check is always non-failing. It verifies Python 3.9 or newer, an importable PyYAML, and that `gh` is installed. It does not check GitHub authentication, Sling authentication, an agent executable, or network access, so a healthy row is not a guarantee that `sling speedup` can launch. When a prerequisite is missing the row remains `ok: true`, adds `warn: true`, and gives the specific remedy in `detail`; unlike the version and agent-skill advisories, it has no `fix_command`.
```json title="advisory and skipped rows"
{ "key": "version", "ok": true, "warn": true, "detail": "version 0.1.128\n0.1.129 is available, to update:", "fix_command": "curl -fsSL https://runners.starsling.dev/cli/install.sh | sh" }
{ "key": "agent_skill", "ok": true, "warn": true, "detail": "not installed — the sling skill lets your coding agent run sling for you, to install:", "fix_command": "npx skills add starslingdev/skills --skill sling" }
{ "key": "agent_skill", "ok": false, "skipped": true, "detail": "no supported coding agent detected — sling is usable directly" }
{ "key": "speedup", "ok": true, "warn": true, "detail": "" }
```
## `sling org switch`
```text
sling org switch [slug]
```
Sets your **default org** so later commands resolve it without a flag. Pass a slug to persist it directly, or omit it on a terminal for an arrow-key picker. An unknown slug exits `2` and lists your valid orgs.
| Flag | Meaning |
| ------------------- | ------------------------------------------------------------------------------- |
| `slug` | The org to make default. Omit for the interactive picker. |
| `--json`, `--agent` | Machine JSON — `{"defaultOrg":"…"}` on stdout. A missing slug is a usage error. |
| `--no-input` | Refuse the picker when no slug is given (exit `2`). |
```console
$ sling org switch beta
You're now linked to beta organization!
# no slug on a TTY → picker
$ sling org switch
Select your default org (↑/↓, Enter; Esc to cancel):
❯ acme
beta
```
Your org is auto-resolved when it is unambiguous, so this is only needed on multi-org accounts — the point is that they do not pay a flag tax on every call. Either way it is a CLI convenience: the HTTP API never infers an org, and [`org` is a required parameter](https://docs.starsling.dev/api/credentials#org-scoping) on every org-scoped endpoint. Use [`GET /api/orgs`](https://docs.starsling.dev/api/identity/list-orgs) to list the slugs you can use.
# Inspecting CI (/sling-cli/commands/inspect)
Four commands for navigating what actually ran. They share one primitive — polymorphic id resolution — so all of them accept a prefixed id, a bare number, or a pasted GitHub Actions URL.
## Identifiers
| Form | Meaning |
| ------------------ | -------------------------------------------------------------------------------- |
| `run_` | One workflow run. |
| `job_` | One job within a run. |
| `att_.` | One execution of a job. Retries create new attempts; earlier ones are preserved. |
| `runner_` | The GitHub Actions runner a job ran on. |
Bare GitHub ids and **GitHub Actions UI URLs are accepted anywhere** a run, job, or attempt id is — so you can paste a URL straight from the browser without translating identifiers.
Resolution is polymorphic: an id resolves downward to the most specific sensible target. Where several candidates match, the command lists them and exits `2` — it never picks silently, so you are never handed the wrong target.
## `sling resolve`
```text
sling resolve [--target run|job|attempt]
```
Resolves a polymorphic id to its concrete target. This is the primitive the id-taking commands share, exposed on its own so you can see what an id maps to.
| Flag | Meaning |
| ---------------------------- | ----------------------------------------------------------------------- |
| `--target run\|job\|attempt` | Bias resolution to one level when the id is ambiguous. |
| `--json`, `--agent` | Machine output — the resolved target, or `{ candidates }` on ambiguity. |
```console
$ sling resolve run_2990884649
run_2990884649 (run)
acme/api
# ambiguous → candidates (exit 2)
$ sling resolve 88886665361
Ambiguous — 2 candidates; pass one:
run_88886665361 (acme/api)
job_88886665361 typecheck (acme/api)
```
**Exit codes:** `0` resolved · `2` usage or ambiguous · `3` not found · `4` not signed in · `5` control-plane failure. Calls [`POST /api/resolve`](https://docs.starsling.dev/api/resolve/resolve-target).
## `sling runs`
Inspect workflow runs. `list` (alias `ls`) pages newest-first with server-side filters; `show` (alias `get`) renders one run and can block until it concludes.
### `sling runs list`
```text
sling runs list [filters] [--limit n] [--cursor c]
```
| Flag | Meaning |
| --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| `--branch`, `--status`, `--conclusion`, `--trigger`, `--workflow-path`, `--label` | Server-side filters; combine freely. |
| `--window`, `--month`, `--from` / `--to` | Time window. Mutually exclusive; passing two is a usage error. |
| `--limit`, `--cursor` | Page size, and the cursor to page with. `has_more` prints the next `--cursor`. |
| `--json`, `--agent` | Machine mode — `{ runs, has_more, next_cursor }` on stdout. |
```console
$ sling runs list --status in_progress --limit 3
RUN WORKFLOW BRANCH EVENT STATUS DUR JOBS CREATED
2990884649 Test main push in_progress — 4 2026-07-23 14:02
2990884101 Build main push queued — 1 2026-07-23 13:58
```
Calls [`GET /api/runs`](https://docs.starsling.dev/api/runs/list-runs).
### `sling runs show`
```text
sling runs show [--wait [--fail-fast] [--wait-timeout 30m]]
```
| Flag | Meaning |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `--wait` | Poll until the run reaches a terminal state, then exit `0` on success or **`10`** on any non-success conclusion. |
| `--fail-fast` | With `--wait`, return as soon as a job fails instead of waiting for the rest. |
| `--wait-timeout ` | Cap the wait, e.g. `30m`. |
| `--json`, `--agent` | Machine mode — the run detail on stdout. |
```console
$ sling runs show run_2990884649 --wait; echo $?
…run concludes…
10 # a non-success conclusion under --wait
```
`--wait` is what lets a script or agent gate on a run. Exit `10` is not an error — the command worked and the *run* failed. See [exit codes](https://docs.starsling.dev/sling-cli/configuration#exit-codes).
**Exit codes:** `0` ok · `2` usage · `3` not found · `4` not signed in · `5` control-plane failure · `10` run concluded non-success under `--wait`. Calls [`GET /api/runs/{id}`](https://docs.starsling.dev/api/runs/get-run).
## `sling jobs`
Inspect workflow jobs. `list` is scoped to **one run** (`--run`) or **one repo** (`--repo` plus a window) — exactly one is required. `show` renders one job; passing a *run* id is a usage error that redirects you to `runs show`.
### `sling jobs list`
```text
sling jobs list --run | --repo [--conclusion c]
[--afterburner engaged|not-engaged] [window]
```
| Flag | Meaning |
| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--run ` \| `--repo ` | The scope. Mutually exclusive; one is required. |
| `--conclusion` | Filter by conclusion — `failure`, `success`, and so on. |
| `--afterburner` | Filter by [Afterburner](https://docs.starsling.dev/sling-cli/commands/analyze#group-by-afterburner) engagement: `engaged` or `not-engaged`. A job that was not assessed matches neither. |
| `--window`, `--month`, `--from` / `--to` | Time window, with `--repo`. |
| `--limit`, `--cursor` | Pagination. |
| `--json`, `--agent` | Machine mode — `{ jobs, has_more, next_cursor }` on stdout. |
```console
$ sling jobs list --run 2990884649 --conclusion failure
JOB NAME STATUS LABEL ATTEMPTS DURATION RUN CREATED
88886665361 typecheck failure starsling-ubuntu-26.04 1 2.4m 2990884649 2026-07-23 14:02
$ sling jobs show run_2990884649
That id is a run, not a job — try `sling runs show`. # exit 2
```
A terminal job shows its **conclusion**; an in-flight one shows its **status**.
Each row also shows the job's Afterburner rate, the estimated share of its sampled time spent above its label's resources, and its coverage, how much of the job was sampled. A `*` after the coverage marks a partial capture. `unknown` means nothing was measured, and is not a negative. `--afterburner` is a **filter** on engagement, not a grouping: to compare jobs with and without Afterburner, use [`sling time --group-by afterburner`](https://docs.starsling.dev/sling-cli/commands/analyze#group-by-afterburner).
```console
$ sling jobs list --repo acme/api --window 7d --afterburner engaged --limit 3
JOB NAME STATUS LABEL ATTEMPTS AFTERBURNER COVERAGE DURATION RUN CREATED
96204551873 Lint success starsling-ubuntu-26.04-2 1 68.0% 100.0% 1m 27s 39120455871 2026-10-16 14:03
96204551861 Build success starsling-ubuntu-26.04-2 1 57.0% 100.0% 1m 17s 39120455871 2026-10-16 14:03
96204551847 Install success starsling-ubuntu-26.04-2 1 41.0% 98.0% 51s 39120455871 2026-10-16 14:02
Afterburner: estimated sampled-time rate above your tier. * partial capture; unknown is not a negative.
```
### `sling jobs show`
```text
sling jobs show
```
Renders one job and its attempts. Each attempt shows whether Afterburner **engaged** (`yes`, `no`, or `unknown`), its rate, and its coverage — `partial` when the capture has gaps.
Calls [`GET /api/jobs`](https://docs.starsling.dev/api/jobs/list-jobs) and [`GET /api/jobs/{id}`](https://docs.starsling.dev/api/jobs/get-job).
## `sling logs`
```text
sling logs [--job ] [--grep ] [--since ]
[--timestamps] [--limit ] [--cursor ] [--output-file ]
```
Reads a run, job, or attempt's logs **filtered server-side** — so you fetch the failing lines, not the whole transcript.
| Flag | Meaning |
| ---------------------- | ----------------------------------------------------------------------------- |
| `--job ` | For a run target, restrict to one job leg. |
| `--grep ` | Server-side regex filter, e.g. `--grep '##\[error\]'`. |
| `--since ` | Only lines newer than a trailing duration. |
| `--timestamps` | Prefix each line with its timestamp. |
| `--limit ` | Maximum lines per page. |
| `--cursor ` | Resume from a `next_cursor`. |
| `--output-file ` | Write to a file instead of stdout. |
| `--json`, `--agent` | Emit a JSON page — `{ lines, has_more, next_cursor }` — instead of raw lines. |
```console
$ sling logs job_88886665361 --grep '##\[error\]'
##[error]Process completed with exit code 101.
```
Unusually for `sling`, this command writes to **stdout in both modes**: the human path streams raw lines and auto-follows pages to the end. That makes `| head` and `| less` work naturally — closing the pipe early exits cleanly.
**Exit codes:** `0` ok · `2` usage · `3` not found · `4` not signed in · `5` control-plane failure. Calls [`GET /api/logs/{id}`](https://docs.starsling.dev/api/logs/get-logs).
# Analyzing CI (/sling-cli/commands/analyze)
Six commands that answer analytical questions rather than listing records. Each is a first-class product surface, not a dashboard export.
## `sling usage`
```text
sling usage [--org | --repo ] [--group-by ] [--order-by
]
[--asc | --desc] [window] [--json | --agent]
```
Attributes [StarSling Runner](https://starsling.dev/products/runners) minutes and dollar cost over a time window.
| Flag | Meaning |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--org`, `--repo` | Scope. `--repo owner/name` narrows to one repo; mutually exclusive. Defaults to your default org. |
| `--group-by` | `label` (default) · `workflow` · `job` · `repo` · `day`. Not `afterburner` — to compare Afterburner, use [`sling time --group-by afterburner`](#group-by-afterburner). |
| `--order-by` | `cost` (default) · `minutes` · `jobs` · `key` |
| `--asc` / `--desc` | Sort direction, default `--desc`. Naming both is a usage error. Not valid with `--group-by day`. |
| `--window d` | Trailing window, e.g. `30d`. Defaults to 30 days. |
| `--month ` | A calendar month. |
| `--from` / `--to` | An explicit half-open range `[from, to)`. Both required together. |
| `--json`, `--agent` | Machine mode. |
```console
$ sling usage --org acme --window 7d --group-by repo
StarSling usage — by repo
2026-07-07 → 2026-07-14
KEY RUNNER MIN JOBS COST $ % TOTAL
acme/api 25459.0 10784 $202.85 89.3%
acme/web 3040.2 1120 $24.22 10.7%
```
The window flags are **mutually exclusive** — passing two is a usage error, not a silent precedence rule. A single-row result omits `% TOTAL`, since a lone row's share is always 100%. `--group-by day` renders a burn-down chart instead of a table.
Cost is `minutes × vCPU × $0.002`, where minutes are **billed** minutes — `max(1, ceil(duration / 60s))` per job. A five-second job still costs a minute. Jobs on [Review Runners](https://docs.starsling.dev/runners/compute-sizing#review-specifications) (`starsling-review`) are the exception: they cost a flat $0.004 per billed minute.
### The `plan` block
Every response carries a top-level `plan` describing the caller's billing state, which shapes both the window and the human chrome on any `--group-by` axis:
| Field | Meaning |
| ------------------------------------------ | ------------------------------------------------------------------------------- |
| `status` | `paid` · `free` · `blocked`. Paid orgs get no bar or banner. |
| `period_source` | `stripe` · `install_cycle` · `calendar_month` · `explicit` — labels the window. |
| `free_minutes_limit` / `free_minutes_used` | Free orgs only — the remaining lifetime grant, drawn as a bar. |
| `blocked_reason` | Blocked orgs only — why jobs will not dispatch, shown as a red banner. |
Fields that do not apply are **omitted, not `null`**. Machine mode passes the whole block through verbatim.
**Exit codes:** `0` ok · `2` usage error · `4` not signed in · `5` control-plane failure. Calls [`GET /api/usage`](https://docs.starsling.dev/api/usage/get-usage).
## `sling top`
```text
sling top [--by ] [--metric
] [--asc | --desc] [--org | --repo]
[-n ] [window] [--json | --agent]
```
Ranks **what burns the most runner time and money** — the hotspots worth optimizing. Groups the same facts as `usage`, but sorts by a chosen metric and adds a period-over-period trend so a regression stands out.
| Flag | Meaning |
| ------------------- | ----------------------------------------------------------------------------------- |
| `--by` | `workflow` (default) · `job` · `label` · `repo` · `branch` |
| `--metric` | `runner-minutes` · `cost` · `jobs` · `p95-duration` · `p99-duration` · `queue-wait` |
| `--asc` / `--desc` | Sort direction, default `--desc`. |
| `--org`, `--repo` | Scope; mutually exclusive. |
| `-n`, `--limit` | Row count. |
| `--json`, `--agent` | Machine mode — ranked rows plus a `local` block. |
```console
$ sling top --by workflow --metric cost --window 30d
sling top — by workflow · cost · last 30d
KEY · WORKFLOW REPO COST TREND
Build acme/api $528.35 ↑55.2%
Test (multiple) $203.11 ↓12.3%
Lint acme/web $44.90 —
```
`(multiple)` marks a key spanning several repos. The trend compares against the prior equal-length window, or shows `—` when there is no prior data. Calls [`GET /api/top`](https://docs.starsling.dev/api/top/get-top).
## `sling time`
```text
sling time
sling time --repo [--workflow ] [--group-by afterburner|provider|tier] [window]
```
Decomposes CI **wall-clock into phases** — so you can see whether time goes to infrastructure or to your workload. Polymorphic, with a different analysis at each level:
* A **job or attempt** splits wall-clock into the phase enum, with a per-step breakdown inside `steps`.
* A **run** adds DAG analysis: the **critical path**, **parallelism efficiency** (busy-runner-seconds ÷ wall-clock × width), and the **blocking job** — the single job whose speedup most reduces run wall-clock, so optimization effort lands where it pays.
* **`--repo`** aggregates p50/p95/p99 per phase, per runner label, over a window — answering whether a repo's time goes to queue, provisioning, cache, or actual work. Add `--workflow` for that workflow's critical path, and `--group-by` to compare the runners jobs ran on.
| Flag | Meaning |
| ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `` | A run, job, or attempt id, or a pasted GitHub Actions URL. |
| `--repo ` | The repo aggregate instead of a single target. **Required** for the repo view — see below. |
| `--workflow ` | **Only with `--repo`.** Only that workflow's jobs, plus its dominant critical path, hop by hop. |
| `--group-by ` | **Only with `--repo`.** Split by the runner each job ran on: `afterburner`, `provider`, or `tier`. |
| `--window`, `--month`, `--from` / `--to` | **Only with `--repo`.** Defaults to the last 30 days. Passing one alongside an id is a usage error — a single target already names its window. |
| `--json`, `--agent` | Machine mode. |
`sling time` does **not** read the repo from your checkout's `git remote`. Without `--repo` or an id it prints its usage to stderr and exits `2`, even inside a clone of the repo. It also rejects `--org`: the org comes from the `--repo` owner, or from the resolved id.
```console copy="sling time"
$ sling time 93165914090
Job Name: Lint, typecheck, test & spell · Wall-Clock: 58s · Queue-Wait: 2s
PHASES TIME %-SHARE TIMELINE
provision 4.0s 7.14% ██░░░░░░░░░░░░░░░░░░░░░░
checkout+patch 2.0s 3.57% ░░█░░░░░░░░░░░░░░░░░░░░░
steps 46.0s 82.14% ░░░███████████████████░░
Set up Bun 1.0s ░░░█░░░░░░░░░░░░░░░░░░░░
Set up mise tools 2.0s ░░░█░░░░░░░░░░░░░░░░░░░░
Install dependencies 1.0s ░░░░█░░░░░░░░░░░░░░░░░░░
Lint (Biome) 2.0s ░░░░█░░░░░░░░░░░░░░░░░░░
Lint shell (shellcheck) 14.0s ░░░░░██████░░░░░░░░░░░░░
Lint Dockerfiles (hadolint) 0.0s ░░░░░░░░░░░█░░░░░░░░░░░░
▸ Typecheck 18.0s ░░░░░░░░░░░████████░░░░░
Test 7.0s ░░░░░░░░░░░░░░░░░░░███░░
Catalog drift 1.0s ░░░░░░░░░░░░░░░░░░░░░░█░
Spell (typos) 0.0s ░░░░░░░░░░░░░░░░░░░░░░█░
teardown 4.0s 7.14% ░░░░░░░░░░░░░░░░░░░░░░██
Top Steps
STEP TIME
Typecheck 18.0s
Lint shell (shellcheck) 14.0s
Test 7.0s
Set up mise tools 2.0s
Lint (Biome) 2.0s
```
The timeline column places each phase and step on the job's wall-clock, so you can see what ran when and what overlapped — not just what was slow. `▸` marks the single largest contributor. **Top Steps** then ranks the steps outright, which is the list to optimize from: here `Typecheck` and `Lint shell` are 32 of the 46 seconds inside `steps`.
Phases come from a frozen vocabulary shared by the runner hooks and the facts store: `queue_wait`, `provision`, `image_pull`, `cache_restore`, `checkout+patch`, `steps`, `cache_save`, `teardown`. Only the phases with time recorded against them are shown. Percentages are share of phase time, so they sum across the phase rows — the nested steps are a breakdown of `steps`, not extra rows in that sum.
### The repo view
```console
$ sling time --repo acme/api --window 30d
Repo: acme/api · Window: 2026-06-23 → 2026-07-23
PHASE RUNNER LABEL P50 P95 P99 JOBS
steps starsling-ubuntu-26.04 69.0s 326.0s 512.0s 318
```
With `--workflow`, `sling time` also infers the workflow's **critical path**: for each run, it walks back from the last job to finish, each hop to the latest job that ended by the time the next one was created. The most common path across the window is shown, with the share of runs that followed it. Each hop's time is the p50 of `started → completed` for successful jobs with that name, on that hop's runner label, in the window.
### Group by Afterburner
`--group-by afterburner` splits jobs by whether the runner had [Afterburner](https://docs.starsling.dev/runners/afterburner) available:
| Group | Meaning |
| --------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `on` | The job ran on a runner with Afterburner available. |
| `off` | The job ran on a runner without Afterburner. Every other group is compared against `off`. |
| `unknown` | Nothing was recorded where the job ran, for example because the job started before recording began. Never compared, and never counted as `off`. |
Each group also shows how many of its jobs **engaged**: went over their label's resources at any point. The split is by **capability**, not by engagement. Heavy jobs are the ones that engage, so splitting on engagement would make Afterburner look slower.
This is the only `sling` command that can group by Afterburner. `sling usage --group-by` takes `label`, `workflow`, `job`, `repo`, or `day`, and not `afterburner`.
```console
$ sling time --repo acme/api --workflow Build --window 7d --group-by afterburner
Repo: acme/api · Workflow: Build · Window: 2026-10-10 → 2026-10-17
Critical path Install → Lint → Build (97% of 421 runs)
JOB afterburner=on afterburner=off Δ n (on / off)
Install 51s 1m 19s −28s (−35%) ±3s 212 / 198
Lint 1m 28s 2m 58s −1m 30s (−51%) ±9s 212 / 198
Build 1m 18s 2m 6s −48s (−38%) ±5s 212 / 198
───────────────────────────────────────────────────────────────────────────────────────────────
Path (p50, sum of hops) 3m 37s 6m 22s −2m 46s (−43%) ±11s
Hops are started→completed of successful jobs on each hop's runner label. Below n=20 on either side, no delta is claimed.
Groups afterburner=on: 636 jobs, Afterburner engaged on 452 of 636 (71%) · afterburner=off: 594 jobs
Δ is each group minus afterburner=off.
Engaged: the job went over its billed size at any point.
Phases, p50 on off n (on / off)
checkout+patch 2s 5s 636 / 594
steps 1m 18s 2m 6s 636 / 594
Phases pool every job in each group, so they differ by job mix as well as by box. --workflow compares like with like.
```
The hop medians in this example are the install, lint, and build phases of StarSling's public [TypeScript build benchmark](https://github.com/starslingdev/github-actions-benchmarks) on `starsling-ubuntu-26.04-2`, with Afterburner [on](https://github.com/starslingdev/github-actions-benchmarks/actions/runs/38490164589) and [off](https://github.com/starslingdev/github-actions-benchmarks/actions/runs/38484877550).
How to read it:
* **`Δ`** is each group's p50 minus the `afterburner=off` p50. A negative `Δ` means `on` was faster.
* **`±`** is an approximate 95% error range on `Δ`. A `Δ` smaller than its error range is not a measurable difference.
* **`n`** is the number of jobs on each side. Below **n=20** on either side, the cell reads `insufficient sample` instead of a number.
* **The path row** is the sum of the per-hop p50s along the dominant critical path. The share in the header is how many runs followed that path.
* **The phase table has no `Δ` on purpose.** Each group pools whatever jobs ran in it, so a phase difference measures the job mix, not the runner. Use `--workflow` for a like-for-like comparison.
What is approximate prints as a `Note:` line. With `--group-by` and `--workflow`, one note says that critical-path p50s are **weighted by UTC day**, over the days when both groups ran the job. That way a window that spans a rollout compares the same days. The note says how many runs fell on other days.
`--group-by provider` and `--group-by tier` read where each job's runner was placed instead. They compare every group against the group with the most jobs. Placement is not yet recorded for every organization, and until it is, every job reads `unknown`.
#### Other commands that show Afterburner
| Command | How Afterburner shows up |
| --------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| [`sling jobs list --afterburner engaged\|not-engaged`](https://docs.starsling.dev/sling-cli/commands/inspect#sling-jobs-list) | **Filters** jobs by engagement, and shows each job's Afterburner rate and coverage. |
| [`sling jobs show `](https://docs.starsling.dev/sling-cli/commands/inspect#sling-jobs-show) | Each attempt's own engagement, rate, and coverage. |
| [`sling bill`](https://docs.starsling.dev/sling-cli/commands/billing#afterburner-columns) | The share of jobs that engaged, per runner label, for the billing period. |
### JSON output
`--json` and `--agent` emit the response body on stdout, plus a `local` block. Grouped, it adds:
| Field | Meaning |
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------- |
| `grouping.group_by` | `afterburner`, `provider`, or `tier`. |
| `grouping.baseline` | The group the others are compared against — always `off` for `afterburner`. |
| `grouping.groups[]` | `key`, `jobs`, and for Afterburner `captured` (jobs with Afterburner available and a known capture) and `engaged`. |
| `grouping.phases[]` | `phase`, `group`, `p50_ms`, `p95_ms`, `p99_ms`, `jobs`. |
| `critical_path.path` | The hop names, in order. `runs` and `path_runs` give the share of runs that followed it; `min_sample` is the n floor. |
| `critical_path.hops[]` | `job_name`, `label`, and `cells[]`. |
| `critical_path.hops[].cells[]` | `group`, `p50_ms`, `n`, and `delta`. |
| `critical_path.total[]` | The path row per group: `group`, `p50_ms`, `delta`. |
| `meta.truncated[]` | Notes on what is approximate — `key` and `reason`. |
A `delta` appears only on compared cells — never on the baseline or `unknown`. It is either `{ "kind": "estimate", "ms", "pct", "error_ms", "baseline_p50_ms" }` or `{ "kind": "insufficient_sample" }`.
### Recipes
**Afterburner's effect on one job.** There is no per-job flag, so filter the JSON. For example, the `Lint` job in a `Build` workflow:
```bash
sling time --repo acme/api --workflow Build --group-by afterburner --json \
| jq '.critical_path.hops[] | select(.job_name == "Lint")'
```
Match `job_name` exactly as the `JOB` column prints it. Only jobs on the dominant critical path appear in `hops`.
**Change the window** with `--window 14d`, `--month 2026-09`, or `--from 2026-09-01 --to 2026-10-01`. A longer window gives more jobs per side, and a smaller error range.
**Script it with `--json`.** Human output goes to stderr, so pipe `--json` rather than the table.
**Exit codes:** as elsewhere, plus `6` for partial — telemetry was incomplete, and the body is still emitted. The repo view currently always reports `6`, because its infrastructure phases are approximated from step timing; read `meta.truncated` for the details. Calls [`GET /api/time`](https://docs.starsling.dev/api/time/get-time).
## `sling why`
```text
sling why [--json | --agent]
```
A **server-authored diagnosis** — why a CI job failed, so an agent can fix the failure instead of re-deriving it from logs. It is read straight from the facts store: the last failing step, a bounded `##[error]` window, and run context. **No LLM sits in the request path**, so the same job always classifies the same way. A run id diagnoses that run's most-diagnosable job.
Every diagnosis carries a classification, evidence references, suggested actions with ready-to-run commands, and an agent-ready remediation `prompt`.
Classifications: `step_failure` · `hang` · `oom` · `timeout` · `cancelled` · `terminated` · `infra` · `network_egress` · `unknown`.
On a **cancelled** target, `why` identifies the canceller — a user, a concurrency group, or a merge-queue flush — so an external cancellation is not misdiagnosed as a code failure.
```console
$ sling why job_88886665361
JobID: 88886665361 · JobName: test (3)
Failure Reason: The step 8 "Test" step failed (exit code 101).
Evidence
Classification: step_failure
Phase: step 8 "Test"
Logs:
##[error]Process completed with exit code 101
Suggestions:
1. Verify the logs
sling logs 88886665361 --grep '##\[error\]'
```
Every diagnosis carries evidence, a suggested next step, and a ready-to-run `prompt` for a downstream agent. Calls [`GET /api/why`](https://docs.starsling.dev/api/why).
## `sling speedup`
```text
sling speedup [--repo ] [--org ] [--agent-cli claude|codex]
```
Runs the pinned [ci-speedup audit](https://docs.starsling.dev/skills/ci-speedup) locally. Sling asks StarSling which skill commit to use, downloads that archive directly from GitHub, verifies its SHA-256 digest, and starts Claude Code or Codex with the audit instructions. Repository contents and CI logs stay on your machine and with your coding-agent provider; StarSling receives the authenticated pin request (and the CLI's usual background update check), not the audit data.
| Flag | Behavior |
| --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--repo ` | Target repository. Defaults to the checkout's `origin` remote, which must point to github.com. The owner and repository name are validated against GitHub's character rules. |
| `--org ` | Optional, but it must equal the repository owner, case-insensitively. It does not select a different organization. |
| `--agent-cli claude\|codex` | Agent to launch. Defaults to `claude` when installed, then `codex`. For an interactive launch, naming an unavailable agent, or having neither installed, exits `2`. |
| `--json`, `--agent`, `--no-input` | Print a launch plan instead of starting an agent. |
| `--help`, `-h` | Print the command help. |
The command rejects positional arguments, unknown flags, and the otherwise global `--yes`, `--compact`, and `--no-color` flags with exit `2`.
### Prerequisites and repository access
You need a signed-in Sling CLI, Python 3.9 or newer with PyYAML, and the GitHub CLI installed and signed in to github.com. The repository must belong to a GitHub organization with the StarSling GitHub App installed, and you must be a member of it. For an interactive launch, `claude` or `codex` must also be on `PATH`.
When `--repo` is omitted, Sling reads the current checkout's `origin` remote. When `--org` is supplied, it must match the repository owner; the skill pin is always requested for that owner.
### Launch-plan mode
Sling prints a launch plan and never starts a nested agent when:
* `--json`, `--agent`, or `--no-input` is passed;
* stdin or stdout is not a terminal, including piped output; or
* `CLAUDECODE`, `CODEX_THREAD_ID`, or `CODEX_SESSION_ID` is set.
The pretty-printed JSON object contains:
| Field | Meaning |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `commit` | The pinned `starslingdev/skills` commit. |
| `skill_dir` | The fresh directory containing the verified ci-speedup files. |
| `repo` | The resolved `owner/name`. |
| `prompt` | The initial agent prompt, including the complete skill instructions, their file location, the target repository and pinned commit, and the non-interactive defaults to save the report without applying fixes. |
| `env` | Reserved environment overrides; currently `{}`. |
| `argv` | `[agent, prompt]`, included only when an agent was named or found on `PATH`. |
The plan contains no credentials. Plan mode needs no installed agent and does not check a named agent's executable, but Python, PyYAML, and an authenticated `gh` are still required. It leaves `skill_dir` for the caller; later runs remove launch directories older than 24 hours. Failures always write plain text to stderr and nothing to stdout, even under `--json` or `--agent`.
### Cache and integrity
Archives are cached at `${XDG_CACHE_HOME:-$HOME/.cache}/sling/skills/ci-speedup//skill.tar.gz` and rechecked against the server-provided SHA-256 on every use. A cached archive that fails verification is not downloaded again: remove the named file before retrying. Old archives are not pruned.
Every run unpacks into a fresh `/launch-*` directory. Interactive launches remove that directory when the agent exits; stale launch directories older than a day are removed by later runs.
StarSling validates its pin's URL against its commit when the control plane starts, and Sling re-validates every pin it receives: the URL must target `codeload.github.com/starslingdev/skills` at the named commit. Sling refuses redirects. Extraction permits regular files under the skill directory only, rejects unsafe paths and more than 256 MiB of content, and requires `SKILL.md`.
The pin itself is never cached. A StarSling outage, a 15-second pin timeout, or a server `5xx` stops the run with exit `5`; Sling never falls back to an older pin. Archive downloads have a 60-second timeout.
### Exit codes
| Code | When |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `2` | Invalid arguments, no valid GitHub repository, or `--org` not matching the owner. |
| `2` | A missing local prerequisite; `gh` not signed in to github.com, or `gh auth status` failing or not answering within 15 seconds; or no Claude Code or Codex for an interactive launch. |
| `2` | The inferred repository owner is not a StarSling organization you belong to. |
| `3` | StarSling does not know the requested skill. Not expected: the CLI always requests `ci-speedup`. |
| `4` | Sling is not signed in or the credential is rejected. When `--org` was supplied, a membership refusal also exits `4`; its current message suggests `sling login`, even though signing in again will not fix missing organization membership. |
| `5` | Pin lookup, download, checksum, extraction, cache filesystem, or pin-validation failure. |
| `7` | The control plane rate-limited the request. |
| agent's code | After an interactive launch, the command returns the coding agent's exit status, which can overlap Sling's own codes. |
Calls [`GET /api/skill/{name}`](https://docs.starsling.dev/api/skills/get-skill-pin) to resolve the pin. A `422` validation error maps to exit `2`.
## `sling labels list`
```text
sling labels list [--json | --agent]
```
The catalog of available runner labels and their specs, so `runs-on` mapping and cost hints reference concrete options instead of hardcoded names. The catalog is **static and global** — identical for every caller — so the usual `--org`, `--repo`, and window flags are accepted but inert. `list` is the only subcommand.
```console
$ sling labels list
StarSling runner labels
LABEL CPU MEM (GiB) ARCH $/MIN
starsling-ubuntu-26.04 4 16 x64 $0.008
starsling-ubuntu-26.04-2 2 8 x64 $0.004
starsling-ubuntu-26.04-8 8 32 x64 $0.016
starsling-ubuntu-26.04-16 16 64 x64 $0.032
starsling-ubuntu-26.04-32 32 128 x64 $0.064
starsling-ubuntu-26.04-64 64 256 x64 $0.128
```
| Field | Meaning |
| ------------------- | -------------------------------------------------------------------------- |
| `label` | The `runs-on` runner label. |
| `cpu` | vCPU count. |
| `memory_gb` | RAM in GiB — a strict 4 GiB per vCPU. |
| `arch` | CPU architecture; `x64` today. |
| `price_per_min_usd` | Per-minute cost, `cpu × $0.002` — the same rate `usage` and `bill` charge. |
See [Instance types](https://docs.starsling.dev/runners/instance-types) for the same catalog in context. Calls [`GET /api/labels`](https://docs.starsling.dev/api/labels/get-labels).
# Billing (/sling-cli/commands/billing)
Two read-only commands. Plan and payment changes stay in the dashboard; `sling` never mutates billing state.
## `sling bill`
```text
sling bill [--org ] [--month ] [--json | --agent]
```
A budget snapshot for the current open billing period: runner minutes, cost, credits, amount due, per-runner-label line items, and a run-rate month-end projection.
| Flag | Meaning |
| ------------------- | --------------------------------------------------------------------------------------- |
| `--org` | Scope. Defaults to your default org. |
| `--month ` | A **past** month, resolving to its finalized invoice. Omit for the current open period. |
| `--json`, `--agent` | Machine mode — the `/api/bill` envelope on stdout, wrapped with a `local` block. |
```console
$ sling bill --org partcleda
Billing period: 2026-10-02 → 2026-11-02
Invoice: pending (issued when the period closes)
Runner minutes 45390.0
Amount $396.91
Projected month-end $848.43
RUNNER LABEL TIME COST AFTERBURNER ENGAGED/KNOWN COVERAGE
starsling-ubuntu-26.04 41166.0 min $329.33 64.0% 9412/14706 14706/14862
starsling-ubuntu-26.04-8 4224.0 min $67.58 71.0% 956/1347 1347/1352
Afterburner: share of assessed jobs that engaged (went over their billed size at any point). COVERAGE shows assessed / total jobs.
```
Other window flags — `--window`, `--from`, `--to` — are **rejected** here. A bill covers a fixed billing period, so an arbitrary range is meaningless. Use [`sling usage`](https://docs.starsling.dev/sling-cli/commands/analyze#sling-usage) for arbitrary ranges.
### A closed month
Passing `--month` for a closed period resolves to its finalized invoice: a real invoice id, a status, and `Credit` / `Amount due` in place of the run-rate projection.
```console
$ sling bill --month 2026-06 --org partcleda
StarSling bill — invoice
Billing period · 2026-06-02 → 2026-07-02
Invoice: in_1ToapkFSjWlUgKNBIKavWGIJ
Runner minutes 120978.0
Amount $1055.56
Credit −$527.78
Amount due $0.00
Status paid
```
### Response fields
| Field | Meaning |
| ----------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `invoice_id` | Omitted for the open period; a Stripe invoice id for a finalized month. |
| `status` | `open` for the current period; the Stripe status (`paid`, `open`, …) for a finalized month. |
| `amount_usd` | Gross billed — the Stripe subtotal for an invoice, in-house run-rate cost for the open period. |
| `credits_usd` | All reductions off the gross: a partner discount and/or the free grant. |
| `amount_due_usd` | Still outstanding. `$0` once an invoice is paid. |
| `free_credit_total_usd` / `free_credit_remaining_usd` | Free orgs only — the one-time lifetime grant. Omitted otherwise. |
| `line_items` | Per-runner-label minutes and cost. |
| `projected_month_end_usd` | Run-rate projection for the open period; the finalized net billed for an invoice. |
A field the org does not have — a paid org's grant fields — is omitted rather than erroring. Calls [`GET /api/bill`](https://docs.starsling.dev/api/bill/get-bill).
### Afterburner columns
Each runner label also shows [Afterburner](https://docs.starsling.dev/sling-cli/commands/analyze#group-by-afterburner) statistics for the period: the share of jobs that engaged, how many engaged out of the jobs assessed, and how many jobs were assessed out of all jobs.
| Field | Meaning |
| -------------------------- | ---------------------------------------------------------------------------------------- |
| `afterburner_rate` | The share of assessed jobs that engaged: went over their label's resources at any point. |
| `afterburner_engaged_jobs` | Jobs that engaged. |
| `afterburner_known_jobs` | Jobs whose engagement is known, the denominator of the rate. |
| `afterburner_total_jobs` | All jobs, so known out of total is the coverage. |
A job with nothing recorded is `unknown`, never counted as not engaged. These statistics never change minutes, prices, or amounts. If they cannot be read, the bill still renders, with an `AFTERBURNER_UNAVAILABLE` warning.
## `sling bill history`
```text
sling bill history [--org ] [-n ] [--after ] [--json | --agent]
```
Prior **finalized** invoices, newest first. Each carries Stripe's authoritative id, status, and amount, joined with per-label usage.
| Flag | Meaning |
| ---------------------- | --------------------------------------------------------------------- |
| `-n`, `--limit` | How many invoices — 1 to 100, default 6. |
| `--after ` | Cursor. Pages to invoices older than the given id; follow `has_more`. |
| `--json`, `--agent` | Machine mode — `{ invoices, has_more }` on stdout. |
```console
$ sling bill history --org partcleda
StarSling bill — prior invoices (newest first)
INVOICE PERIOD STATUS RUNNER MIN AMOUNT CREDIT DUE
in_1ToapkFSjWlUgKNBIKavWGIJ 2026-06-02 → 2026-07-02 paid 120978.0 $1055.56 −$527.78 $0.00
RUNNER LABEL MINUTES COST
starsling-ubuntu-26.04 112049.0 $896.39
starsling-ubuntu-26.04-8 8775.0 $140.40
AMOUNT is Stripe's gross (before −CREDIT); DUE is what's still outstanding ($0 once paid).
```
Note that `--after` takes an **invoice id**, not the opaque cursor the listing endpoints use. Calls [`GET /api/bill/history`](https://docs.starsling.dev/api/bill/get-bill-history).
## Exit codes
Both commands: `0` ok · `2` usage error · `4` not signed in · `5` control-plane failure. The human view is chrome and goes to stderr, so `sling bill --json | jq` is safe to pipe unconditionally. See [Pricing](https://docs.starsling.dev/pricing) for how the rates are set.
# Configuration (/sling-cli/configuration)
## Environment variables
`sling` is configured entirely through the environment — there are no config files beyond the credential it writes at `~/.config/sling/credentials`.
| Variable | Meaning |
| ------------ | ----------------------- |
| `SLING_HOST` | Control-plane base URL. |
### `SLING_HOST`
Env-only by design — there is no `--host` flag. It must be `https://` (or `http://` on a loopback development host) so the token never travels in cleartext.
## How agents authenticate
**On your own machine, an agent needs nothing extra.** [`sling login`](https://docs.starsling.dev/sling-cli/commands/auth#sling-login) writes the session to `~/.config/sling/credentials` for your user, so any agent running as you picks it up. Sign in once and the agent is authenticated.
See [API credentials](https://docs.starsling.dev/api/credentials) for the credentials the control plane accepts and the scopes each endpoint needs.
## Context resolution
`sling` resolves the org and repo it is acting on so that in-repo invocations need zero addressing:
* **Org** is auto-resolved when unambiguous, overridable with `--org `, and persisted as a default by [`sling org switch`](https://docs.starsling.dev/sling-cli/commands/auth#sling-org-switch). Multi-org accounts do not pay a flag tax on every call.
* **Repo** is detected from the git remote of the current directory, overridable with `--repo `.
This is a CLI convenience. The HTTP API never infers either — [`org` is a required parameter](https://docs.starsling.dev/api/credentials#org-scoping) on every org-scoped endpoint.
## Global flags
Available on the root command and every subcommand, except where a command's reference says otherwise.
| Flag | Meaning |
| --------------------- | -------------------------------------------------------------------------------------- |
| `--org ` | Org context. Auto-resolved when unambiguous; persisted default via `sling org switch`. |
| `--repo ` | Repo context. Defaults to the git remote detected in the current directory. |
| `--version`, `-v` | Print the version and exit. |
| `--help`, `-h` | Show help. An unknown command still fails, so a typo does not read as help. |
Machine mode is one switch with individually available parts:
| Flag | Meaning |
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--agent` | Machine mode. Exactly equivalent to `--json --compact --no-input --no-color --yes` (except on `sling speedup`, below). This is the flag machine callers should pass. |
| `--json` | JSON output on stdout. |
| `--yes` | Assume "yes" for confirmations. |
`sling --help` currently lists only `--json`, `--help`, and `--version` in its flags section — `--agent`, `--compact`, `--no-input`, `--no-color`, and `--yes` all work (confirmed by running each against `sling whoami`) but are not shown. This page is the only place `--agent` is documented today; the CLI owner should add these to `sling --help`.
## Output streams
**stdout carries data only.** Human chrome — summary rows, spinners, prompts — goes to **stderr**. This happens unconditionally: the CLI does not check whether stderr is a TTY, so the same spinner and cursor-control sequences land on stderr even when it is redirected to a file or piped into another process. Don't rely on TTY detection to decide whether chrome is present — pipe stderr to `/dev/null` if you need to suppress it silently. That still leaves the more important case: on a prompt-bearing command like [`sling logout`](https://docs.starsling.dev/sling-cli/commands/auth#sling-logout), `--json` by itself only changes what stdout serializes as — it does **not** imply `--yes`/`--no-input`, so a script passing `--json` alone still blocks on the confirmation prompt. `--agent` is the flag that guarantees non-interactive behavior, since it bundles `--yes` and `--no-input`; reach for `--agent`, not bare `--json`, in anything unattended. A failed command usually writes nothing to stdout: a bad id makes `sling runs show --agent` exit `3` with zero bytes on stdout. `sling logs` is the exception — asked for a real job that stores no logs it exits `3` *and* emits its envelope (`{ "lines": [], "has_more": false, "local": { ... } }`). Branch on `$?`, not on whether stdout is empty.
That is what makes `sling usage --json | jq` safe to pipe unconditionally: on failure `jq` receives empty input rather than half a table.
**JSON casing is set per endpoint, not by whether the field crossed the network.** Nearly every control-plane response `sling` passes through — `top`, `labels`, `usage`, `bill`, `runs`, `jobs`, `resolve`, `why`, `time` — is `snake_case` and frozen, matching its API schema. [`GET /api/whoami`](https://docs.starsling.dev/api/identity/get-whoami) is the confirmed exception: it is a real control-plane call like any other (a bad `SLING_HOST` makes `sling whoami --agent` fail with exit `5`, the same as any other command that reaches the API), but its schema is `camelCase` end-to-end (`userId`, `githubLogin`, `expiresAt`). The `local` envelope described below is composed by the CLI rather than passed through, but every key observed inside it so far is a single lowercase word (`org`, `kind`, `slug`, `plan`), so its casing convention for a multi-word key is not yet established by any shipped response. Don't infer a command's casing from "was this local" — check that command's reference page, or default to expecting `snake_case` and treat `whoami` as the documented exception.
The control-plane response, when there is one, is passed through **verbatim at the top level** of the JSON, with a sibling `local` key recording what the CLI resolved (org, repo, etc.) — not nested inside a wrapper. `local` is not on every response: `sling top`, `sling usage`, `sling runs list` and `sling whoami` all carry it, while `sling labels list` returns `{ "labels": [ ... ] }` with no `local` key at all, so treat it as optional when parsing. For example (values redacted):
```json title="sling top --agent"
{
"by": "workflow",
"metric": "runner-minutes",
"window": { "from": "2026-07-25T22:47:14.510Z", "to": "2026-08-24T22:47:14.510Z" },
"rows": [
{ "key": "ci", "repo": "example-repo", "runner_minutes": 69559, "cost_usd": 556.47, "p50_ms": 69000, "p95_ms": 180000, "p99_ms": 358540, "queue_wait_ms": 14000, "trend_pct": 170.7 }
],
"local": { "org": "example-org" }
}
```
```json title="sling whoami --agent"
{
"identity": { "userId": "example-user-id", "name": "Example User", "email": "user@example.com", "githubLogin": "example-login" },
"credential": { "type": "session", "expiresAt": "2026-08-31T20:38:25.617Z" },
"local": { "org": { "kind": "set", "slug": "example-org", "plan": "paid" } }
}
```
Note the casing split across these two commands: `runner_minutes`, `cost_usd`, and `p50_ms` (the `sling top` control-plane fields) are `snake_case`, while `userId`, `githubLogin`, and `expiresAt` (the `sling whoami` control-plane fields) are `camelCase` — `whoami` calls the control plane the same as `top` does, its response schema is just `camelCase`. In both examples, the `local` block is `camelCase`-shaped regardless of the surrounding response's casing.
[`sling logs`](https://docs.starsling.dev/sling-cli/commands/inspect#sling-logs) differs by mode, and the difference runs the opposite way to the rest of this page. In **human** mode it streams raw log lines to stdout, so `| head` and `| less` behave as you would expect, exiting cleanly when the pipe closes early. Under `--agent` or `--json` it returns a structured envelope like every other command — `{ "lines": [ ... ], "has_more": ..., "local": { ... } }`, one object per line — so a machine caller can hand `logs` to the same JSON parser it uses everywhere else rather than special-casing it.
## Exit codes
Every command exits from one table, so a script or agent can branch on `$?` without parsing output.
| Code | Meaning |
| ---- | --------------------------------------------------------------------------------------------------- |
| `0` | Success. |
| `1` | Unexpected CLI or internal error — reserved for a crash, never a mapped API outcome. |
| `2` | Usage — bad flags, a prompt refused under `--no-input` or `--agent`, or org ambiguity. |
| `3` | Not found — a resolved id has no such run, job, or attempt in this org, or it stores no logs. |
| `4` | Auth — missing, expired, or under-scoped credential. The message includes `sling login`. |
| `5` | Control-plane or API error — a `5xx`, or a transport failure. |
| `6` | Partial — telemetry incomplete; the result is still emitted. Used by `sling time` and `sling why`. |
| `7` | Rate limited — the control plane returned HTTP `429`. |
| `10` | Remote outcome failed — `sling doctor` unhealthy, or `sling runs show --wait` on a non-success run. |
Codes `3`, `4`, `5`, and `7` are mapped by a shared error handler, so any command can surface them. See [API errors](https://docs.starsling.dev/api/errors) for the HTTP responses behind each.
For [`sling speedup`](https://docs.starsling.dev/sling-cli/commands/analyze#sling-speedup), exit `2` also covers a missing local prerequisite (including `gh` not signed in), a repository owner that is not one of your StarSling organizations when `--org` is omitted, or an `--org` value that does not match the repository owner; with `--org`, the same membership refusal exits `4`. The command rejects `--yes`, `--compact`, and `--no-color` with exit `2`: pass `--agent`, `--json`, or `--no-input` to get its launch plan, which is always pretty-printed. Exit `5` also covers a skill download, checksum, cache, or extraction failure. After an interactive launch, the command returns the coding agent's own exit status instead, which can overlap Sling's codes.
The binary's own `sling exit-codes` help text (as of v0.1.2) documents only codes `0`–`5` — it omits `6`, `7`, and `10`, which are the codes this page documents for `sling time`/`sling why` (partial), rate limiting, and `sling doctor`/`sling runs show --wait` (remote outcome failed). This repo's git history for this page has no earlier version to check when `6`, `7`, and `10` were introduced, so it's unclear whether they're newer than the installed binary's help text or the help text is simply stale. This table is kept as-is (all nine codes) rather than trimmed to match the binary — a healthy local environment couldn't be made to exercise `10` to confirm it directly, but the table's own example below documents it as the unhealthy-`sling doctor` code, and neither this page nor `sling exit-codes` should be trusted blind until the CLI owner reconciles the two.
Exit `10` is not an error. It means the command succeeded and the *answer* was a failure — which is exactly what lets `sling runs show --wait` gate a pipeline on a run's conclusion.
Read a command's exit code with `$?` immediately after it, since the next command overwrites it:
```console
$ sling doctor; echo $?
10 # 0 = healthy, 10 = unhealthy
```
# Overview (/api)
The StarSling control plane exposes an HTTP API for everything the platform knows about your CI: which runs and jobs executed, why one failed, where the wall-clock went, and what it all cost.
Prefer a terminal to an HTTP client? The `sling` CLI wraps these same endpoints, adding argument validation, readable tables, and a stable exit-code contract.
## Base URL
All endpoints are served from a single origin:
Every path in this reference is relative to it, and every path is prefixed with `/api`.
## Conventions
Two things hold across every endpoint:
* **Org scoping.** Results are scoped to the orgs you belong to. Org-scoped endpoints take `org` as a **required** parameter (and often an optional `repo`). Naming an org you do not belong to returns `403`; a run, job, or attempt id that belongs to an org you cannot see returns `404`, not `403`, so the API never confirms that an id exists elsewhere.
* **Money and time.** Costs are US dollars in `*_usd` fields. Durations are seconds unless the field name says otherwise, and runner minutes are *billed* minutes, `max(1, ceil(duration / 60s))` per job, so a five-second job still costs a minute.
## Endpoint groups
## Pinned skills
[`GET /api/skill/{name}`](https://docs.starsling.dev/api/skills/get-skill-pin) returns the pinned `starslingdev/skills` commit, its GitHub codeload URL, and its SHA-256 digest. It requires bearer authentication plus the required `org` query parameter. The caller must belong to that GitHub organization, and the organization must be known to StarSling.
Today the only registered name is `ci-speedup`. Membership is checked before the skill lookup, so a non-member receives `403`; an unknown skill returns `404` only after the caller passes the organization check. The pin itself is global rather than organization-specific.
## Before you start
Two pages cover the behaviour shared by every endpoint. Reading them first saves working it out one `400` at a time:
# Credentials (/api/credentials)
Every endpoint except [`GET /api/info`](https://docs.starsling.dev/api/info/get-control-plane-info) requires a credential. The control plane accepts a bearer token, and rejects anything else with [`401 UNAUTHENTICATED`](https://docs.starsling.dev/api/errors).
## Bearer token
What [`sling login`](https://docs.starsling.dev/sling-cli/commands/auth#sling-login) stores at `~/.config/sling/credentials`, sent in the `Authorization` header:
Anyone holding your token can read everything it has access to. Keep it in a secret store or CI secret. Never commit it, and never put it in a URL, where it leaks into logs and browser history.
## Confirming your credential
[`GET /api/whoami`](https://docs.starsling.dev/api/identity/get-whoami) reports the caller's identity, org, plan, scopes, and token expiry. It is the fastest way to tell an expired token from a scope problem:
## Scopes
Three endpoint groups require a named scope. A credential that lacks it is rejected with [`403 INSUFFICIENT_SCOPE`](https://docs.starsling.dev/api/errors), not `401`: the token was valid, it just could not reach that resource.
| Scope | Required by |
| ------------ | -------------------------------------------------------------------------------------------- |
| `orgs:read` | [`GET /api/orgs`](https://docs.starsling.dev/api/identity/list-orgs) |
| `usage:read` | [`GET /api/usage`](https://docs.starsling.dev/api/usage/get-usage), [`GET /api/top`](https://docs.starsling.dev/api/top/get-top) |
| `bill:read` | [`GET /api/bill`](https://docs.starsling.dev/api/bill/get-bill), [`GET /api/bill/history`](https://docs.starsling.dev/api/bill/get-bill-history) |
Endpoints not listed here need a valid credential but no particular scope. Grant the narrowest set that does the job: a credential that only powers a cost dashboard needs `usage:read` and nothing more.
## Org scoping
Authentication establishes *who* you are; org membership establishes *what* you can see. Results are always scoped to the orgs the caller belongs to.
Every org-scoped endpoint takes `org` as a **required** query parameter. The API never infers it, even when you belong to exactly one org. (The CLI is what makes it feel optional: it fills in the default org you set with `sling org switch`.) Call [`GET /api/orgs`](https://docs.starsling.dev/api/identity/list-orgs) to list the slugs you can use.
A run, job, or attempt belonging to an org you cannot reach returns [`404 NOT_FOUND`](https://docs.starsling.dev/api/errors) rather than `403`. This is deliberate: a `403` would confirm the id exists somewhere, which is itself a disclosure. Do not read a `404` as proof that an id is invalid.
# Errors (/api/errors)
Every failure returns a JSON body with the same shape, so a client can branch on one field rather than parsing prose.
## Error body
```json
{
"code": "INSUFFICIENT_SCOPE",
"message": "This credential is missing the bill:read scope."
}
```
| Field | Type | Notes |
| --------- | ------ | --------------------------------------------------------------------------------------------------------------- |
| `code` | string | A stable machine-readable identifier. Branch on this, never on `message`. |
| `message` | string | Human-readable explanation. Wording may change at any time. |
| `details` | array | Present on validation failures only. Each entry is `{ "path": …, "error": … }`, naming the offending parameter. |
`code` is drawn from a closed set:
| `code` | Meaning |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `VALIDATION` | A parameter was present but unacceptable — an unknown enum value, an out-of-range `limit`, two mutually exclusive window parameters. |
| `MALFORMED_REQUEST` | The request could not be parsed — bad JSON in a `POST` body, or a query string the server cannot read. |
| `UNAUTHENTICATED` | No credential, or one that is expired or invalid. |
| `INSUFFICIENT_SCOPE` | The credential is valid but lacks a required [scope](https://docs.starsling.dev/api/credentials#scopes). |
| `NOT_FOUND` | No such resource *within the orgs you can reach*. |
## Status codes
| Status | Typical `code` | What to do |
| ------ | -------------------- | ------------------------------------------------------------------------------------------------- |
| `400` | `MALFORMED_REQUEST` | Fix the request itself. Retrying unchanged will not help. |
| `401` | `UNAUTHENTICATED` | Supply a credential, or refresh an expired session. See [Authentication](https://docs.starsling.dev/api/credentials). |
| `403` | `INSUFFICIENT_SCOPE` | Reissue the credential with the scope the endpoint names. |
| `404` | `NOT_FOUND` | Check the id — but note it may exist in an org you cannot reach. |
| `422` | `VALIDATION` | Read `details` for the offending parameter and correct it. |
| `500` | — | A control-plane fault. Safe to retry with backoff; every endpoint in this reference is read-only. |
A `404` is deliberately indistinguishable from "exists, but not yours". The API will not confirm that an id exists in an org you cannot see, so treat `404` as "not visible to this credential" rather than "does not exist".
## Retrying
Every endpoint documented here is a read, so retries are safe and cannot double-charge or mutate state. Retry `500` and `429` with exponential backoff; do not retry `400`, `401`, `403`, `404`, or `422` without changing the request, since the outcome is deterministic.
If you are rate limited the control plane returns `429`. Back off before retrying.
## Exit codes in the CLI
The `sling` CLI maps these responses onto a fixed exit-code table, so a script or agent can branch on `$?` without parsing output:
| Exit | Meaning | From |
| ---- | ----------------------------------------------------------- | --------------------- |
| `0` | Success | `2xx` |
| `1` | Unexpected CLI crash | never an API outcome |
| `2` | Usage error — bad flags, conflicting parameters | client-side, or `422` |
| `3` | Not found | `404` |
| `4` | Auth — missing, expired, or under-scoped credential | `401`, `403` |
| `5` | Control-plane or transport failure | `5xx` |
| `6` | Partial — telemetry incomplete, result still returned | `200` with gaps |
| `7` | Rate limited | `429` |
| `10` | Remote outcome failed — e.g. a run concluded unsuccessfully | `200` |
Note that `10` is not an error: the request succeeded and the *result* was a failure. It is what lets `sling runs show --wait` gate a pipeline on a run's conclusion.
# List workflow runs (/api/runs/list-runs)
`GET /api/runs`
Filtered workflow-run listing (sling runs list): branch / status / conclusion / trigger / workflow_path / runner-label / time-window filters over the CI facts store, keyset-paginated via an opaque cursor. Authenticated; scoped to the caller's orgs by membership.
Base URL: `https://runners.starsling.dev`
## Authentication
Requires a bearer token (`Authorization: Bearer`).
## Parameters
| Name | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `org` | query | string | yes | GitHub organization login. Required — a run listing is always org-scoped. e.g. `acme` |
| `repo` | query | string | no | Bare repository name, without the org prefix. Narrows to one repo. e.g. `api` |
| `branch` | query | string | no | Only runs on this branch. e.g. `main` |
| `status` | query | array | no | Lifecycle state. Repeatable: ?status=queued&status=completed. |
| `conclusion` | query | array | no | Terminal outcome. Repeatable, and absent until a run completes. |
| `trigger` | query | string | no | The GitHub event that started the run. e.g. `push` |
| `workflow_path` | query | string | no | Workflow file path, as committed in the repository. e.g. `.github/workflows/ci.yml` |
| `label` | query | string | no | Runner label a job in the run requested. e.g. `self-hosted` |
| `window` | query | string | no | Relative lookback, e.g. 30d. Mutually exclusive with from/to and month. e.g. `30d` |
| `from` | query | string | no | Start of the range, inclusive. Required with `to`. e.g. `2026-06-01` |
| `to` | query | string | no | End of the range, exclusive. Required with `from`. e.g. `2026-07-01` |
| `month` | query | string | no | A whole calendar month, YYYY-MM. e.g. `2026-06` |
| `limit` | query | string \| integer | no | Rows per page. Page with `cursor`. 1–100; e.g. `30` |
| `cursor` | query | string | no | Opaque keyset cursor from a prior page's `next_cursor`. |
## Responses
| Status | Description |
| --- | --- |
| `200` | One page of workflow runs, newest first. Page with `next_cursor`. An empty `runs` array carrying `warnings` does NOT mean the organization has no runs — it means StarSling isn't receiving them (see the warning's `message` and `remediation_url`). The absence of `warnings` proves nothing either way: the page may be an ordinary no-match or past the end, but the check itself can also be skipped or fail (StarSling holds no installation for the organization, or GitHub could not be reached), and it stays silent rather than guessing. Do not read a missing `warnings` as a healthy installation. |
| `400` | The window flags conflict or don't parse, or the cursor is stale. |
| `401` | No credential, or a GitHub grant too old to read org membership — re-run `sling login`. |
| `403` | You are not a member of the org named in `?org=`. |
| `422` | A path or query parameter failed schema validation. `details` names each offending field. |
| `500` | The control plane failed, or the CI facts store is not configured for this deployment. |
### `200` body
- `runs` — array