Skip to content

ZhenchongLi/code-clis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Code CLI Tools

A modern collection of AI-powered CLI tools for document processing, content generation, and more. Built with Python 3.11+, powered by multiple AI providers (Gemini, Ollama, Anthropic Claude).

Features

  • Multi-AI Provider Support: Switch seamlessly between Gemini, Ollama, and Anthropic Claude
  • Document Conversion: Convert PDF and DOCX files to clean, structured Markdown
  • Modern Python: Built with Python 3.11+, type hints, and modern best practices
  • Easy Configuration: Simple YAML-based configuration with environment variable support
  • Type Safe: Full type annotations with mypy validation
  • uv Package Management: Fast, reliable dependency management with uv

Available Tools

πŸ¦™ ollama - Ollama Management

Manage Ollama server and models with convenient CLI commands:

# Server management
uv run ./code-clis ollama start     # Start Ollama server
uv run ./code-clis ollama stop      # Stop Ollama server
uv run ./code-clis ollama status    # Check server status

# Model management
uv run ./code-clis ollama models    # List local models
uv run ./code-clis ollama pull llama3.2  # Pull a model

# Interactive usage
uv run ./code-clis ollama run llama3.2  # Interactive chat
uv run ./code-clis ollama run llama3.2 --prompt "Hello, how are you?"  # One-shot

πŸ“„ doc2md - Document to Markdown Converter

Convert PDF and DOCX documents to clean, AI-processed Markdown:

# Convert a single document
uv run ./code-clis doc2md convert document.pdf -o output.md

# Batch convert all documents in a directory
uv run ./code-clis doc2md batch /path/to/docs/ --output-dir ./markdown/

# Use specific AI provider
uv run ./code-clis doc2md convert document.pdf --ai-provider ollama

# Different output styles
uv run ./code-clis doc2md convert document.pdf --style academic

Supported formats: PDF, DOCX, DOC, TXT, MD

Installation & Usage

πŸš€ Quick Start (Recommended - No Installation Required)

Like uv, you can run code-clis directly from source without installation:

# Clone the repository
git clone https://github.com/your-username/code-clis.git
cd code-clis

# Install dependencies (one-time setup)
./install-deps.py

# Run directly with uv (recommended)
uv run ./code-clis --help
uv run ./code-clis ollama status
uv run ./code-clis doc2md convert file.pdf

# Or run directly (if dependencies are installed)
./code-clis --help
./code-clis ollama status

Prerequisites

  • Python 3.11 or higher
  • uv package manager (recommended) or pip

Alternative Installation Methods

Install with pipx

# Install pipx if you haven't already
pip install pipx
pipx ensurepath

# Install code-clis from PyPI (when published)
pipx install code-clis

# Or install directly from GitHub
pipx install git+https://github.com/your-username/code-clis.git

Install with uv/pip for Development

# Clone the repository
git clone https://github.com/your-username/code-clis.git
cd code-clis

# Install in development mode
uv pip install -e .
# or: pip install -e .

# Then use normally
code-clis --help

Usage Methods Comparison

Method Best For Command Example
Direct run (recommended) Quick usage, no system changes uv run ./code-clis ollama status
pipx System-wide installation code-clis ollama status
Development install Development/customization code-clis ollama status

Quick Start

1. Get Started Immediately

# Clone and run
git clone https://github.com/your-username/code-clis.git
cd code-clis

# List available tools
uv run ./code-clis list

# Manage Ollama server and models
uv run ./code-clis ollama start
uv run ./code-clis ollama status
uv run ./code-clis ollama run llama3.2

# Convert documents
uv run ./code-clis doc2md convert document.pdf

2. Initialize Configuration

# Set up configuration with guided setup
uv run ./code-clis config init

# Or manually configure your preferred AI provider
uv run ./code-clis config set ai.provider gemini
uv run ./code-clis config set ai.gemini.api_key YOUR_API_KEY

3. Explore Available Tools

# List all available tools
uv run ./code-clis list

# Get help for any command
uv run ./code-clis doc2md --help
uv run ./code-clis ollama --help
uv run ./code-clis config --help

Configuration

Code CLI Tools uses a YAML configuration file located at ~/.code-clis/config.yaml.

AI Provider Setup

Gemini (Recommended - Free tier available)

code-clis config set ai.provider gemini
code-clis config set ai.gemini.api_key YOUR_GEMINI_API_KEY

Get your API key at: Google AI Studio

Ollama (Local/Privacy-focused)

# Install and start Ollama
ollama serve
ollama pull llama3.2

# Configure Code CLI Tools
code-clis config set ai.provider ollama
code-clis config set ai.ollama.model llama3.2:latest

Anthropic Claude

code-clis config set ai.provider anthropic
code-clis config set ai.anthropic.api_key YOUR_CLAUDE_API_KEY

Get your API key at: Anthropic Console

AI Tools Integration

Integrate code-clis with various AI tools for seamless automation and workflow enhancement.

Claude Code Integration (Recommended)

Integrate directly with Anthropic's Claude Code for the best experience:

# Register all commands to Claude Code
code-clis claude-code register

# Check integration status
code-clis claude-code status

Available slash commands in Claude Code:

πŸ“„ Document Tools:

  • /code-clis-doc2md <file.pdf> - Convert documents to Markdown
  • /code-clis-doc2md-batch <directory> - Batch convert documents

πŸ¦™ Ollama Management:

  • /code-clis-ollama-start - Start Ollama server
  • /code-clis-ollama-status - Check server status
  • /code-clis-ollama-models - List available models
  • /code-clis-ollama-pull <model> - Pull a model
  • /code-clis-ollama-run <model> --prompt "Hello" - Run model with prompt

βš™οΈ Configuration:

  • /code-clis-config show - Show current configuration
  • /code-clis-help - Get help

Universal Command Line Integration

For other AI tools (GitHub Copilot, OpenAI Codex, etc.), use direct commands:

# Direct usage
uv run ./code-clis ollama start
uv run ./code-clis doc2md convert file.pdf

# System installation
code-clis ollama status
code-clis config show

Advanced Integration

For custom integrations, see AI Tools Integration Guide for:

  • API integration examples (Python, Node.js)
  • Environment variable configuration
  • Custom workflow setups
  • Troubleshooting guide

Development

Quick Setup for AI Tools

For AI self-development (Claude Code, GitHub Codex, Gemini):

# Auto-setup development environment
./setup-dev.py

# Read the AI development guide
cat AI_SELF_DEVELOPMENT.md

# Start adding features immediately!

Manual Setup

# Clone and setup
git clone https://github.com/your-username/code-clis.git
cd code-clis

# Install dependencies
uv pip install -e .

# Install development dependencies
uv add --dev pytest mypy black ruff pytest-cov

AI Collaboration

This project is specifically designed for AI-human collaboration:

Run Tests

# Run all tests
uv run pytest

# Run with coverage
uv run pytest --cov=claude_clis

# Type checking
uv run mypy src/

# Linting
uv run ruff check src/
uv run black src/

License

This project is licensed under the MIT License - see the LICENSE file for details.

Made with Claude Code

This project was generated using Claude Code, Anthropic's official CLI for Claude.

About

Common Clis used by claude code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors