A pi extension and skill package that exposes native Linear GraphQL tools for issue, project, team, user, comment, file upload, cycle, label, workflow-state, and document workflows.
linear_whoamilinear_workspace_metadatalinear_list_teamslinear_get_teamlinear_list_userslinear_get_user
linear_list_issueslinear_get_issuelinear_search_issueslinear_list_my_issueslinear_create_issuelinear_update_issue
linear_list_projectslinear_get_projectlinear_list_issue_statuseslinear_get_issue_statuslinear_list_labelslinear_list_cycleslinear_list_documentslinear_get_document
linear_list_commentslinear_create_commentlinear_configure_auth
linear_upload_filelinear_upload_file_to_issue_comment
The package also bundles the linear skill under skills/linear/SKILL.md.
The extension looks for a Linear API key in this order:
- in-memory key override created by
/linear-auth --forceorlinear_configure_auth LINEAR_API_KEYenvironment variable~/.pi/agent/auth.jsonat.linear.key
If no key is found, or if Linear rejects the key as invalid/expired, the native tools can prompt you with a masked local dialog and store the replacement key without returning it to the model.
Do not paste API keys into an LLM chat.
Run this in pi:
/linear-auth --force
The command shows the Linear API-key URL and required permissions, prompts for the key with masked input, and writes it to ~/.pi/agent/auth.json at .linear.key.
The same flow is available to the agent through the linear_configure_auth tool. That tool returns only metadata such as stored: true; it never returns the key.
If a normal linear_* request fails because the key is missing, invalid, or expired, the extension retries once after prompting you for a fresh key.
For the current shell session:
export LINEAR_API_KEY="lin_api_xxx"To persist it, add that export to your shell profile (~/.zshrc, ~/.bashrc, etc.) or your preferred secrets manager.
Create or update ~/.pi/agent/auth.json:
{
"linear": {
"key": "lin_api_xxx"
}
}Recommended file permissions:
mkdir -p ~/.pi/agent
chmod 700 ~/.pi/agent
chmod 600 ~/.pi/agent/auth.jsonIf the file already contains other credentials, merge the linear.key entry instead of overwriting the file.
- Open Linear.
- Go to Settings → Account → Security & Access.
- Under Personal API keys, click Create key.
- Name it something recognizable, for example
pi-agent. - Choose the minimum access level needed for your workflow.
- If your workspace supports team restrictions, restrict the key to only the teams pi needs.
- Copy the key once and store it via
LINEAR_API_KEYor~/.pi/agent/auth.json.
Use the least privilege that supports the tools you need:
- Read is enough for read-only tools such as
linear_workspace_metadata,linear_search_issues,linear_get_issue, list tools, and document/comment reads. - Write is required for mutation tools:
linear_create_issue,linear_update_issue,linear_create_comment,linear_upload_file, andlinear_upload_file_to_issue_comment. - Admin is not required for this extension's tools.
If you restrict the key to specific teams, the key must include the teams/projects/issues you want to query or mutate.
Linear API keys are sent in the Authorization header as the raw key value; do not prefix them with Bearer.
- Use
linear_workspace_metadatafirst when team/project/state/label/user IDs are unknown. linear_create_issueaccepts either a team UUID or a team key; keys are resolved to UUIDs before the Linear mutation.- Use
linear_search_issuesfor keyword lookup. - Use
linear_get_issuebefore updating an issue or creating a comment. linear_get_issueautomatically parses Markdown images embedded in the issue description. When the active model supports image input, privateuploads.linear.appimages are downloaded in memory with Linear auth and attached to the tool result; images are not written to disk.- If the active model does not support image input,
linear_get_issuedoes not download images and returns a clear skipped-images note plus image metadata. - Use
linear_list_issuesfor filtered issue lists by team, assignee, status, and limit. - Use
linear_upload_fileto upload a local image, video, or generic file and return a Linear asset URL. - Use
linear_upload_file_to_issue_commentafterlinear_get_issueto upload a local file and post a Markdown comment. Images are rendered with image Markdown; other files use links. - File upload tool results return sanitized metadata and the stable Linear asset URL. They do not return local file bytes, signed upload URLs, or upload headers.
Linear issue screenshots embedded in descriptions are stored as Markdown image links, for example:
These are part of the issue description Markdown, not GraphQL attachment objects. linear_get_issue reads them automatically when possible:
- Vision-capable model: images are streamed into memory, base64-encoded, and returned as native image blocks alongside the Markdown description.
- Text-only model: image downloads are skipped to avoid unnecessary network and payload work; the response includes a note explaining that a vision-capable model is required.
- No files are saved locally by default.
- The default safety limits are 10 description images and 10 MiB per image.
Set LINEAR_API_KEY or add .linear.key to ~/.pi/agent/auth.json.
Confirm the key has the right access level:
- Read-only workflows need Read.
- Create/update/comment workflows need Write.
- Team-restricted keys must include the relevant team.
By default, the extension uses https://api.linear.app/graphql. Override it with:
export LINEAR_GRAPHQL_URL="https://api.linear.app/graphql"