Skip to main content
Connectors

Linear

Mention an agent in a Linear issue comment.

LinearRoute/linear/webhookAgent Actorreceive, replywebhookreceive()createComment

Quickstart

Create an API key

Create a Linear user for the agent, or use your own, and a personal API key for it with read and create-comments access.

Add the route

npm add @rivet-dev/pi rivetkit hono @linear/sdk

Run the server with any runtime that serves a fetch handler, for example npx srvx --import tsx server.ts. See HTTP Server.

Set the environment

LINEAR_WEBHOOK_SECRET=lin_wh_...
LINEAR_API_KEY=lin_api_...
LINEAR_TRIGGER=@agent
ANTHROPIC_API_KEY=sk-ant-...

Add the webhook

In Linear’s Settings > Administration > API, which needs admin rights, create a webhook with the URL https://<your-worker>/linear/webhook and the Comments resource type. Copy its signing secret. Comment @agent on an issue.

How it works

  • The route verifies the Linear-Signature HMAC against the raw body and rejects deliveries older than a minute.
  • Each Linear issue gets its own agent. Every comment with the trigger continues the same session.
  • The route never answers the agent’s own comments, so replies do not loop.
  • The route only hands the comment to the agent’s receive action and returns. receive schedules reply, which prompts the agent and posts the answer as a comment with the Linear SDK. The schedule is saved with the agent, so the reply still runs if the request that delivered the message goes away.

Configure

VariablePurpose
LINEAR_WEBHOOK_SECRETRequired. Verifies that deliveries come from Linear.
LINEAR_API_KEYRequired. Posts replies as the agent’s Linear user.
LINEAR_TRIGGERText that makes a comment start a reply. Defaults to @agent.
ANTHROPIC_API_KEYRequired. The agent’s model key. See API Keys.

Supported events

Linear eventWebhook pathWhat the route does
Comment, create/linear/webhookHands the comment to the issue’s agent, which replies with a comment.