Skip to main content

A comprehensive AI-powered code analysis and automation CLI tool

Project description

Sutra Knowledge CLI

An intelligent codebase analysis and knowledge management tool that provides AI-powered insights, semantic search capabilities, and comprehensive project understanding through advanced parsing and embedding technologies.

Overview

Sutra Knowledge CLI is a powerful command-line application designed to help developers understand, analyze, and interact with codebases using artificial intelligence. It combines semantic search, graph-based analysis, and AI agents to provide deep insights into your projects.

Key Features

🔍 Intelligent Code Analysis

  • Single Project Processing: Analyze individual codebases with detailed parsing and embedding generation
  • Multi-Project Management: Process and manage multiple projects simultaneously
  • Semantic Search: Find code patterns and implementations using natural language queries
  • Graph-Based Understanding: Build knowledge graphs of your codebase for better comprehension

🤖 AI-Powered Assistance

  • AI Agent Integration: Interactive AI agent for code understanding and assistance
  • Context-Aware Responses: Get intelligent answers about your codebase
  • Memory Management: Persistent conversation context and project knowledge

🌐 Web Integration

  • Web Search: Search the web for relevant programming information
  • Web Scraping: Extract and analyze web content for development insights
  • Authentication: Secure access to external services and APIs

📊 Project Management

  • Project Listing: View and manage all analyzed projects
  • Database Statistics: Monitor analysis progress and storage metrics
  • Data Management: Clear and maintain project databases

Available Commands

Command Description
single Process a single project for analysis
multi Process multiple projects simultaneously
list List all analyzed projects
clear Clear database data and reset projects
stats Display database statistics and metrics
agent Start interactive AI agent session
parse Parse and analyze code structures
search Perform semantic search across codebases
auth Manage authentication and API keys
web_search Search web for programming resources
web_scrap Scrape and analyze web content

Installation

Option 1: Pip Install (Recommended)

# Install sutrakit directly from repository
pip install git+https://github.com/sutragraph/sutracli.git

# Setup the ~/.sutra directory and download models/parsers
sutrakit-setup

# Analyze your first project
sutrakit --directory /path/to/your/project

Option 2: Binary Installation

See INSTALL.md for installing the pre-built binary instead of using the source code.

Quick Start

  1. Using Source Code: Use below steps if you want to run the source code directly.

  2. Basic Usage:

    # Analyze a single project
    python main.py single /path/to/your/project
    
    # Start interactive AI agent
    python main.py agent
    
    # Search your codebase
    python main.py search "authentication logic"
    
    # List all projects
    python main.py list
    
  3. Configuration: The tool uses JSON configuration files for project settings and supports various programming languages and frameworks.

Architecture

Sutra Knowledge CLI is built with a modular architecture:

  • CLI Interface: User-friendly command-line interface with comprehensive argument parsing
  • Parsing Engine: Advanced code parsing supporting multiple languages
  • Embedding System: Semantic embedding generation for intelligent search
  • Graph Processing: Knowledge graph construction and analysis
  • AI Services: Integration with language models and AI agents
  • Authentication: Secure API and service authentication
  • Database Layer: Efficient storage and retrieval of project data

Use Cases

  • Code Review: Understand large codebases quickly
  • Documentation: Generate insights for better documentation
  • Refactoring: Identify patterns and relationships for safe refactoring
  • Learning: Explore unfamiliar codebases with AI assistance
  • Knowledge Management: Build searchable knowledge bases of your projects

Requirements

  • Python 3.8+
  • Required dependencies (see requirements.txt)
  • Optional: API keys for enhanced AI features

Getting Help

  • Use python main.py --help for command-line help
  • Use python main.py <command> --help for command-specific help
  • Check the documentation in the docs/ directory (if available)

Contributing

This project welcomes contributions. Please ensure your code follows the established patterns and includes appropriate tests.

License

See LICENSE file for details.


Sutra Knowledge CLI - Intelligent codebase understanding through AI-powered analysis

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

sutrakit-0.1.6.tar.gz (223.2 kB view details)

Uploaded Source

Built Distribution

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

sutrakit-0.1.6-py3-none-any.whl (269.3 kB view details)

Uploaded Python 3

File details

Details for the file sutrakit-0.1.6.tar.gz.

File metadata

  • Download URL: sutrakit-0.1.6.tar.gz
  • Upload date:
  • Size: 223.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for sutrakit-0.1.6.tar.gz
Algorithm Hash digest
SHA256 58b449b232ee8f747f4f77d5341b1a4c855d9aee7fd9a9982b6eef82f55b1dfd
MD5 456faaf4ecdcde297bf67d8d11a1dbea
BLAKE2b-256 889a00c4e53b787acbfff24f4ba5a83b0fe908addfdcf205a4e4150470d3eb8f

See more details on using hashes here.

File details

Details for the file sutrakit-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: sutrakit-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 269.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for sutrakit-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 b2af1aa5afe15cfd8ab6a4b8cc0410ee83dbbbeb461030b05d433af21d7af001
MD5 d86fef6862037fd26c13c128e1d93a82
BLAKE2b-256 b65665129d5274e033081a7b5711c8b5458b37fc98fda159b19d6b49720b916a

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