Skip to main content

Understand any codebase in minutes with local-first AI

Project description

GRID Analyzer

Understand any codebase in minutes with local-first AI

PyPI version Python Versions License: MIT

GRID Analyzer is a privacy-first command-line tool that uses local AI models to help you understand unfamiliar codebases. Index, query, and visualize relationships—all without sending your code to external APIs.

✨ Features

  • 🔒 Privacy-First: All analysis happens locally. Your code never leaves your machine.
  • 🚀 Fast Indexing: Analyze large codebases (100K+ files) in minutes
  • 💬 Natural Language Queries: Ask questions in plain English
  • 🗺️ Visual Mapping: Generate interactive relationship graphs
  • 🎯 Pattern Detection: Automatically detect architectural patterns
  • 🔍 Multi-Language Support: Python, JavaScript, TypeScript, Java, C++, Go, Rust, and more
  • 📦 Zero Configuration: Works out of the box

🚀 Quick Start

Installation

pip install grid-analyzer

Basic Usage

# 1. Index your codebase
grid analyze /path/to/codebase

# 2. Ask questions
grid query "Where is user authentication handled?"
grid query "What files connect to the database?"
grid query "How does the payment system work?"

# 3. Generate visual map
grid map --output relationships.html

📖 Documentation

Commands

analyze - Index a codebase

grid analyze <directory> [options]

Options:
  --language LANG       Primary language (auto-detected if not specified)
  --exclude PATTERN     Exclude patterns (can be repeated)
  --output DIR          Output directory (default: .grid)
  -v, --verbose         Verbose output

Examples:

# Analyze current directory
grid analyze .

# Analyze with exclusions
grid analyze ~/projects/myapp --exclude "*.test.js" --exclude "dist"

# Specify primary language
grid analyze . --language python

query - Ask questions about your code

grid query "<question>" [options]

Options:
  --format FORMAT       Output format: text, json, markdown (default: text)
  --limit N             Maximum results (default: 10)

Examples:

# Ask natural language questions
grid query "Where is the API authentication middleware?"
grid query "What functions handle file uploads?"
grid query "Show me all database models"

# Get JSON output for scripting
grid query "list all API endpoints" --format json

# Limit results
grid query "find error handlers" --limit 5

map - Generate relationship graphs

grid map --output <file> [options]

Options:
  --output FILE         Output file (.svg, .pdf, .html, .json)
  --style STYLE         Graph style: default, compact, detailed
  --focus MODULE        Focus on specific module or file

Examples:

# Generate interactive HTML visualization
grid map --output codebase.html

# Focus on specific module
grid map --output auth-system.html --focus "src/auth"

# Export as JSON for custom processing
grid map --output graph.json

config - Manage configuration

grid config <action> [key] [value]

Actions:
  show          Show all configuration
  get KEY       Get specific value
  set KEY VAL   Set configuration value
  reset         Reset to defaults

Examples:

# View configuration
grid config show

# Change settings
grid config set max_file_size_mb 20
grid config set use_color true

# Reset to defaults
grid config reset

license - Manage license

grid license <action> [key]

Actions:
  activate KEY  Activate paid license
  show          Show license information
  deactivate    Deactivate license

Examples:

# Activate Professional license
grid license activate GRID-PRO-XXXXXXXXXXXX

# Check current tier
grid license show

# Deactivate and return to Free tier
grid license deactivate

💰 Pricing

Tier Price Max Files Features
Free $0 10,000 Local analysis, basic queries
Professional $20/mo Unlimited Advanced queries, relationship mapping
Team $100/mo Unlimited Collaboration, shared indexes, SSO
Enterprise Contact us Unlimited On-premise, custom training, SLA

👉 Upgrade at: https://grid-analyzer.com/pricing

🔧 Advanced Usage

Integrate with CI/CD

# Generate codebase report in CI pipeline
grid analyze . --output /artifacts/grid-index
grid map --output /artifacts/architecture.html
grid query "list all TODO comments" --format json > /artifacts/todos.json

Export Data

# Export relationship data
grid map --output graph.json

# Query results as JSON
grid query "find all API endpoints" --format json > endpoints.json

Configuration File

GRID Analyzer stores configuration in ~/.grid/config.json:

{
  "language": "auto",
  "exclude_patterns": [
    "*.git",
    "node_modules",
    "venv"
  ],
  "max_file_size_mb": 10,
  "use_color": true,
  "check_updates": true
}

🎯 Use Cases

1. Onboarding New Developers

# Create onboarding documentation
grid analyze .
grid map --output architecture.html
grid query "what are the main components?" > onboarding-guide.md

2. Code Reviews

# Understand changes in context
grid analyze /path/to/feature-branch
grid query "what does this PR change?"
grid map --focus "src/changed-module"

3. Debugging Legacy Code

# Find relevant code quickly
grid query "where are database connections created?"
grid query "what handles the payment webhook?"
grid map --focus "src/payments" --output payment-flow.html

4. Documentation Generation

# Auto-generate architecture docs
grid analyze .
grid map --output docs/architecture.html --style detailed
grid query "list all public APIs" --format markdown > docs/api.md

5. Security Audits

# Find security-sensitive code
grid query "where is user input sanitized?"
grid query "what files handle authentication?"
grid query "find all SQL query builders"

6. Refactoring Planning

# Understand dependencies before refactoring
grid map --focus "legacy-module" --output dependencies.html
grid query "what depends on the old API?"

🤝 Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

# Development setup
git clone https://github.com/yourusername/grid-analyzer.git
cd grid-analyzer
pip install -e ".[dev]"

# Run tests
pytest

# Format code
black .

📝 License

MIT License - see LICENSE file for details.

🐛 Bug Reports

Found a bug? Open an issue with:

  • Steps to reproduce
  • Expected vs actual behavior
  • GRID version (grid --version)
  • Operating system

💬 Support

🙏 Acknowledgments

Built with:

  • Local AI models (no external API calls)
  • AST parsing for code analysis
  • Graph visualization with D3.js
  • Privacy-first architecture

Made with ❤️ by the GRID Team

WebsiteDocumentationTwitter

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grid_analyzer-0.1.0.tar.gz (27.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

grid_analyzer-0.1.0-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

Details for the file grid_analyzer-0.1.0.tar.gz.

File metadata

  • Download URL: grid_analyzer-0.1.0.tar.gz
  • Upload date:
  • Size: 27.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for grid_analyzer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6b6e1c8ea057874a8ece1712301cac1bd155a6d0a410115787215f8d3c91cbf4
MD5 aacc3fa65382efa6f768019dca8a55a7
BLAKE2b-256 897590783b5f5307ac18a22068886712b78f88c257e4e2b63ca0d0f8d56232ba

See more details on using hashes here.

File details

Details for the file grid_analyzer-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: grid_analyzer-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 27.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for grid_analyzer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6fdb607cbc9a7428e3f4f9d3d6c4de0e59d06777ca26143532fa626fbc1d8f6b
MD5 56c6ad3b7af54a19317516abfbbd3905
BLAKE2b-256 094073f9896a65383323346ec4d838492f67eca82e26e9ab3bc003f4bac0d238

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page