Skip to main content

A CLI tool for software development tasks powered by AI

Project description

🤖 Janito CLI

A CLI tool for software development tasks powered by AI. Janito is your friendly AI-powered software development buddy that helps with coding tasks like refactoring, documentation updates, and code optimization.

📥 Installation

  1. Install using pip:
pip install janito
  1. Verify installation:
janito --version

⚙️ Setup

  1. Get your Anthropic API key from Anthropic's website

  2. Set your API key:

# Linux/macOS
export ANTHROPIC_API_KEY='your-api-key-here'

# Windows (Command Prompt)
set ANTHROPIC_API_KEY=your-api-key-here

# Windows (PowerShell)
$env:ANTHROPIC_API_KEY='your-api-key-here'
  1. (Optional) Configure default test command:
export JANITO_TEST_CMD='pytest'  # or your preferred test command

🚀 Quick Start

Basic Usage

# Add docstrings to your code
janito "add docstrings to this file"

# Optimize a function
janito "optimize the main function"

# Get code explanations
janito --ask "explain this code"

Common Scenarios

  1. Code Refactoring
# Refactor with test validation
janito "refactor this code to use list comprehension" --test "pytest"

# Refactor specific directory
janito "update imports" -i ./src
  1. Documentation Updates
# Add or update docstrings
janito "add type hints and docstrings"

# Generate README
janito "create a README for this project"
  1. Code Analysis
# Get code explanations
janito --ask "what does this function do?"

# Find potential improvements
janito --ask "suggest optimizations for this code"

🛠️ Command Reference

Syntax

janito [OPTIONS] [REQUEST]

Key Options

Option Description
REQUEST The AI request/instruction (in quotes)
-w, --working-dir PATH Working directory [default: current]
-i, --include PATH Include directory int the working context (can be multiple)
--ask QUESTION Ask questions without making changes
--test COMMAND Run tests before applying changes
--debug Enable debug logging
--verbose Enable verbose mode
--version Show version information
--help Show help message

🔑 Key Features

  • 🤖 AI-powered code analysis and modifications
  • 💻 Interactive console mode
  • ✅ Syntax validation for Python files
  • 👀 Change preview and confirmation
  • 🧪 Test command execution
  • 📜 Change history tracking

📚 Additional Information

  • Requires Python 3.8+
  • Changes are backed up in .janito/changes_history/
  • Environment variables:
    • ANTHROPIC_API_KEY: Required for API access
    • JANITO_TEST_CMD: Default test command (optional)

📄 License

MIT License - see LICENSE file for details.

Project details


Release history Release notifications | RSS feed

This version

0.5.0

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.5.0.tar.gz (36.6 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.5.0-py3-none-any.whl (47.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for janito-0.5.0.tar.gz
Algorithm Hash digest
SHA256 298f1386ac1e4776fd0fb2ae83c53acd9759eda81e10b0f836f96dd01d10a035
MD5 61c7fdc294727d9566e83b9d07b1942f
BLAKE2b-256 e41d3a5f254a6ac046ca20cb85325a45f29f1ad132cd3360800caabf4fead21b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: janito-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 47.8 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.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7f57e9125c2fa290db571d1dd6d2b4a1ecf29803432b6fb8fe5171c1be230ead
MD5 9ca4c5843d61c4a6de599f510c998512
BLAKE2b-256 d757165dc72b02621154c4a8508db0eecf47c19359bd3ed675b10624a6700299

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