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

# linear

> Linear GraphQL API client with the noun/verb grammar of the mount commands.

Mirage's built-in client for Linear's
[GraphQL API](https://linear.app/developers/graphql) has a Mirage-native
noun/verb command grammar partly inspired by
[schpet/linear-cli](https://github.com/schpet/linear-cli). The Mirage command
tree is discoverable with `linear --help`.

**Licenses:** `schpet/linear-cli` uses the
[ISC License](https://github.com/schpet/linear-cli/blob/main/LICENSE); Mirage's
independent implementation uses
[Apache-2.0](https://github.com/strukto-ai/mirage/blob/main/LICENSE).

## Install

```typescript theme={null}
import { LINEAR } from '@struktoai/mirage-core'
import { LinearVFS, Workspace } from '@struktoai/mirage-node'

const config = { apiKey: 'lin_api_...' }
const ws = new Workspace({ '/issues': new LinearVFS(config) })
ws.registerCli('linear', LINEAR, config)
```

Two installs under different names are two accounts. In YAML, the same
install rides the `clis:` section; see the [CLI overview](/typescript/cli/index).

## Verbs

The shared shape is `linear issue ...` and noun groups such as `team`, `user`,
`project`, and `document`. Mirage keeps the exact command tree from its former
mount commands (`linear issue create`, `linear team list`). Issues are
addressed by a positional key or ID (`linear issue get ENG-42`); every command
emits normalized JSON, so output pipes straight into `jq`.

### Reads

```bash theme={null}
linear team list
linear team get ENG
linear team members ENG
linear issue list --team ENG
linear issue get ENG-42
linear project list --team ENG
linear project get <project-id> --team ENG
linear cycle list --team ENG
linear cycle current --team ENG
linear label list --team ENG
linear comment list ENG-42
linear user list
linear user get sam@example.com
linear document list --team ENG
linear document get <document-id> --team ENG
linear search "login bug"
```

`--team` accepts a team key, name, or ID.

### Writes

```bash theme={null}
linear issue create --team ENG --title "Title" --description "Body"
linear issue update ENG-42 --title "New title"
linear issue assign ENG-42 --assignee-email user@example.com
linear issue transition ENG-42 --state-name "In Review"
linear issue set-priority ENG-42 --priority 2
linear issue set-project ENG-42 --project-name "Search"
linear issue add-label ENG-42 --label-name "bug"
linear comment add ENG-42 --body "comment"
linear comment update --comment <comment-id> --body "edited"
```

| Verb | Notes |
| - | - |
| `issue create` | `--team` and `--title` required |
| `issue update` | `--title` and/or `--description` |
| `issue assign` | `--assignee-email` or `--assignee-id` |
| `issue transition` | `--state-name` or `--state-id` |
| `issue set-priority` | `--priority 0..4` (0=none, 1=urgent, ... 4=low) |
| `issue set-project` | `--project-name` or `--project` (ID) |
| `issue add-label` | `--label-name` or `--label` (ID); appends to the issue's existing labels |

Descriptions and comment bodies also read from stdin:
`echo "body" | linear comment add ENG-42`.


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