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
- Install using pip:
pip install janito
- Verify installation:
janito --version
⚙️ Setup
-
Get your Anthropic API key from Anthropic's website
-
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'
- (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
- Code Refactoring
# Refactor with test validation
janito "refactor this code to use list comprehension" --test "pytest"
# Refactor specific directory
janito "update imports" -i ./src
- Documentation Updates
# Add or update docstrings
janito "add type hints and docstrings"
# Generate README
janito "create a README for this project"
- 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 accessJANITO_TEST_CMD: Default test command (optional)
📄 License
MIT License - see LICENSE file for details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
298f1386ac1e4776fd0fb2ae83c53acd9759eda81e10b0f836f96dd01d10a035
|
|
| MD5 |
61c7fdc294727d9566e83b9d07b1942f
|
|
| BLAKE2b-256 |
e41d3a5f254a6ac046ca20cb85325a45f29f1ad132cd3360800caabf4fead21b
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f57e9125c2fa290db571d1dd6d2b4a1ecf29803432b6fb8fe5171c1be230ead
|
|
| MD5 |
9ca4c5843d61c4a6de599f510c998512
|
|
| BLAKE2b-256 |
d757165dc72b02621154c4a8508db0eecf47c19359bd3ed675b10624a6700299
|