1
0
Fork
You've already forked linear-ai-analysis
0
An example of using local AI to analyze Linear task information
  • Python 96.5%
  • Makefile 3.5%
2026年04月01日 12:35:15 -04:00
.env.example Add project files 2026年04月01日 12:35:15 -04:00
.gitignore Add project files 2026年04月01日 12:35:15 -04:00
main.py Add project files 2026年04月01日 12:35:15 -04:00
Makefile Add project files 2026年04月01日 12:35:15 -04:00
poetry.lock Add project files 2026年04月01日 12:35:15 -04:00
pyproject.toml Add project files 2026年04月01日 12:35:15 -04:00
README.md Add project files 2026年04月01日 12:35:15 -04:00
requirements.txt Add project files 2026年04月01日 12:35:15 -04:00
test_summarizer.py Add project files 2026年04月01日 12:35:15 -04:00

Linear Project Summarizer (Ollama via OpenAI API)

This CLI fetches Linear projects, filters by lead, and generates one-paragraph summaries using a local Ollama model through an OpenAI-compatible API.

Requirements

  • Python 3.10+
  • Linear API key
  • Ollama installed and running

Install Ollama

Download/Install

Run

In a new terminal/tab:

ollama serve

Choose and Pull an LLM Model

Pick a model based on available RAM (rough guidance):

  • 8 GB RAM: llama3.2:3b, qwen2.5:3b
  • 16 GB RAM: llama3.1:8b, mistral:7b
  • 32 GB RAM: gpt-oss:20b, llama3.1:70b (or other larger 30B+ models)

Pull a model:

ollama pull llama3.1:8b

Python Setup

poetry install

Configuration

Set environment variables in .env:

LINEAR_API_KEY=your_linear_api_key
LEAD_IDENTIFIER=pwillis # Linear identifier
OPENAI_MODEL=llama3.1:8b # The model you pulled
OPENAI_BASE_URL=http://localhost:11434/v1 # Your Ollama instance
OPENAI_API_KEY=ollama # Can be anything for Ollama

If the configured model does not exist in Ollama, the app exits with an error.

Prompt Overrides (System + User)

You can override the LLM prompt with a custom file, to shape the output to your choosing.

  • Auto-detected files in current directory:

    • system_prompt.txt - The system prompt is injected before every user prompt
    • user_prompt.txt - Instructions for a specific use case
  • Or pass explicit paths:

    • --system-prompt-file path/to/system_prompt.txt
    • --user-prompt-file path/to/user_prompt.txt

Prompt files support macros/variables in {{macro_name}} format. Available macros:

  • {{project_name}}
  • {{project_status}}
  • {{project_description}}
  • {{task_count}}
  • {{tasks_block}}
  • {{lead_id}}
  • {{lead_name}}
  • {{lead_display_name}}
  • {{lead_email}}

Example user_prompt.txt:

Summarize project {{project_name}} (status: {{project_status}}).
Lead: {{lead_display_name}} <{{lead_email}}>
Tasks ({{task_count}}):
{{tasks_block}}
Focus on blockers and immediate next steps.

Run

Uses .env defaults:

poetry run python main.py

Override with new values:

poetry run python main.py \
 --lead "pwillis@email.example" \
 --model "llama3.1:8b" \
 --user-prompt-file "./my_user_prompt.txt" \
 --system-prompt-file "./my_system_prompt.txt"

Makefile

make install
make test
make run LEAD="pwillis"

Tests

poetry run python -m unittest -q