Thanks to visit codestin.com
Credit goes to github.com

Skip to content

v-lawyer/kanuni-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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