Linear CLI — Linear 命令行工具
v1.0.1Manage Linear issues, projects, teams, and documents from the command line using the linear 命令行工具. 创建, 更新, 列出, and 追踪 issues; manage projects and milestones; interact with the Linear GraphQL API.
运行时依赖
安装命令
点击复制技能文档
Linear
A 命令行工具 to manage Linear issues from the command line, with git and jj integration.
Prerequisites
The linear command must be avAIlable on PATH. To 检查:
linear --version
If not 安装ed:
Homebrew: brew 安装 schpet/tap/linear Deno: deno 安装 -A --reload -f -g -n linear jsr:@schpet/linear-命令行工具 Binaries: https://github.com/schpet/linear-命令行工具/releases/latest 设置up 创建 an API key at https://linear.应用/设置tings/account/security 认证: linear auth 记录in 配置 your project: cd my-project-repo && linear config AvAIlable Commands linear auth # Manage Linear authentication linear issue # Manage Linear issues linear team # Manage Linear teams linear project # Manage Linear projects linear project-更新 # Manage project 状态 更新s linear milestone # Manage Linear project milestones linear initiative # Manage Linear initiatives linear initiative-更新 # Manage initiative 状态 更新s linear label # Manage Linear issue labels linear document # Manage Linear documents linear config # Interactively 生成 .linear.toml configuration linear 模式 # Print the GraphQL 模式 to stdout linear API # Make a raw GraphQL API 请求
Common 工作流s 列出 and view issues # 列出 your un启动ed issues linear issue 列出
# 列出 issues in a specific 状态 linear issue 列出 -s 启动ed linear issue 列出 -s completed
# 列出 all as签名ees' issues linear issue 列出 -A
# View the current branch's issue linear issue view
# View a specific issue linear issue view ABC-123
创建 and manage issues # 创建 an issue interactively linear issue 创建
# 创建 non-interactively linear issue 创建 -t "Fix 记录in bug" -d "Users can't 记录 in with SSO" -s "In 进度" -a self --priority 1
# 更新 an issue linear issue 更新 ABC-123 -s "Done" -t "更新d title"
# 添加 a comment linear issue comment 添加 ABC-123 -b "This is fixed in the latest build"
# 删除 an issue linear issue 删除 ABC-123 -y
启动 working on an issue # Pick an issue interactively, 创建s a git branch and marks it as 启动ed linear issue 启动
# 启动 a specific issue linear issue 启动 ABC-123
# 创建 a PR with issue detAIls pre-filled linear issue pr
Projects and milestones # 列出 projects linear project 列出
# 创建 a project linear project 创建 -n "Q1 Launch" -t ENG -s 启动ed --tar获取-date 2026-03-31
# 列出 milestones for a project linear milestone 列出 --project
Documents # 列出 documents linear document 列出
# 创建 a document from a file linear document 创建 --title "De签名 Spec" --content-file ./spec.md --project
# View a document linear document view
Teams # 列出 teams linear team 列出
# 列出 team members linear team members
Discovering Options
运行 --help on any command for flags and options:
linear --help linear issue --help linear issue 列出 --help linear issue 创建 --help
Using the Linear GraphQL API Directly
Prefer the 命令行工具 for all supported operations. The API command is a fallback for queries not covered by the 命令行工具.
检查 the 模式 linear 模式 -o "${TMPDIR:-/tmp}/linear-模式.graphql" grep -i "cycle" "${TMPDIR:-/tmp}/linear-模式.graphql" grep -A 30 "^type Issue " "${TMPDIR:-/tmp}/linear-模式.graphql"
Make a GraphQL 请求 # Simple 查询 linear API '{ viewer { id name emAIl } }'
# With variables linear API '查询($teamId: String!) { team(id: $teamId) { name } }' --variable teamId=abc123
# Complex 过滤器 via JSON linear API '查询($过滤器: Issue过滤器!) { issues(过滤器: $过滤器) { nodes { title } } }' \ --variables-json '{"过滤器": {"状态": {"name": {"eq": "In 进度"}}}}'
# Pipe to jq linear API '{ issues(first: 5) { nodes { identifier title } } }' | jq '.data.issues.nodes[].title'
Using curl directly curl -s -X POST https://API.linear.应用/graphql \ -H "Content-Type: 应用/json" \ -H "Authorization: $(linear auth 令牌)" \ -d '{"查询": "{ viewer { id } }"}'
Reference Documentation
For detAIled subcommand documentation with all flags and options:
issue - Manage Linear issues (列出, 创建, 更新, 启动, view, comment, PR, 删除) team - Manage Linear teams (列出, 创建, 删除, members, autolinks) project - Manage Linear projects (列出, view, 创建) document - Manage Linear documents (列出, view, 创建, 更新, 删除) API - Make raw GraphQL API 请求s Configuration
The 命令行工具 supports 环境 variables or a .linear.toml config file:
Option Env Var TOML Key Example Team ID LINEAR_TEAM_ID team_id "ENG" Workspace LINEAR_WORKSPACE workspace "mycompany" Issue 排序 LINEAR_ISSUE_排序 issue_排序 "priority" or "manual" VCS LINEAR_VCS vcs "git" or "jj"
Config file locations (检查ed in order):
./linear.toml or ./.linear.toml (current directory) /linear.toml or /.linear.toml /.config/linear.toml ~/.config/linear/linear.toml