Skip to content

Latest commit

 

History

History
279 lines (195 loc) · 6.61 KB

README.md

File metadata and controls

279 lines (195 loc) · 6.61 KB

Kanuni - AI-Powered Legal Intelligence CLI

Kanuni Logo

The Ottoman Edition

Named after Suleiman the Lawgiver (Kanuni Sultan Süleyman)

License: MIT License: Apache 2.0 Rust Crates.io

🚀 Features

  • 📄 Document Analysis - Extract key information, dates, parties, and risks from legal documents
  • 💬 AI Chat Assistant - Interactive legal guidance powered by advanced language models
  • 🔍 Case Law Search - Search through legal precedents and case databases
  • 📅 Deadline Extraction - Automatically extract and track important dates
  • 🎨 Beautiful CLI - Intuitive interface with colors and progress indicators
  • 🔐 Secure - API key authentication with secure storage
  • ⚡ Fast - Built with Rust for maximum performance

📦 Installation

Quick Install (Recommended)

macOS/Linux

curl -fsSL https://get.kanuni.dev | sh

Or if you prefer wget:

wget -qO- https://get.kanuni.dev | sh

Package Managers

Homebrew (macOS/Linux)

brew install v-lawyer/tap/kanuni

npm (Node.js)

npm install -g @v-lawyer/kanuni

Cargo (Rust)

cargo install kanuni

Docker

docker run -it vlawyer/kanuni --help

# Or use docker-compose for persistent config
docker-compose run kanuni login
docker-compose run kanuni chat "Your legal question"

Platform-Specific Binaries

Download pre-compiled binaries from GitHub Releases:

  • macOS: Intel (kanuni-darwin-x64) or Apple Silicon (kanuni-darwin-arm64)
  • Linux: x64 (kanuni-linux-x64) or ARM64 (kanuni-linux-arm64)
  • Windows: x64 (kanuni-windows-x64.exe)

From Source

git clone https://github.com/v-lawyer/kanuni-cli.git
cd kanuni-cli
cargo build --release
sudo mv target/release/kanuni /usr/local/bin/

Verify Installation

kanuni --version

🔧 Configuration

First, authenticate with your V-Lawyer API key:

kanuni auth login

Don't have an API key? Sign up at v-lawyer.ai

📖 Usage

Document Analysis

Analyze legal documents to extract key information:

# Basic analysis
kanuni analyze contract.pdf

# Extract specific information
kanuni analyze contract.pdf -e dates -e parties -e obligations

# Output as JSON
kanuni analyze contract.pdf --format json

AI Chat Assistant

Get instant legal guidance:

# Start interactive chat
kanuni chat

# Ask a specific question
kanuni chat "What are the key elements of a valid contract?"

# Chat with document context
kanuni chat -d contract.pdf "What are the risks in this agreement?"

# Continue previous session
kanuni chat --session abc123

Case Law Search

Search through legal precedents:

# Basic search
kanuni search "negligence duty of care"

# Filter by jurisdiction
kanuni search "contract breach" -j "California"

# Limit results and date range
kanuni search "intellectual property" -n 20 -d "2020-2024"

Date & Deadline Extraction

Extract important dates from documents:

# Extract from single document
kanuni extract contract.pdf

# Extract from directory
kanuni extract ./legal-docs/

# Export as calendar file
kanuni extract contract.pdf --format ical

# Add reminders
kanuni extract contract.pdf --reminder 7

🛠️ Advanced Usage

Shell Completions

Generate completions for your shell:

# Bash
kanuni completions bash > /usr/local/share/bash-completion/completions/kanuni

# Zsh
kanuni completions zsh > /usr/local/share/zsh/site-functions/_kanuni

# Fish
kanuni completions fish > ~/.config/fish/completions/kanuni.fish

Configuration Management

# Show current config
kanuni config show

# Set custom API endpoint
kanuni config set api_endpoint https://custom.api.endpoint

# Reset to defaults
kanuni config reset

🧪 Development

Prerequisites

  • Rust 1.70+
  • Cargo

Building

# Clone the repository
git clone https://github.com/v-lawyer/kanuni-cli.git
cd kanuni-cli

# Build debug version
cargo build

# Run tests
cargo test

# Build optimized release
cargo build --release

Project Structure

kanuni-cli/
├── src/
│   ├── main.rs           # Entry point
│   ├── cli.rs           # CLI argument parsing
│   ├── commands/        # Command implementations
│   ├── api.rs           # API client
│   ├── config.rs        # Configuration management
│   └── utils/           # Utilities and helpers
├── Cargo.toml           # Dependencies
└── README.md           # This file

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

How to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📝 License

This project is dual-licensed under either:

at your option.

🙏 Acknowledgments

📞 Support

🚦 Status

CI Coverage


Made with ❤️ by the V-Lawyer Team
Building the future of legal technology