linear
Use for ANY Linear interaction: read, view, list, search, create, edit, update, comment on, label, block, unblock, or activate any Linear issue, project, cycle, milestone, initiative, or label. Bash CLI over Linear's GraphQL API with local cache and mutation syncing.
- License 许可
- MIT
- 最近更新
- 2026-08-31
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- linear
- license
- MIT
- metadata
- { "bugs": "https://github.com/vanillagreencom/vstack/issues", "author": "vanillagreen", "source": "vstack", "version": "1.0.0", "repository": "https://github.com/vanillagreencom/vstack" }
- description
- Use for ANY Linear interaction: read, view, list, search, create, edit, update, comment on, label, block, unblock, or activate any Linear issue, project, cycle, milestone, initiative, or label. Bash CLI over Linear's GraphQL API with local cache and mutation syncing.
- user-invocable
- true
02 资源文件 59
- 参考文档DEVELOPMENT.md5.4 KB
- 参考文档patterns/workflow-actions.md9.9 KB
- 参考文档README.md4.7 KB
- 脚本scripts/_activity-emit.sh103 B
- 脚本scripts/commands/auth-check.sh4.7 KB
- 脚本scripts/commands/cache-query.sh38.7 KB
- 脚本scripts/commands/comments.sh9.3 KB
- 脚本scripts/commands/cycles.sh8.9 KB
- 脚本scripts/commands/documents.sh3.5 KB
- 脚本scripts/commands/initiatives.sh13.9 KB
- 脚本scripts/commands/issues.sh95.6 KB
- 脚本scripts/commands/labels.sh8.8 KB
- 脚本scripts/commands/milestones.sh10.3 KB
- 脚本scripts/commands/project-labels.sh7.6 KB
- 脚本scripts/commands/projects.sh39.8 KB
- 脚本scripts/commands/session-status.sh18.2 KB
- 脚本scripts/commands/statuses.sh4.3 KB
- 脚本scripts/commands/sync.sh26.6 KB
- 脚本scripts/commands/teams.sh3.7 KB
- 脚本scripts/commands/users.sh3.6 KB
- 脚本scripts/lib/attachments.sh12.5 KB
- 脚本scripts/lib/bash-version.sh366 B
- 脚本scripts/lib/cache.sh16.1 KB
- 脚本scripts/lib/common.sh22.7 KB
- 脚本scripts/lib/formatters.sh24.1 KB
- 脚本scripts/lib/issue-validation.sh10.0 KB
- 脚本scripts/lib/vstack-env.sh4.8 KB
- 脚本scripts/linear.sh5.1 KB
- 脚本tests/action-aliases.test.sh3.0 KB
- 脚本tests/bash32-portability.test.sh635 B
- 脚本tests/bulk-update-diagnostics.test.sh1.7 KB
- 脚本tests/cache-issues-all-projects.test.sh5.1 KB
- 脚本tests/cache-issues-no-project.test.sh5.4 KB
- 脚本tests/cache-no-auth.test.sh5.0 KB
- 脚本tests/cache-root-git-worktree.test.sh3.9 KB
- 脚本tests/cache-safe-format-parent-labels.test.sh5.5 KB
- 脚本tests/comments-body-file.test.sh2.0 KB
- 脚本tests/completed-blocker-relations-doc.test.sh1.6 KB
- 脚本tests/completion-validation-bundle-children-cache.test.sh6.0 KB
- 脚本tests/completion-validation-bundle-children.test.sh8.9 KB
- 脚本tests/completion-validation-parented-root.test.sh4.2 KB
- 脚本tests/estimate-clear.test.sh7.9 KB
- 脚本tests/graphql-document-classification.test.sh5.1 KB
- 脚本tests/issues-activate-agent.test.sh5.4 KB
- 脚本tests/issues-add-relation-deep-hierarchy.test.sh9.5 KB
- 脚本tests/issues-add-relation-hierarchy.test.sh11.8 KB
- 脚本tests/issues-archive-trash-entity-verify.test.sh7.7 KB
- 脚本tests/issues-complete-summary.test.sh8.0 KB
- 脚本tests/issues-create-format-ids.test.sh3.2 KB
- 脚本tests/issues-create-parent.test.sh7.7 KB
- 脚本tests/issues-description-file.test.sh5.3 KB
- 脚本tests/issues-update-format-safe.test.sh5.1 KB
- 脚本tests/issues-view-action-hint.test.sh5.3 KB
- 脚本tests/projects-list-pagination.test.sh5.8 KB
- 脚本tests/settings-example-sync.test.sh2.4 KB
- 脚本tests/sync-merge-abort-error.test.sh5.8 KB
- 脚本tests/team-target-fail-closed.test.sh17.5 KB
- 脚本tests/update-emit-newline.test.sh1.8 KB
- 其他vstack.settings.toml.example936 B
03 SKILL.md 正文
Linear CLI
Problem with this skill? Run
vstack report— it files to the owning repo automatically. Do not hand-file.
CLI wrapper for Linear's GraphQL API with local cache, bulk operations, and structured output.
.agents/skills/linear/scripts/linear.sh <resource> <action> [options]
Resources
ctx7 CLI
| Library | ctx7 ID | Use For |
|---|---|---|
| Linear API | /websites/studio_apollographql_public_linear-api_variant_current |
GraphQL schema reference |
| Linear SDK | /linear/linear |
SDK docs with examples |
| Linear Guides | /websites/linear_app_developers |
Developer guides |
Workflow Patterns
| Pattern | Use For |
|---|---|
| patterns/workflow-actions.md | Multi-step issue/project state changes used by orch and TPM workflows |
Commands
| Resource | Actions |
|---|---|
issues |
list, get, create, update, children, list-relations, add-relation, remove-relation, bulk-get, bulk-update, activate (--agent <name> applies the exclusive agent:<name> label), block, unblock, complete (--summary <text> / --summary-file <path> post the completion comment before the Done transition), validate-completion |
comments |
list, create (--body or --body-file) |
projects |
list, get, create, update, list-dependencies, add-dependency, remove-dependency, post-update, list-updates |
initiatives |
list, get, create, add-project |
milestones |
list, get, create |
labels |
list, create |
project-labels |
list, create |
teams |
list, get |
users |
list, get |
cycles |
list |
statuses |
list, get |
documents |
list, get |
sync |
Sync Linear data to local cache |
cache |
Query local cache (issues, projects, cycles, initiatives, comments, labels, attachments) |
auth-check |
Validate API key and report the resolved team target (--strict also fails when no team is configured) |
Compatibility aliases: issues relations maps to issues list-relations, and projects dependencies maps to projects list-dependencies. Prefer the explicit action names in new workflows.
There is no view or show action. Single-issue lookups are issues get <ID> (live) or cache issues get <ID> (cache); multi-issue lookups are issues bulk-get <ID1> <ID2> .... For post-mutation verification, use live issues bulk-get — it returns fresh state for every mutated issue in one command.
Hierarchy
INITIATIVE (Strategic goal — months)
└── PROJECT (2-6 week deliverable)
├── MILESTONE (stage: Alpha, Beta, Release)
│ └── ISSUE (1-5 day work item)
└── ISSUE (work item without milestone)
└── SUB-ISSUE (breakdown for parallel work)
Cache Pattern
Reads go through cache. Writes go through live commands (auto-update cache via write-through). Sync at session start or when cache is stale.
# READS → cache (fast, no API calls)
linear.sh cache issues list --project "Phase 2" --state "Todo,In Progress"
linear.sh cache issues list --all-projects --state "Backlog,Todo" --max --format=compact
linear.sh cache issues get ABC-100 --with-bundle
# WRITES → live (hit API, auto-update cache)
linear.sh issues create --title "New task" --project "Phase 2"
linear.sh issues update ABC-100 --state "Done"
# SYNC → refresh cache
linear.sh sync --reconcile # Incremental + reconcile archived
linear.sh sync --full # Full re-sync
cache issues list --all-projects enumerates every project in ONE command — each row carries its project name, and other filters (--state, --max, --format) compose. Use it for cross-project comparison sets instead of looping --project per project; restricted harness approval policies reject loop-shaped commands. Mutually exclusive with --project.
Cache and attachment files live under .cache/linear in the physical git worktree root reported by git rev-parse --show-toplevel, not under the path used to reach the skill script. This keeps sync, cache, and attachment reads consistent across symlinked checkout spellings, worktrees, and canonical source-path invocation. A missing-cache error includes the checked cache_dir and meta_path; inspect those fields before assuming a sync wrote somewhere else.
Output Formats
| Format | Description |
|---|---|
safe |
DEFAULT. Flat, null-safe JSON |
ids |
Newline-separated identifiers |
table |
Human-readable table |
raw |
Original GraphQL structure |
compact omits description and other large text fields. raw nests fields under GraphQL structure — do not assume top-level jq paths. Use safe (default) when you need issue descriptions or full field access.
Configuration
| Variable | Purpose | Default |
|---|---|---|
LINEAR_API_KEY |
API key (required for live API commands and sync; not required for cache reads) | — |
LINEAR_TEAM |
Team every write targets | — (unset refuses writes) |
LINEAR_FORMAT |
Default output format | safe |
LINEAR_TEAM_PREFIX |
Issue identifier prefix | PROJ |
Put LINEAR_API_KEY in .env.local. Put non-secret defaults in committed vstack.settings.toml under [env]; .env.local still wins for local overrides.
LINEAR_TEAM has no default. A team name resolves inside whatever workspace the API key reaches, so an unset team means no target: every write (create, update, comment, archive, relation, state change) refuses with an actionable error before any API call, and reads run without a team filter. --team <name> overrides it per call only on the actions that take a team — issues create, projects create, cycles create, labels create; every other write requires the configured value. linear.sh auth-check reports the resolved team, where it came from, and writes_enabled; linear.sh auth-check --strict exits non-zero when writes would refuse — run it before the first mutation in a project.
Safe Format Field Mapping
identifier → id # ABC-XXX issue ID
id → uuid # GraphQL UUID
state.name → state # State name
state.type → state_type
sortOrder → sort_order # Manual sort position
Blocked Label vs Issue Relations
| Scenario | Use |
|---|---|
| Issue A blocked by Issue B (both in Linear) | Relation: --blocked-by |
| Issue blocked by external factor (vendor, license) | blocked label + comment |
Blocking relations must connect peers of one bundle: same direct parent, or both top-level (and same project). An issue cannot block its own ancestor or descendant — the parent-child hierarchy already encodes that dependency; use --related for traceability. Rejections for cross-subtree pairs prescribe the valid pair at the level where the subtrees separate. Before either acceptance or remediation, the guard proves each parent chain reaches an explicit null root through well-formed edges with unique IDs/identifiers. It also requires an explicit null or well-formed project value; incomplete, cyclic, or malformed hierarchy data is rejected before mutation.
A blocking relation pointing at a Done or Canceled issue is satisfied history, not stale metadata — Linear itself already treats the dependent issue as unblocked. The relation stays for provenance and traceability; never remove or "fix" it, and audits must never classify it as stale. The only legitimate audit output for a completed-blocker relation is a scheduling signal ("gates cleared, ready to schedule").
Common Pitfalls
| Option | Accepts | On failure |
|---|---|---|
--project |
Name or UUID | Fail with "not found" |
--state |
Exact name (case-sensitive) | Fail, lists available states |
--milestone |
Name or UUID | Fail with "not found" |
--parent |
Issue identifier or UUID | Fail if the parent cannot be resolved; create also fails if the link cannot be verified or repaired |
--labels |
Comma-separated issue-label names | Warn + skip invalid, continue (workflow callers must preflight strictly) |
--assignee |
Name or me |
Silent fail |
- State names are case-sensitive and team-specific — verify with
linear.sh statuses list - Available states: Backlog, Todo, In Progress, In Review, Done, Canceled (not "Cancelled")
agent:*labels are mutually exclusive (only one per issue)issues activate ISSUE --agent NAMEappliesagent:NAMEin the same update as the "In Progress" transition, replacing any existingagent:*label; it fails without changing state when the label does not existissues complete ISSUE --summary-file PATHposts the completion summary comment first and only then transitions to "Done"; a failed post leaves the state unchangedissues validate-completionis a pre-merge check: session-root targets are expected in "In Progress"/"In Review" (Done failsstate_ok— managed roots stay pre-merge until PR merge; this pre-merge rule applies to the session root only).--include-children-ofexpands the bundle and validates each child as "Done": every completed child IS included and passes, a still-pending child fails, and canceled children are excluded from the expansion (abandoned work is never "Done")--labelsreplaces the full issue-label set on update. Workflow callers must fetch current labels, compute the final set, validate againstcache labels list --format=safe, then call update with the full final set.cache labels list --format=safereturns issue labels withid,name,team,parent, andis_groupso workflows can reject parent/group labels before mutation.issues bulk-updateis non-atomic. If one item fails after earlier updates succeeded, it emits a JSON summary withpartial: true, per-issue results, and exits nonzero.
Troubleshooting
- "labelIds not exclusive child labels" error: Using multiple labels from the same exclusive group. Only one
agent:*label and oneplatform:*label per issue. - Need raw GraphQL output?: Use
--format=raw - Script help:
linear.sh <resource> --help
Dependencies
- Bash 4.0 or newer (macOS system Bash 3.2 is unsupported; install a newer Bash and invoke
linear.shwith it) curljq
04 同仓库更多 Skills
worktree
Git worktree management: create, list, remove isolated working copies with env/config symlinks.
trading-design
Professional trading UI design system. Load when designing or implementing panels, layouts, typography, color, data display, or interactions for trading applications.
second-opinion
Cross-model second opinion: review, challenge, audit, and consult via an external AI CLI (Claude ↔ Codex).
reviewer
Strict review and QA workflows: shared reviewer ethos, scope boundaries, code-review classification, finding JSON schema, and QA-label review lifecycle. Load this skill when reviewing a diff, classifying findings, returning a verdict, or handling a QA-label-triggered review.
project-management
TPM-orchestrated planning, audit, roadmap, and research-driven decomposition. Owns the user-facing wrappers (cycle-plan, audit-issues, roadmap-*, research-*) and the underlying TPM execution workflows.
price-handling
f64 price patterns for trading systems. Load when: comparing prices, rounding to tick size, formatting for display/broker APIs, parsing market feeds, designing price types or SymbolSpec structs.