| name | linear-hello-world |
| description | Create your first Linear issue and query using the SDK and GraphQL API.
Use when making initial API calls, testing connection,
or learning basic Linear CRUD operations.
Trigger: "linear hello world", "first linear issue",
"create linear issue", "linear API example", "test linear".
|
| allowed-tools | Read, Write, Edit, Bash(npx:*), Grep |
| version | 1.12.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","linear","api","graphql","testing"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Linear Hello World
Overview
Create your first issue, query teams, and explore the Linear data model using the @linear/sdk. Linear's API is GraphQL-based -- the SDK wraps it with typed models, lazy-loaded relations, and pagination helpers.
Prerequisites
@linear/sdk installed (npm install @linear/sdk)
LINEAR_API_KEY environment variable set (starts with lin_api_)
- Access to at least one Linear team
Instructions
Step 1: Connect and Identify
import { LinearClient } from "@linear/sdk";
const client = new LinearClient({ apiKey: process.env.LINEAR_API_KEY! });
const me = await client.viewer;
console.log(`Hello, ${me.name}! (${me.email})`);
const org = await me.organization;
console.log(`Workspace: ${org.name}`);
Step 2: List Teams
Every issue in Linear belongs to a team. Teams have a short key (e.g., "ENG") used in identifiers like ENG-123.
const teams = await client.teams();
console.log("Your teams:");
for ( team teams.) {
.();
}