Skip to main content

A CLI tool for software development tasks powered by AI

Project description

Janito

PyPI version License: MIT

AI-powered CLI tool for code modifications and analysis. Janito helps you modify, analyze, and understand your codebase using natural language commands.

Table of Contents

Features

  • 🤖 AI-powered code analysis and modifications
  • 🔄 Incremental code changes with search/replace operations
  • 🎯 Precise text modifications with context matching
  • 💬 Natural language interface for code operations
  • 🔍 Interactive code exploration
  • 📝 Automatic documentation generation
  • ⚡ Fast and efficient codebase navigation
  • 💾 Smart Claude AI prompt caching for faster responses

Installation

Prerequisites

  • Python 3.8 or higher
  • Anthropic API key (with smart caching to reduce API costs)

Install via pip

pip install janito

Set up API key

export ANTHROPIC_API_KEY=your_api_key_here

Usage

Basic Commands

Janito supports incremental code changes through precise text operations:

  • Search and replace with context matching
  • Delete specific code blocks
  • File operations (create, replace, rename, move, remove)
# Start interactive shell
janito

# Modify code with natural language
janito "add docstrings to this file"

# Ask questions about the codebase
janito --ask "explain the main function in this file"

# Preview files that would be analyzed
janito --scan

Examples

  1. Add documentation to a file:
janito "add docstrings to all functions in src/main.py"
  1. Analyze code structure:
janito --ask "what are the main classes in this project?"
  1. Refactor code:
janito "convert this function to use async/await"
  1. Generate tests:
janito "create unit tests for the User class"

Configuration

Environment Variables

  • ANTHROPIC_API_KEY: Anthropic API key for Claude AI
  • JANITO_TEST_CMD: Default test command to run after changes

Command Line Options

  • -w, --workspace_dir: Set working directory
  • -i, --include: Additional paths to include
  • --debug: Show debug information
  • --verbose: Show verbose output
  • --auto-apply: Apply changes without confirmation

Development

Setting up Development Environment

# Clone the repository
git clone https://github.com/joaompinto/janito.git
cd janito

# Create and activate virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install development dependencies
pip install -e ".[dev]"

Running Tests

pytest

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

MIT License - see LICENSE

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

janito-0.7.0.tar.gz (72.3 kB view details)

Uploaded Source

Built Distribution

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

janito-0.7.0-py3-none-any.whl (105.0 kB view details)

Uploaded Python 3

File details

Details for the file janito-0.7.0.tar.gz.

File metadata

  • Download URL: janito-0.7.0.tar.gz
  • Upload date:
  • Size: 72.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for janito-0.7.0.tar.gz
Algorithm Hash digest
SHA256 536caa149fcc601b18e88136589318f361c103305cf02e2912690127814b24ec
MD5 74d2a93c1aeee81627155fb478ed973a
BLAKE2b-256 c1dd40d14f2c1e4e557776e84428de9e10ce5b63b9be11fea2570f05ecc89ad4

See more details on using hashes here.

File details

Details for the file janito-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: janito-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 105.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for janito-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 63bb7499c4661c04d5364847c85cddeca9fc41978a1132815fb451f718ee34df
MD5 ddf8cf1c91a43c20ba19208080d3c3d8
BLAKE2b-256 97a83abba0af8dfb24fd39336851eb3f5d2b5e2dc2f5424d8bfa3b2d2c2f8a42

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