Skip to content

dotMavriQ/linea

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linea

A command-line tool that connects Linear issues with Gemini AI. Fetch a ticket, get analysis, and work through resolution steps in a guided chat interface.

Features

  • Issue Analysis - Fetch any Linear issue and get AI-powered analysis with resolution steps
  • Parent/Child Context - Automatically includes parent issue context for sub-issues
  • Web Research - Searches for relevant knowledge to help resolve issues
  • Status Management - Change issue status directly from the CLI
  • Assignee Browser - Browse and filter issues by team member
  • Guided Workflow - AI asks clarifying questions to help you resolve tickets faster

image

Requirements

  • Lua 5.1 or higher
  • curl

Optional (for better terminal experience)

  • lua-linenoise - For tab completion and arrow key support
  • Or use rlwrap lua linea.lua as an alternative

Installation

git clone https://github.com/dotMavriQ/linea
cd linea

On Linux/Mac, make it executable:

chmod +x linea.lua

Getting API Keys

Gemini API Key

  1. Go to https://aistudio.google.com/app/apikey
  2. Click "Create API Key"
  3. Copy the key

Linear API Key

  1. Go to https://linear.app/settings/api
  2. Click "Create key"
  3. Give it a name (e.g., "Linea CLI")
  4. Copy the key

First Run

Start Linea:

lua linea.lua

On first run, you will be prompted to enter your API keys:

Enter your gemini API key: <paste your Gemini key>
Enter your linear API key: <paste your Linear key>

Keys are saved to ~/.config/linea/config (Linux/Mac) or ~/.linea/config as fallback.

Usage

Workflow

  1. Load an issue - Type an issue ID like MAR-870
  2. Get analysis - Linea fetches the issue, searches for relevant info, and suggests resolution steps
  3. Work through it - Ask questions, get guidance, implement the fix
  4. Update status - Use chstatus to mark it done
  5. Move on - Type moveon to clear context and start a new ticket

Commands

Command Action
help Show help
clear Clear screen and reset context
moveon Wipe context and start fresh with a new ticket
chstatus Change issue status (interactive picker)
assignee Browse issues by team member and status
exit Quit

Examples

MAR-870                     Load and analyze an issue
What's blocking this?       Ask about the current issue
How do I implement this?    Get step-by-step guidance
chstatus                    Pick a new status from menu
moveon                      Clear and start fresh
assignee                    Browse issues by person

Changing Issue Status

Type chstatus to see available statuses and pick one:

  Change status for MAR-870:

    1) Backlog
    2) Todo
    3) In Progress  ← current
    4) In Review
    5) Done
    6) Canceled

  Select (1-6) or Enter to cancel: 5

  ✓ Status updated to: Done

Browsing by Assignee

Type assignee to find issues for a specific team member:

  Search assignee: john

  ✓ Found: John Smith

  Status filter (or Enter for all): in progress

  ✓ Found 3 issue(s):

    1) MAR-870: Implement Logo Strip
       [In Progress] [2 sub-issues]

    2) MAR-892: Fix responsive layout
       [In Progress] (sub of MAR-870)

  Select issue to focus (1-2) or Enter to skip: 1

Configuration

Config file location:

  • Linux/Mac: ~/.config/linea/config or ~/.linea/config
  • Windows: %USERPROFILE%\.linea\config

Format:

[gemini]
api_key=your_gemini_key

[linear]
api_key=your_linear_key

To reset your keys, delete the config file and run Linea again.

Better Terminal Experience

For arrow key navigation and tab completion, either:

Option A - Install lua-linenoise:

luarocks install linenoise

Option B - Use rlwrap:

# Install rlwrap
sudo apt install rlwrap  # Debian/Ubuntu
brew install rlwrap      # Mac

# Run with rlwrap
rlwrap lua linea.lua

Troubleshooting

"curl not found"

Install curl:

  • Ubuntu/Debian: sudo apt install curl
  • Mac: brew install curl
  • Windows: Use WSL or install curl from https://curl.se

"API key validation failed"

  • Check that you copied the full key
  • Gemini: Ensure the key is from AI Studio, not Google Cloud
  • Linear: Ensure the key has read access to issues

"Could not find issue"

  • Check the issue ID format (e.g., MAR-870, VET6-1617)
  • Verify you have access to that team in Linear

Arrow keys showing weird characters

Your terminal doesn't have readline support. Use rlwrap lua linea.lua or install lua-linenoise.

Project Structure

linea/
  linea.lua           Main entry point
  src/
    chat.lua          Chat interface and command handling
    config.lua        Configuration management
    input.lua         Readline/input handling
    tui.lua           Terminal UI formatting
    utils.lua         Utilities, JSON parser, web search
    api/
      gemini.lua      Gemini API client
      linear.lua      Linear GraphQL client

License

MIT

About

CLI tool connecting Linear issues with Gemini AI

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages