This project was built in one shot by Codex and is pending human review.
linear-cli is a schema-driven command-line client for the Linear GraphQL API.
It gives you two ways to work:
- grouped commands for day-to-day use, such as
linear issue createandlinear project list - the full generated GraphQL surface under
linear query ...andlinear mutation ...
The generated command surface is derived from the Linear schema, so the CLI can be refreshed when the API changes without hand-maintaining hundreds of commands.
This repository is public, but the package is not currently published to npm. Use it from source.
- Node.js 22, 23, or 24
- pnpm 10+
git clone git@github.com:ImJamesBarrett/linear-cli.git
cd linear-cli
pnpm install
pnpm buildRun from source during development:
pnpm dev -- --helpRun the built CLI:
node dist/bin/linear.js --helpThe simplest setup is a Linear API key.
Store it once:
linear auth login-api-key --api-key <your-linear-api-key>Check the current auth state:
linear auth statusCredentials are stored in the OS keychain through keytar when available. Plaintext fallback exists, but only if explicitly enabled.
These are the main human-facing commands.
Examples:
linear issue get <issue-id>
linear issue list --first 20
linear issue create --input '{"teamId":"<team-id>","title":"Example issue"}'
linear issue update <issue-id> --input '{"title":"Renamed issue"}'
linear project get <project-id>
linear project list
linear release listExplore a command group:
linear issue --help
linear project --help
linear organization --helpThe full schema-derived command surface is still available:
linear query issue <issue-id>
linear query issues --first 20
linear mutation issue-create --input '{"teamId":"<team-id>","title":"Example issue"}'This is the source-of-truth surface. The grouped aliases sit on top of it.
For anything that does not fit the generated or grouped surfaces:
linear graphql raw \
--query 'query ViewerQuery { viewer { id name } }' \
--operation-name ViewerQueryYou can also load the query and variables from files:
linear --format json graphql raw \
--query @./query.graphql \
--variables @./variables.json \
--operation-name ViewerQueryCreate an issue:
linear issue create \
--input '{"teamId":"<team-id>","title":"Example issue"}' \
--select 'success issue { id identifier title url }'Get one issue:
linear issue get <issue-id> \
--select 'id identifier title description url state { name }'List issues:
linear issue list --first 20
linear issue list --all --select 'nodes { id identifier title } pageInfo { hasNextPage endCursor }'Update an issue:
linear issue update <issue-id> \
--input '{"title":"Updated title"}' \
--select 'success issue { id identifier title }'Upload a file:
linear upload file ./screenshot.pngDelete an uploaded asset:
linear upload delete https://assets.example.com/path/to/file.pngFlags that accept JSON can read either inline JSON or a file reference.
Examples:
linear issue create --input @./issue-create.json
linear issue list --filter @./issue-filter.json
linear graphql raw --variables @./variables.jsonHuman output is the default.
For machine-readable output:
linear --format json issue get <issue-id>
linear --format json auth statusWhen --format json is set, failure output is also emitted as JSON.
Available on the root command:
--profile <name>--format <human|json>--header <name:value>--public-file-urls-expire-in <seconds>--verbose--allow-partial-data
Refresh the vendored schema and regenerate the command registries:
pnpm fetch:schema
pnpm generate
pnpm check
pnpm testThat updates the generated query and mutation surface. The grouped aliases are derived from the generated registries.
Useful scripts:
pnpm devpnpm buildpnpm checkpnpm testpnpm test:watchpnpm fetch:schemapnpm generate