linear-cli AGENTS.md

A set of project instructions for developing a Deno command-line tool that uses Linear's GraphQL API. It covers permissions, typing, output format, diagnostics, and tests.

In plain words
What is it for?
Use it when editing the CLI, changing GraphQL queries or schema-related code, checking errors, running tests, or maintaining paginated JSON output.
Why use it?
It gives the coding agent project-specific rules so changes follow the expected tools, types, permissions, and JSON structure.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/schpet/linear-cli/agents-md
Clone the repo
git clone --depth 1 https://github.com/schpet/linear-cli

Made for: Codex, OpenCode.

Per session 702 This file is loaded in full into every session.
When invoked 702 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00702 $0.00702
Opus 5 $0.00351 $0.00351
Sonnet 5 $0.00140 $0.00140
Haiku 4.5 $0.00070 $0.00070

Measured 2d ago against content hash 267728a11759, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

linear-cli AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 46 lines

How it starts

The opening of the file, as written. The whole thing — 46 lines — stays where its author put it; the contents beside it link to each section on GitHub.

basics

  • this is a deno app
  • after editing any graphql documents, run deno task codegen to get the updated types after it's updated, const result = await client.request(query, { teamId }); should work and be typed (and not require explicit types)
  • graphql/schema.graphql has the graphql schema document for linear's api
  • for diagnostics, use deno check and deno lint (do not use tsc or rely on LSP for this)
  • when coloring or styling terminal text, use deno's @std/fmt/colors package
  • prefer foo == null and foo != null over foo === undefined and foo !== undefined
  • import: use dynamic import only when necessary, the static form is preferable
  • avoid the typescript any type - prefer strict typing, if you can't find a good way to fix a type issue (particularly with graphql data or documents) explain the problem instead of working around it
  • for --json output, preserve GraphQL field names and nesting instead of inventing CLI-specific JSON shapes
  • for paginated --json output, preserve connection shape and concatenate nodes rather than flattening or renaming fields

permissions

  • deno permissions (--allow-env, --allow-net, etc.) are configured in multiple files that must stay in sync
  • see docs/deno-permissions.md for the full list of files to update when adding new permissions
  • key files: deno.json (tasks), dist-workspace.toml (release builds), test files

error handling

  • never fail silently - if something goes wrong or a lookup fails, throw an error with a helpful message
  • when user-provided input (flags, args) doesn't match expected values, error immediately with guidance on how to fix it
  • avoid falling back to defaults when explicit user input is invalid; explicit input should either work or error
  • use custom error classes from src/utils/errors.ts:
    • ValidationError(message, { suggestion }) for bad input
    • NotFoundError(entityType, identifier) for missing entities
    • AuthError(message) for auth issues
    • CliError(userMessage, { suggestion, cause }) for others
  • wrap command actions in try-catch with handleError(error, "Failed to <action>")
  • errors display clean messages to stderr with ✗ prefix, stack traces only shown when LINEAR_DEBUG=1

Read the full file on GitHub · 46 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 46 lines · 702 tokens per session scan A 267728a11759

Subscribe to this mod's changes

linear-cli AGENTS.md is an instructions file published in the GitHub repository schpet/linear-cli (936 stars, last pushed 20d ago), licensed ISC. It adds 702 tokens to every session, about $0.0035 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.