linear-cli
CLAUDE.md144 starsChanged 6 months agoMITView on GitHub
Linear CLI - A token-efficient CLI for Linear, written in Go. Step 1: Authenticate and set mode Step 2: Set default team Step 3 (optional): Set default project Edit .linear.yaml to add a default project: When set, commands with --project (issues list, issues create, issues update, search, deps, documents create) will use this default. Explicit --project flags always override it. If linear auth status shows "Auth mode not set", re-run linear auth login. IMPORTANT: All commands now support JSON output…
- Commits and pushes
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
14 rules. About 0 are common, 6 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 50
When set, commands with --project (issues list, issues create, issues update, search, deps, documents create) will use this default.
- Very specific: line 57
If linear auth status shows "Auth mode not set", re-run linear auth login.
- Distinctive: line 61
IMPORTANT: All commands now support JSON output for automation and scripting.
- Very specific: line 218
Weekly unblocking routine: Run linear search --has-blockers to find stuck work
- Distinctive: line 219
Before creating issues: Search first to avoid duplicates
- Very specific: line 220
After creating issues: Use /link-deps skill to establish dependencies
- Very specific: line 221
Sprint planning: Check linear deps --team CEN for work order
- Distinctive: line 222
Priority alignment: Ensure foundation work is prioritized over features it blocks
- Very specific: line 283
After running linear init, use these skills:
- Distinctive: line 320
Run the full test suite before committing:
- Very specific: line 328
IMPORTANT: Do NOT run goreleaser locally.
- Distinctive: line 347
Update all SHA256 checksums for each platform
- Very specific: line 368
Run ./test-release.sh for manual verification (optional but recommended for releases)
- Distinctive: line 369
Commit with clear messages
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
Linear CLI - A token-efficient CLI for Linear, written in Go.
Commands
make build # Build binary (bin/linear)
make test # Run unit tests
make clean # Clean build artifactsProject Structure
cmd/linear/ # CLI entry point
internal/cli/ # CLI commands (Cobra)
internal/format/ # ASCII formatters for token-efficient output
pkg/linear/ # Linear GraphQL client (public library)
internal/service/ # Service layer
internal/skills/ # Embedded Claude Code skills
internal/oauth/ # OAuth2 flow
internal/token/ # Secure token storageFor AI Agents (Claude Code)
Essential Setup
Step 1: Authenticate and set mode
linear auth login # Choose "Agent" mode for bots/automation
linear auth status # Verify: should show "Mode: Agent"Step 2: Set default team
linear init # Select default team - creates .linear.yamlStep 3 (optional): Set default project
Edit .linear.yaml to add a default project:
# .linear.yaml
team: CEN
project: my-project # optional — used when --project flag is omittedWhen set, commands with --project (issues list, issues create, issues update, search, deps, documents create) will use this default. Explicit --project flags always override it.
Authentication Modes
- User mode:
--assignee meassigns to the human's Linear account - Agent mode:
--assignee meassigns to the OAuth app (delegate), visible as a separate entity in Linear
If linear auth status shows "Auth mode not set", re-run linear auth login.
Output Formats
IMPORTANT: All commands now support JSON output for automation and scripting.
Text Output (default) - Token-efficient ASCII format:
linear issues list
linear issues get CEN-123JSON Output - Machine-readable for parsing:
linear issues list --output json
linear issues get CEN-123 --output jsonVerbosity Levels (--format flag):
minimal- Essential fields only (~50 tokens)compact- Key metadata (~150 tokens, default)detailed- Complete details, truncated comments (~500 tokens). Uselinear issues comments <id>for full text.full- Complete details, untruncated comments
Reading Comments:
linear issues comments CEN-123 # Full comment bodies
linear issues comments CEN-123 --last 5 # Last 5 onlyWhen to use JSON:
- Parsing data programmatically
- Filtering with jq or similar tools
- Storing results for later processing
- Integrating with other tools
Examples for AI Agents:
# Get all high-priority issues as JSON for processing
linear issues list --priority 1 --output json
# Export cycle analysis for reporting
linear cycles analyze --team CEN --output json
# Parse specific fields with jq
linear issues list --output json | jq '.[] | {id: .identifier, title: .title, priority: .priority}'
# Get minimal JSON for quick checks
linear issues get CEN-123 --format minimal --output jsonAll commands with --output support:
issues list,issues getcycles list,cycles get,cycles analyzeprojects list,projects getteams list,teams get,teams labels,teams statesusers list,users get,users mesearch(all search operations)attachments list,attachments create,attachments updatedocuments list,documents get,documents create,documents updatedeps(dependency graph)
Common Patterns
Listing Issues
# List all issues (NOT just assigned - this is the default behavior)
linear issues list --format full
# Filter by state
linear issues list --team CEN --state "In Progress" --format full
# Filter by priority (1=urgent, 2=high, 3=normal, 4=low)
linear issues list --priority 1 --format full
# Get issues in specific cycle
linear issues list --cycle 65 --format full
# Filter by assignee
linear issues list --assignee me --format full
# Combine filters
linear issues list --state Backlog --labels customer --priority 1 --format fullCycle Operations
# CRITICAL: Analyze velocity BEFORE planning cycles
linear cycles analyze --team CEN --count 10
# Get cycle details (by number - requires 'linear init')
linear cycles get 65
# List all cycles
linear cycles list --team CEN --format full
# List only active cycles
linear cycles list --activeCreating Issues
# Minimal - requires 'linear init' first
linear issues create "Fix authentication bug"
# Complete with all parameters
linear issues create "Implement feature" \
--team CEN \
--state "In Progress" \
--priority 1 \
--assignee me \
--estimate 5 \
--cycle 65 \
--labels "backend,security"Working with Team Context
- Cycle numbers (65, 66) require team context from
linear init - Issue identifiers (CEN-123) work without team context
- UUIDs work without team context
Error Handling
| Error | Solution |
--team is required | Run linear init or add --team CEN flag |
Entity not found: Cycle | Verify team context: run linear init |
Unknown type "IssueOrderBy" | Update CLI to latest version |
Search & Dependency Management
The linear search command is powerful for discovery and dependency management:
Finding Blocked Work
# Find ALL issues with blockers (weekly routine to unblock work)
linear search --has-blockers --team CEN
# Find high-priority blocked work
linear search --priority 1 --has-blockers --team CEN
# Find what's blocked by a specific bottleneck
linear search --blocked-by CEN-123Discovering Dependencies
# Find related work by keyword
linear search "authentication" --team CEN
# Check if work has dependencies
linear search "OAuth" --has-dependencies --team CEN
# Find complex dependency chains
linear search --max-depth 5 --team CEN
# Detect circular dependencies (always fix these!)
linear search --has-circular-deps --team CENBest Practices
- Weekly unblocking routine: Run
linear search --has-blockersto find stuck work - Before creating issues: Search first to avoid duplicates
- After creating issues: Use
/link-depsskill to establish dependencies - Sprint planning: Check
linear deps --team CENfor work order - Priority alignment: Ensure foundation work is prioritized over features it blocks
Attachments (sidebar cards)
Attachment objects are structured sidebar cards (GitHub PRs, Slack threads, uploaded files, URLs).
This is different from --attach on issues create/update/comment/reply, which embeds files as inline markdown images.
# List attachment cards on an issue
linear attachments list TEC-123
# Attach a URL (sidebar card, auto-detects source type)
linear attachments create TEC-123 --url "https://github.com/org/repo/pull/42" --title "PR #42"
# Upload a file as attachment card (title defaults to filename)
linear attachments create TEC-123 --file /tmp/screenshot.png
# Upload with custom title
linear attachments create TEC-123 --file /tmp/screenshot.png --title "Bug screenshot"
# Update attachment metadata
linear attachments update <uuid> --title "Updated title"
# Delete attachment
linear attachments delete <uuid>
# Embed file as inline image in description (NOT a sidebar card)
linear issues create "Bug" --attach /tmp/screenshot.pngDocuments
Documents are long-form markdown (specs, PRDs, runbooks) with exactly one parent: a project, an issue, or a team. References accept a UUID, a slug (trailing token of the Linear URL), or the full URL.
# List (bodies are never included — use get)
linear documents list --team CEN
linear documents list --project my-project --team CEN
linear documents list --issue CEN-123
linear documents list --query "runbook" --output json
# Read full content
linear documents get my-spec-abc123def456
linear documents get https://linear.app/acme/document/my-spec-abc123def456 --output json
# Create — parent from --project | --issue | --team, else .linear.yaml default project, then team
linear documents create --title "API Spec" --project my-project --content-file spec.md
cat notes.md | linear documents create --title "Notes" --issue CEN-123 --content -
# Update title, content, or move to another parent
linear documents update my-spec-abc123def456 --title "API Spec v2"
linear documents update my-spec-abc123def456 --content-file spec.md
linear documents update my-spec-abc123def456 --issue CEN-124
# Delete (moves to trash; restore in the Linear UI)
linear documents delete my-spec-abc123def456Skills Usage
After running linear init, use these skills:
/linear- NEW Complete CLI reference (MUST READ before using Linear commands)/prd- Create agent-friendly tickets (searches for existing work first)/triage- Prioritize backlog issues (uses search to find blocked work)/cycle-plan- Analyze and plan cycles/retro- Generate sprint retrospectives/deps- Visualize dependency graphs/link-deps- Discover and link missing dependencies across backlog
CLI Commands
Dependency Graph
linear deps ENG-100 # Show deps for issue
linear deps --team ENG # Show all deps for team
linear deps --team ENG --output json # JSON for automationSkills Management
linear skills list # List available skills
linear skills install --all # Install all skills
linear skills install prd # Install specific skillAvailable skills: /linear, /prd, /triage, /cycle-plan, /retro, /deps, /link-deps
Key Design Decisions
- ASCII output - Token-efficient, no JSON overhead
- JSON output - Machine-readable for automation via
--output json - Human-readable IDs - "TEST-123" not UUIDs
- Service layer - Validation and formatting abstraction
- Verbosity levels - Control detail with
--format minimal|compact|detailed|full
Testing
Run the full test suite before committing:
make test # Run unit tests
./test-release.sh # Run comprehensive release test against TEST teamReleasing
IMPORTANT: Do NOT run goreleaser locally. Let GitHub Actions handle the build and upload.
Release Workflow
- Update CHANGELOG.md with the new version and changes
- Commit the changelog:
git commit -m "chore: Update CHANGELOG for vX.Y.Z" - Create and push tag:
git tag vX.Y.Z && git push && git push --tags - Wait for GitHub Actions to complete the release workflow (~2 min)
- Monitor at:
gh run watchor check GitHub Actions tab - The workflow runs goreleaser and uploads all artifacts
- Monitor at:
- Get checksums from the release:
gh release download vX.Y.Z --pattern checksums.txt --output - - Update Homebrew formula (
Formula/linear-cli.rb):- Update
version "X.Y.Z" - Update all SHA256 checksums for each platform
- Update
- Commit and push formula:
git add Formula/linear-cli.rb git commit -m "chore: Update formula to vX.Y.Z" git push - Install locally to verify:
cd /opt/homebrew/Library/Taps/joa23/homebrew-linear-cli && git pull && cd - brew upgrade linear-cli linear --version
Why Not Local goreleaser?
Running goreleaser release locally and then having GitHub Actions also run it causes duplicate upload errors. The CI workflow is the source of truth for release artifacts.
Session Completion
make testmust pass- Run
./test-release.shfor manual verification (optional but recommended for releases) - Commit with clear messages
- Push to remote - work is NOT complete until pushed
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

