cli tool for linear.app that uses git branch names and directory names to open issues and team pages. offers handy commands:
linear issue
open the issue in linear.app, based on the current git branchlinear issue print
print it to stdoutlinear issue pr
create a nicely named pull request with ghlinear team
view active issues assigned to you in the team
see the full list of commands below.
todo
deno install --allow-env --allow-sys --allow-run --allow-read --allow-net -g -n linear jsr:@schpet/linear-cli
git clone https://github.com/schpet/linear-cli
cd linear-cli
deno task install
this cli needs three things to work:
- a linear api key, found at https://linear.app/settings/api
- your current git branch to start with a linear issue id, e.g.
eng-123-my-feature
- the directory of your repo to start with a linear team id, e.g.
eng-my-project
LINEAR_API_KEY="lin_api_..." # create an api key at https://linear.app/settings/api
LINEAR_WORKSPACE="your-company" # your linear.app workspace url slug
bash
add to ~/.bashrc:
export LINEAR_API_KEY="lin_api_..."
export LINEAR_WORKSPACE="your-company"
zsh
add to ~/.zshrc:
export LINEAR_API_KEY="lin_api_..."
export LINEAR_WORKSPACE="your-company"
fish
run in terminal:
set -Ux LINEAR_API_KEY "lin_api_..."
set -Ux LINEAR_WORKSPACE "your-company"
the current issue is determined by the issue id in the current git branch name. note that linear's github integration will suggest these branch names.
linear issue # opens current branch's issue in Linear.app
linear issue open # same as above
linear issue print # prints issue title and description (with markdown formatting)
linear issue id # prints the issue id from current branch (e.g., "ENG-123")
linear issue title # prints just the issue title
linear issue url # prints the Linear.app URL for the issue
linear issue pr # creates a GitHub PR with issue details via `gh pr create`
name your repo directories with your project's linear team prefix for these to
work. i.e. if your linear team prefix is 'ENG'
mv ~/code/cool-project ~/code/eng-cool-project
linear team # opens team page in Linear.app
linear team open # same as above
linear team id # prints the team id (e.g., "ENG")
linear team autolinks # configures GitHub repository autolinks for Linear issues
linear --help # show all commands
linear --version # show version
linear completions # generate shell completions