llmify

0.0.16 • Public • Published

🚀 LLMify

A collection of tools that optimize your codebase for LLMs and agents

npm version MIT License PRs Welcome

LLMify is made for LLMs by LLMs - a suite of powerful tools that transform your codebase into the perfect context for AI agents. Get started with a single command: npx llmify

✨ Features

  • 📊 Visual Project Structure - Creates a tree view of your codebase
  • 📄 Smart Content Extraction - Pulls content from all relevant files
  • 🧠 Context Optimization - Formats output specifically for LLMs
  • 🔍 Intelligent Filtering - Respects .gitignore and auto-creates .llmignore
  • 🛠️ Highly Customizable - Control depth, paths, and patterns
  • 💬 AI-Powered Commit Messages - Generate detailed commit messages using LLMs
  • 📝 Documentation Updates - Automatically update docs based on code changes
  • 🔄 Code Refactoring - Refactor TypeScript code using LLMs based on custom prompts

🔥 Why LLMify?

Getting the right context to an LLM is critical for quality results. LLMify solves this by:

  • Saving Time - No more manual file copying or writing commit messages
  • Improving Responses - Gives LLMs better structural understanding of your codebase
  • Reducing Token Usage - Smart filtering excludes irrelevant files
  • Working Everywhere - Supports all major platforms
  • Better Commits - Generate clear, conventional commit messages
  • Up-to-Date Docs - Keep documentation in sync with code changes
  • Efficient Refactoring - Automate code refactoring with precision and control

📦 Installation

NPM (Recommended)

npm install -g llmify

Direct Download

Grab the latest release for your platform.

🚀 Quick Start

Generate context for your current directory:

# Creates llm.txt in current directory
llmify

# Paste into your favorite LLM
cat llm.txt | pbcopy  # macOS
cat llm.txt | xclip   # Linux
type llm.txt | clip   # Windows

Generate a commit message for staged changes:

# Stage your changes
git add .

# Generate and edit commit message
llmify commit

# Force commit without confirmation
llmify commit -f

# Update docs and commit
llmify commit --docs

👩‍💻 Usage Examples

Context Generation

# Specify a different project
llmify /path/to/project

# Only include a specific subdirectory
llmify -p src/components

# Custom output file 
llmify -o context_for_llm.txt

# Limit directory depth for large projects
llmify -d 3 

# Exclude specific files
llmify -e "*.test.js" -e "**/__mocks__/*"

# Include files that would otherwise be excluded
llmify -i "important-config.json"

# See what's happening (helpful for debugging)
llmify -v

Commit Message Generation

# Generate commit message with default settings
llmify commit

# Skip confirmation prompt
llmify commit -f

# Update docs and commit
llmify commit --docs

# Disable editing commit message
llmify commit --no-edit

# Verbose output
llmify commit -v

# Set LLM timeout (in seconds)
llmify commit --llm-timeout 60

Documentation Update

# Analyze staged changes for documentation updates
llmify docs

# Analyze the last 5 commits
llmify docs --commits 5

# Interactively select specific commits to analyze
llmify docs --interactive

# Specify a path to focus on
llmify docs --path src/

# Dry run without applying changes
llmify docs --dry-run

# Apply changes without confirmation
llmify docs --force

# Do not stage updated documentation files
llmify docs --no-stage

# Use a custom prompt for LLM
llmify docs --prompt "Focus on API changes."

Code Refactoring

# Refactor a specific file or directory
llmify refactor src/app.ts

# Provide a custom refactoring prompt
llmify refactor src/app.ts --prompt "Simplify arrow functions"

# Skip type checking
llmify refactor src/app.ts --no-check-types

# Display the proposed diff before applying changes
llmify refactor src/app.ts --show-diff

# Directly apply changes without confirmation
llmify refactor src/app.ts --apply --force

# Execute a dry run, showing proposed changes without applying them
llmify refactor src/app.ts --dry-run

⚙️ Configuration

LLMify can be configured via a .llmifyrc.yaml file in your project root or ~/.config/llmify/config.yaml:

# LLM Configuration
llm:
  # The LLM provider to use (e.g., "openai", "anthropic", "ollama")
  provider: "openai"
  
  # The default model to use for general tasks
  model: "gpt-4o"
  
  # Provider-specific settings
  ollama_base_url: "http://localhost:11434"  # Only used for Ollama provider

# Commit-specific settings
commit:
  # Optional: Override the default model for commit message generation
  model: "gpt-4o"

# Documentation update settings
docs:
  # Optional: Override the default model for documentation updates
  model: "gpt-4o"

Environment variables can also be used:

  • LLMIFY_LLM_PROVIDER - Set the LLM provider
  • LLMIFY_LLM_MODEL - Set the default model
  • OPENAI_API_KEY - OpenAI API key
  • ANTHROPIC_API_KEY - Anthropic API key

🔧 .llmignore - Control What's Included

LLMify automatically creates a .llmignore file with sensible defaults. Customize it to exclude any files irrelevant to your LLM conversations:

# Example .llmignore
*.min.js
*.csv
node_modules/
dist/
coverage/

🎯 Example Output

The generated file has a clean, LLM-friendly structure:

Click to see example output
============================================================
Project Root: /path/to/your/project
Generated At: 2023-06-15T10:30:45Z
============================================================

## File Tree Structure

yourproject/ ├── .gitignore ├── main.go ├── utils.go └── docs/ ├── README.md └── usage.md


============================================================

## File Contents

### File: .gitignore

node_modules/ *.log dist/


---

### File: main.go

```go
package main

import (
    "fmt"
)

func main() {
    fmt.Println("Hello, world!")
}
</details>

## 💡 Pro Tips

- Include a `.llmignore` in your project templates
- Use with `--path` to focus on specific parts of your codebase
- Combine with project-specific prompts for best results
- For very large codebases, use `-d` to limit directory depth
- Use `llmify commit --docs` to keep documentation in sync
- Configure different models for different tasks in `.llmifyrc.yaml`

## 🤝 Contributing

Contributions are welcome! Feel free to:
- Report bugs
- Suggest features
- Submit pull requests

## 📝 License

[MIT](https://github.com/jakezegil/llmify/blob/main/LICENSE) © Jake Zegil

---

<p align="center">
  Made with ❤️ for better LLM interactions
  <br>
  <a href="https://github.com/jakezegil/llmify">Star on GitHub</a> •
  <a href="https://www.npmjs.com/package/llmify">View on npm</a>
</p>

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.1648latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.1648
0.0.1553
0.0.1256
0.0.1180
0.0.865
0.0.623
0.0.58
0.0.48
0.0.38
0.0.28

Package Sidebar

Install

npm i llmify

Weekly Downloads

357

Version

0.0.16

License

MIT

Unpacked Size

44.7 MB

Total Files

8

Last publish

Collaborators

  • jakezegil