Skip to content

tekaratzas/lit-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lit - Manage your Linear tickets without ever leaving your Git workflow.

npm version npm downloads GitHub Repo stars License

Perfect for the engineers who love building, but hate having to track everything.

Feels like you are just using git, but you are also keeping those Linear issues nice and tidy!

This CLI runs 100% locally. Configure your Linear API key once and you're ready to go!

Lit Checkout - Create Linear Issue and Git branch in one command

lit-checkout-trimmed.mov

Lit Switch - Search Linear Issues + switch to correct branch in one command

lit-switch-demo.mov

Features

In this version 0.1, only three commands are supported

1. A command to switch branches via description of the Linear Issue.

lit switch "description of issue"
  • Runs a search through Linear for issues matching the description
  • If multiple hits, will ask to disambiguate
  • Assigns issue to you, marks as in progress
  • git checkout the branch name (creaets it if it doesn't exist)

2. A command to commit changes and leave a comment on the ticket.

lit commit "commit message/issue comment"
  • Figures out correct issue based on branch
  • leaves a comment on the issue
  • git commit -m

3. A command to create a new Issue and branch at the same time.

lit checkout "Issue Title" -d "Description of Issue" -t f
  • Parses arguments: title, description (optional), issye type [bug, feature, improvement] (optional)
  • Creates new Linear Issue
  • Generates the Linear automation friendly branch name (exactly how Linear does it in the UI)
  • Does git checkout -b LinearbranchName

Getting Started

Quick Setup (3 steps)

1. Install

Install globally via npm:

npm install -g linear-lit-cli

2. Get your Linear API Key

Visit linear.app/settings/account/security and create a personal API key.

3. Configure (Recommended)

Save your API key permanently with one command:

lit config set linear-api-key <your_key>

Your key is stored securely at ~/.config/lit-cli/config.json and you'll never need to set it again!

Done! Now you can use lit from anywhere. 🎉


Development Setup

Want to contribute or run from source?

git clone https://github.com/tekaratzas/lit-cli.git
cd lit-cli
npm install
npm run install-global

Other Ways to Configure (Optional)

Already using environment variables? No problem! While lit config set is the easiest method, you can also:

Environment Variable:

export LINEAR_API_KEY=<your_key>

Add to ~/.zshrc or ~/.bashrc for persistence.

Interactive Prompt:
If no API key is found, lit will prompt you when you run a command (useful for quick testing).

Note: Priority order is: Environment variable → Config file → Interactive prompt

Config Management

# Set your API key (recommended)
lit config set linear-api-key <your_key>

# View your config (API key is masked for security)
lit config list

# Get a specific value
lit config get linear-api-key

Config is stored at: ~/.config/lit-cli/config.json


Usage

Once configured, you can use these commands:

# Create a new Linear issue and checkout a branch
lit checkout "Fix login bug" -d "Users can't login" -t bug

# Switch to an existing issue's branch
lit switch "login bug"

# Commit and comment on the current issue
lit commit "Fixed authentication logic"

# Manage configuration
lit config set linear-api-key <your_key>
lit config list

Command Reference

lit checkout <title> [options] (alias: co)

  • -d, --description <text> - Issue description
  • -t, --type <type> - Issue type: b/bug, f/feature, i/improvement

lit switch <description> (alias: sw)

  • Searches Linear for matching issues
  • Prompts to select if multiple matches found

lit commit <message> (alias: cm)

  • Commits with message and posts comment to Linear issue

lit config <command>

  • set <key> <value> - Set a config value
  • get <key> - Get a config value
  • list - Show all config values

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE file for details.

About

The CLI for people who love to build, and hate to track

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors