Exports Linear issues to PDF files using Playwright. Uses a persistent browser profile so you log in once; exports run headless.
-
Prerequisites: Node.js 18+.
-
Install dependencies:
npm install
-
Install Playwright browsers (first time only):
npx playwright install chromium
-
Log in to Linear (one-time; uses a local browser profile):
npm run login
A browser window opens at your Linear team. Sign in, then press
Ctrl+Cin the terminal when done. The session is saved for later exports.
Configuration is in export-issues.ts at the top — edit the config object:
| Option | Meaning |
|---|---|
team |
Linear workspace slug (e.g. ae-studio) |
prefix |
Issue key prefix (e.g. MOM) |
startNumber / endNumber |
Range of issue numbers to export (e.g. 1–197 → MOM-1 … MOM-197) |
outputDir |
Folder where PDFs are written (default: ./pdfs). Make sure to gitignore it |
userDataDir |
Browser profile path (default: ./linear-browser-profile) |
statePath |
File that tracks success/skip/error per issue (default: ./export-state.json) |
maxConsecutiveMissing |
Stop after this many issues in a row not found (default: 5) |
maxRetries |
Retries per issue on error (default: 3) |
Run the export:
npm run export- Already-exported issues (in state as success) are skipped.
- Missing issues are marked as skip; after
maxConsecutiveMissingskips in a row, the run stops. - Failed issues are marked as error and retried on the next run.
PDFs are saved as {prefix}-{number}.pdf in outputDir (e.g. pdfs/MOM-1.pdf).
To force a re-fetch, simple edit the ./export-state.json to either remove the row or change the status to "error", so it runs again when export is executed.