productivity
Linear CLI for AI Agents
Use the Linear CLI from KosmoKrator to call Linear tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.Linear CLI Setup
Linear can be configured headlessly with `kosmokrator integrations:configure linear`.
# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash
# Configure and verify this integration.
kosmokrator integrations:configure linear --set api_key="$LINEAR_API_KEY" --enable --read allow --write ask --json
kosmokrator integrations:doctor linear --json
kosmokrator integrations:status --json Credentials
Authentication type: API key api_key. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
api_key | LINEAR_API_KEY | Secret secret | yes | API Key |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call linear.linear_create_issue '{"team_id":"example_team_id","title":"example_title","description":"example_description","priority":1,"assignee_id":"example_assignee_id","label_ids":"example_label_ids","state_id":"example_state_id"}' --json kosmo integrations:linear linear_create_issue '{"team_id":"example_team_id","title":"example_title","description":"example_description","priority":1,"assignee_id":"example_assignee_id","label_ids":"example_label_ids","state_id":"example_state_id"}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs linear --json
kosmo integrations:docs linear.linear_create_issue --json
kosmo integrations:schema linear.linear_create_issue --json
kosmo integrations:search "Linear" --json
kosmo integrations:list --json Automation Contexts
The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.
CLI Functions
Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.
linear.linear_create_issue
Create a new issue in Linear. Requires a team ID and title. Optionally set description, priority (0=none, 1=urgent, 2=high, 3=medium, 4=low), assignee, labels, and initial state. Use linear_get_teams to find team IDs.
write - Parameters
- team_id, title, description, priority, assignee_id, label_ids, state_id
kosmo integrations:call linear.linear_create_issue '{"team_id":"example_team_id","title":"example_title","description":"example_description","priority":1,"assignee_id":"example_assignee_id","label_ids":"example_label_ids","state_id":"example_state_id"}' --json kosmo integrations:linear linear_create_issue '{"team_id":"example_team_id","title":"example_title","description":"example_description","priority":1,"assignee_id":"example_assignee_id","label_ids":"example_label_ids","state_id":"example_state_id"}' --json linear.linear_get_issue
Get a single Linear issue by ID or identifier (e.g., "TEAM-123"). Returns full details including description, state, assignee, labels, team info, and comments.
read - Parameters
- id
kosmo integrations:call linear.linear_get_issue '{"id":"example_id"}' --json kosmo integrations:linear linear_get_issue '{"id":"example_id"}' --json linear.linear_update_issue
Update an existing Linear issue. Provide the issue ID or identifier and any fields to change. Only specified fields will be updated. Priority: 0=none, 1=urgent, 2=high, 3=medium, 4=low.
write - Parameters
- id, title, description, priority, assignee_id, state_id, label_ids
kosmo integrations:call linear.linear_update_issue '{"id":"example_id","title":"example_title","description":"example_description","priority":1,"assignee_id":"example_assignee_id","state_id":"example_state_id","label_ids":"example_label_ids"}' --json kosmo integrations:linear linear_update_issue '{"id":"example_id","title":"example_title","description":"example_description","priority":1,"assignee_id":"example_assignee_id","state_id":"example_state_id","label_ids":"example_label_ids"}' --json linear.linear_search_issues
Search Linear issues using filter criteria. Supports filtering by text query, team, state name, assignee, and priority. Returns matching issues with pagination info.
read - Parameters
- query, team_id, state, assignee_id, priority, limit
kosmo integrations:call linear.linear_search_issues '{"query":"example_query","team_id":"example_team_id","state":"example_state","assignee_id":"example_assignee_id","priority":1,"limit":1}' --json kosmo integrations:linear linear_search_issues '{"query":"example_query","team_id":"example_team_id","state":"example_state","assignee_id":"example_assignee_id","priority":1,"limit":1}' --json linear.linear_list_issues
List issues for a specific Linear team. Supports filtering by status, assignee, and cursor-based pagination. Use linear_get_teams to find team IDs.
read - Parameters
- team_id, status, assignee_id, limit, after
kosmo integrations:call linear.linear_list_issues '{"team_id":"example_team_id","status":"example_status","assignee_id":"example_assignee_id","limit":1,"after":"example_after"}' --json kosmo integrations:linear linear_list_issues '{"team_id":"example_team_id","status":"example_status","assignee_id":"example_assignee_id","limit":1,"after":"example_after"}' --json linear.linear_delete_issue
Delete a Linear issue by ID or identifier. This action is irreversible.
write - Parameters
- id
kosmo integrations:call linear.linear_delete_issue '{"id":"example_id"}' --json kosmo integrations:linear linear_delete_issue '{"id":"example_id"}' --json linear.linear_create_comment
Add a comment to a Linear issue. Supports markdown formatting. Provide the issue ID or identifier and the comment body.
write - Parameters
- issue_id, body
kosmo integrations:call linear.linear_create_comment '{"issue_id":"example_issue_id","body":"example_body"}' --json kosmo integrations:linear linear_create_comment '{"issue_id":"example_issue_id","body":"example_body"}' --json linear.linear_list_comments
List all comments on a Linear issue, ordered chronologically. Provide the issue ID or identifier.
read - Parameters
- issue_id
kosmo integrations:call linear.linear_list_comments '{"issue_id":"example_issue_id"}' --json kosmo integrations:linear linear_list_comments '{"issue_id":"example_issue_id"}' --json linear.linear_get_teams
Get all Linear teams the authenticated user has access to, including team name, key, description, and member list. Use this to discover team IDs needed for other tools.
read - Parameters
- none
kosmo integrations:call linear.linear_get_teams '{}' --json kosmo integrations:linear linear_get_teams '{}' --json linear.linear_list_projects
List Linear projects with optional cursor-based pagination. Returns project details including state, dates, lead, and associated teams.
read - Parameters
- limit, after
kosmo integrations:call linear.linear_list_projects '{"limit":1,"after":"example_after"}' --json kosmo integrations:linear linear_list_projects '{"limit":1,"after":"example_after"}' --json linear.linear_create_project
Create a new Linear project. Requires a name and at least one team ID. Optionally set description, lead, and target dates. Use linear_get_teams to find team IDs.
write - Parameters
- name, description, team_ids, lead_id
kosmo integrations:call linear.linear_create_project '{"name":"example_name","description":"example_description","team_ids":"example_team_ids","lead_id":"example_lead_id"}' --json kosmo integrations:linear linear_create_project '{"name":"example_name","description":"example_description","team_ids":"example_team_ids","lead_id":"example_lead_id"}' --json linear.linear_update_project
Update a Linear project. Provide the project ID and any fields to change. Only specified fields will be updated.
write - Parameters
- id, name, description, state
kosmo integrations:call linear.linear_update_project '{"id":"example_id","name":"example_name","description":"example_description","state":"example_state"}' --json kosmo integrations:linear linear_update_project '{"id":"example_id","name":"example_name","description":"example_description","state":"example_state"}' --json linear.linear_list_initiatives
List Linear initiatives with optional limit. Returns initiative details including state, dates, and associated projects.
read - Parameters
- limit
kosmo integrations:call linear.linear_list_initiatives '{"limit":1}' --json kosmo integrations:linear linear_list_initiatives '{"limit":1}' --json linear.linear_create_initiative
Create a new Linear initiative. Initiatives group related projects together. Requires a name. Optionally include a description.
write - Parameters
- name, description
kosmo integrations:call linear.linear_create_initiative '{"name":"example_name","description":"example_description"}' --json kosmo integrations:linear linear_create_initiative '{"name":"example_name","description":"example_description"}' --json linear.linear_list_labels
List issue labels in Linear. Optionally filter by team. Returns label ID, name, color, and description.
read - Parameters
- team_id
kosmo integrations:call linear.linear_list_labels '{"team_id":"example_team_id"}' --json kosmo integrations:linear linear_list_labels '{"team_id":"example_team_id"}' --json linear.linear_add_label
Add a label to a Linear issue. Provide the issue ID or identifier and the label ID to add. The label will be appended to existing labels. Use linear_list_labels to find label IDs.
write - Parameters
- issue_id, label_id
kosmo integrations:call linear.linear_add_label '{"issue_id":"example_issue_id","label_id":"example_label_id"}' --json kosmo integrations:linear linear_add_label '{"issue_id":"example_issue_id","label_id":"example_label_id"}' --json linear.linear_remove_label
Remove a label from a Linear issue. Provide the issue ID or identifier and the label ID to remove. Other labels on the issue are preserved.
write - Parameters
- issue_id, label_id
kosmo integrations:call linear.linear_remove_label '{"issue_id":"example_issue_id","label_id":"example_label_id"}' --json kosmo integrations:linear linear_remove_label '{"issue_id":"example_issue_id","label_id":"example_label_id"}' --json linear.linear_get_current_user
Get the currently authenticated Linear user's profile, including ID, name, email, and avatar URL.
read - Parameters
- none
kosmo integrations:call linear.linear_get_current_user '{}' --json kosmo integrations:linear linear_get_current_user '{}' --json linear.linear_list_workflows
List workflow states for a Linear team. Shows all available statuses (e.g., Backlog, Todo, In Progress, Done) with their IDs, types, and colors. Optionally filter by team ID.
read - Parameters
- team_id
kosmo integrations:call linear.linear_list_workflows '{"team_id":"example_team_id"}' --json kosmo integrations:linear linear_list_workflows '{"team_id":"example_team_id"}' --json linear.linear_raw_query
Execute an arbitrary GraphQL query or mutation against the Linear API. Provide a GraphQL document and optional variables as JSON. Use this for advanced operations not covered by other tools.
read - Parameters
- query, variables
kosmo integrations:call linear.linear_raw_query '{"query":"example_query","variables":"example_variables"}' --json kosmo integrations:linear linear_raw_query '{"query":"example_query","variables":"example_variables"}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
linear.linear_create_issue 7 parameters
kosmo integrations:schema linear.linear_create_issue --json | Parameter | Type | Required | Description |
|---|---|---|---|
team_id | string | yes | Team ID to create the issue in. |
title | string | yes | Issue title. |
description | string | no | Issue description (markdown supported). |
priority | integer | no | Priority: 0=none, 1=urgent, 2=high, 3=medium, 4=low. |
assignee_id | string | no | User ID to assign the issue to. |
label_ids | string | no | Comma-separated label IDs to apply. |
state_id | string | no | Workflow state ID for the initial status. |
linear.linear_get_issue 1 parameters
kosmo integrations:schema linear.linear_get_issue --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | Issue ID or identifier (e.g., "TEAM-123"). |
linear.linear_update_issue 7 parameters
kosmo integrations:schema linear.linear_update_issue --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | Issue ID or identifier to update. |
title | string | no | New title. |
description | string | no | New description (markdown). |
priority | integer | no | Priority: 0=none, 1=urgent, 2=high, 3=medium, 4=low. |
assignee_id | string | no | User ID to assign. |
state_id | string | no | Workflow state ID to set. |
label_ids | string | no | Comma-separated label IDs to set (replaces existing labels). |
linear.linear_search_issues 6 parameters
kosmo integrations:schema linear.linear_search_issues --json | Parameter | Type | Required | Description |
|---|---|---|---|
query | string | no | Text to search in issue titles and descriptions. |
team_id | string | no | Filter by team ID. |
state | string | no | Filter by state name (e.g., "In Progress", "Done"). |
assignee_id | string | no | Filter by assignee user ID. |
priority | integer | no | Filter by priority: 0=none, 1=urgent, 2=high, 3=medium, 4=low. |
limit | integer | no | Max results to return. Default: 20. |
linear.linear_list_issues 5 parameters
kosmo integrations:schema linear.linear_list_issues --json | Parameter | Type | Required | Description |
|---|---|---|---|
team_id | string | yes | Team ID to list issues for. |
status | string | no | Filter by state name (e.g., "In Progress", "Backlog"). |
assignee_id | string | no | Filter by assignee user ID. |
limit | integer | no | Results per page. Default: 25. |
after | string | no | Cursor for next page (from previous response endCursor). |
linear.linear_delete_issue 1 parameters
kosmo integrations:schema linear.linear_delete_issue --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | Issue ID or identifier to delete (e.g., "TEAM-123"). |
linear.linear_create_comment 2 parameters
kosmo integrations:schema linear.linear_create_comment --json | Parameter | Type | Required | Description |
|---|---|---|---|
issue_id | string | yes | Issue ID or identifier to comment on. |
body | string | yes | Comment body text (markdown supported). |
linear.linear_list_comments 1 parameters
kosmo integrations:schema linear.linear_list_comments --json | Parameter | Type | Required | Description |
|---|---|---|---|
issue_id | string | yes | Issue ID or identifier to list comments for. |
linear.linear_get_teams 0 parameters
kosmo integrations:schema linear.linear_get_teams --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
linear.linear_list_projects 2 parameters
kosmo integrations:schema linear.linear_list_projects --json | Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Results per page. Default: 25. |
after | string | no | Cursor for next page (from previous response endCursor). |
linear.linear_create_project 4 parameters
kosmo integrations:schema linear.linear_create_project --json | Parameter | Type | Required | Description |
|---|---|---|---|
name | string | yes | Project name. |
description | string | no | Project description. |
team_ids | string | yes | Comma-separated team IDs to associate. |
lead_id | string | no | User ID of the project lead. |
linear.linear_update_project 4 parameters
kosmo integrations:schema linear.linear_update_project --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | Project ID to update. |
name | string | no | New project name. |
description | string | no | New description. |
state | string | no | New project state (e.g., "planned", "active", "paused", "completed", "canceled"). |
linear.linear_list_initiatives 1 parameters
kosmo integrations:schema linear.linear_list_initiatives --json | Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Max results to return. Default: 25. |
linear.linear_create_initiative 2 parameters
kosmo integrations:schema linear.linear_create_initiative --json | Parameter | Type | Required | Description |
|---|---|---|---|
name | string | yes | Initiative name. |
description | string | no | Initiative description. |
linear.linear_list_labels 1 parameters
kosmo integrations:schema linear.linear_list_labels --json | Parameter | Type | Required | Description |
|---|---|---|---|
team_id | string | no | Team ID to filter labels by. |
linear.linear_add_label 2 parameters
kosmo integrations:schema linear.linear_add_label --json | Parameter | Type | Required | Description |
|---|---|---|---|
issue_id | string | yes | Issue ID or identifier. |
label_id | string | yes | Label ID to add. |
linear.linear_remove_label 2 parameters
kosmo integrations:schema linear.linear_remove_label --json | Parameter | Type | Required | Description |
|---|---|---|---|
issue_id | string | yes | Issue ID or identifier. |
label_id | string | yes | Label ID to remove. |
linear.linear_get_current_user 0 parameters
kosmo integrations:schema linear.linear_get_current_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
linear.linear_list_workflows 1 parameters
kosmo integrations:schema linear.linear_list_workflows --json | Parameter | Type | Required | Description |
|---|---|---|---|
team_id | string | no | Team ID to filter workflow states by. |
linear.linear_raw_query 2 parameters
kosmo integrations:schema linear.linear_raw_query --json | Parameter | Type | Required | Description |
|---|---|---|---|
query | string | yes | GraphQL query or mutation document. |
variables | string | no | Variables as a JSON object string. |
Permissions
Headless calls still follow the integration read/write permission policy. Configure read/write defaults with
integrations:configure. Add --force only for trusted automation that should bypass that policy.