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

> ## Agent Instructions
> These docs describe the Ancha CLI, npm package @ancha-labs/cli version 0.1.4, and the hosted workspace at app.ancha.io. Coding agents should start at https://docs.ancha.io/coding-agents. Run the CLI as `ancha` after `npm install -g @ancha-labs/cli`, or as `npx -y @ancha-labs/cli@0.1.4` without installing. Pass --json for machine-readable output, or set ANCHA_JSON=1. Every command ends with a `next:` line naming the next command. Exit codes: 0 pass, 1 a check failed or a comparison regressed, 2 usage, config or authentication error, 3 infrastructure error, 4 unimplemented endpoint with --strict.

# Linear

> A stateful replica of Linear's GraphQL API: issues, comments, labels, workflow states, teams, projects and users, pruned to the operations it serves.

The Linear replica serves 27 GraphQL operations from Linear's published schema: 17 queries and 10 mutations over issues, comments, labels, workflow states, teams, projects and users. Its key is `linear`. It was tested with `@linear/sdk`.

## Connect

| Variable | Value |
| - | - |
| `LINEAR_API_URL` | The GraphQL endpoint. |
| `LINEAR_API_KEY` | Fake personal API key. Send it in the `Authorization` header, as the SDK does. |

```js Node theme={null}
import { LinearClient } from '@linear/sdk';
const linear = new LinearClient({ apiKey: process.env.LINEAR_API_KEY, apiUrl: process.env.LINEAR_API_URL });
const issues = await linear.issues({ first: 10 });
```

This is what `ancha connect linear --lang ts` prints. `@linear/sdk` accepts a plain-http `apiUrl` only on `localhost`, `127.0.0.1` or `[::1]`, which is where a local world runs. A hosted workspace serves the replica over HTTPS.

## Operations

| Kind | Operation | Support |
| - | - | - |
| query | `viewer`, `organization`, `teams`, `team`, `users`, `user` | supported |
| query | `issues` | partial: `filter` supports `and`/`or`, string, ID, number, date and boolean comparators, relation and collection filters; `sort` is a gap |
| query | `issue` | supported |
| query | `searchIssues` | partial: every term must appear in the identifier, title or description, and in comments with `includeComments` |
| query | `workflowStates`, `workflowState`, `issueLabels`, `issueLabel`, `comments`, `comment`, `projects`, `project` | supported |
| mutation | `issueCreate` | partial: cycles, templates, subscribers, milestones, releases and SLAs are gaps |
| mutation | `issueUpdate` | partial: moving an issue to another team is a gap |
| mutation | `issueArchive`, `issueAddLabel`, `issueRemoveLabel`, `commentUpdate`, `commentDelete`, `issueLabelCreate` | supported |
| mutation | `issueDelete` | partial: trashes the issue; `permanentlyDelete` is a gap |
| mutation | `commentCreate` | partial: comments on issues only |

Fields and types outside these operations answer as coverage gaps in GraphQL's error shape, with `x-ancha-gap: 1`.

## Starter data

The `linear-starter` dataset is the workspace **Acme** (`acme`). The token belongs to the user `ancha`.

| Record | Detail |
| - | - |
| Users | Ancha assistant, Ben Carter (admin, Engineering lead), Greg Wilson, Rachel Moore, Victor Lane, Ellen Price, Laura Kim, Mike Turner (admin). |
| Team `ENG` | Engineering: Orders API, web app and dashboards. Members: the bot, Ben, Greg, Rachel, Ellen. Team labels Incident and Orders API. |
| Team `DATA` | Data Platform: warehouse sync and pipelines. Members: the bot, Victor, Greg, Rachel. Team label Warehouse sync. |
| Workspace labels | Bug, Feature, Improvement, Customer, Documentation. |
| Project "Scheduled reports" | Led by Ellen, started 2026-10-19, target 2026-12-11. |
| Project "Orders API reliability" | Led by Rachel, started 2026-10-05, target 2026-11-27. |

Seventeen issues, with the simplified workflow states Backlog, Todo, In Progress, In Review and Done:

| State | Issues |
| - | - |
| Done | "Order totals off by one cent for multi-currency carts", "GET /orders is slow for large accounts", "Fulfillment webhooks time out after 10 seconds", "Dashboard shows yesterday's numbers twice" (Kestrel Credit Union), "Orders API p95 latency above 700ms after 4.12.1" (an incident, resolved by a rollback), and "Speed up the Ridgeway Robotics warehouse sync" (Data Platform). |
| In Progress | "Fix the fulfillment queue backlog introduced in 4.12.1" (Greg, a child of the latency incident) and "Clarify recovery checks in the Orders runbook" (Ben). |
| In Review | "Rate-limit order creation per API key" (Greg). |
| Todo | "Return 409 when an order is cancelled twice", "Explain delayed CSV exports" (Customer, Documentation), "Scheduled reports: retry failed deliveries" and "Upgrade the Snowflake connector" (Data Platform, due 2026-11-01). |
| Backlog | "Document the order states", "Scheduled reports: send in the recipient's time zone", "SCIM provisioning for Okta" and "Dark mode for dashboards". |

Several issues carry comments, estimates and project links. `ancha sandbox configuration --tools linear --json` prints every field.

## Checks

Linear has no state checks. Every operation goes through one GraphQL endpoint, so a trace check names that path; run `ancha explain` or `ancha world trace` once to see how the replica records the agent's requests before you write one.

## Limits

* Linear's published schema, pruned to the operations above; other fields and types answer as coverage gaps.
* No cycles, initiatives, documents, attachments, notifications, webhooks or sorting; filters cover the common comparators.
* `@linear/sdk` accepts a plain-http `apiUrl` only on localhost, `127.0.0.1` or `[::1]`; elsewhere the endpoint needs TLS.


## Related topics

- [ancha twins](https://docs.ancha.io/cli/twins.md)
- [Tools](https://docs.ancha.io/tools/overview.md)
- [Test file (scene.yaml)](https://docs.ancha.io/reference/test-file.md)
- [ancha connect](https://docs.ancha.io/cli/connect.md)
- [Introduction](https://docs.ancha.io/index.md)


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