This creates a linear ticket in your Linear.io project. (I have hard coded the project to FEF)
npm install
- Create a Linear API key on https://linear.app/***COMPANY_NAME***/settings/api
- Scroll down to the
Personal API keys
section - Click
Create key
- Once created, use that new key to set your environment variable
CBH_LINEAR_API_KEY
- Note - the key is only visible when created.
- Scroll down to the
npm run build
ornpm run build:watch
Once built
npm start
ornode dist/main.js
- Pick your
Team Name
. This becomes the Linear team - Enter
Title
. This becomes the ticket title - Enter
Subject
in your preferred editor (defaultvim
)
- Pick your
- Wait a few seconds.
Observe that there is a new ticket in Linear
Observe the output like:
? Title Test from node - jaz
? Summary
? Changes
Creating ticket...
fix(FEF-471): Test from node - jaz
Summary
===
My test
Ticket:
https://linear.app/.../FEF-471...
Changes
===
You can run this build using an alias like:
alias linear-create-ticket='node ~/code/linear-creator/dist/main.js'
linear-create-ticket
This package uses the node recommended package @inquirer/prompts
I tested with EDITOR=code node dist/main.js
, which does open the file in vscode.
The problem with this is that vscode
immediately returns, and prompt assumes that you are done
editing.
There may be configurations that will help with this, so I recommend looking at the fine manual.
See https://github.com/SBoudrias/Inquirer.js?tab=readme-ov-file#editor