# Pomera AI Commander

> Pomera AI Commander is a comprehensive text processing toolkit with 22 MCP (Model Context Protocol) tools for AI assistants. It provides case transformation, encoding/decoding, hashing, text analysis, regex extraction, email/URL parsing, notes management, and more.

Important notes:
- Pomera can run as a standalone GUI application OR as an MCP server for AI integration
- All 22 tools are available via MCP protocol for use with Cursor, Claude Desktop, VS Code, etc.
- Written in Python with cross-platform support (Windows, Linux, macOS)

## Core Features

### Multi-Tab Interface with Independent Find & Replace
- Create multiple text tabs with `Ctrl+T`
- Each tab has its own independent find/replace state
- Switch tabs with `Ctrl+Tab` or click tab headers
- Per-tab undo/redo history and cursor position
- Find in current tab: `Ctrl+F`, Replace: `Ctrl+H`

### Real-Time Text Statistics
- Live character, word, line, paragraph counting in status bar
- Statistics update automatically as you type
- Use `pomera_text_stats` MCP tool for comprehensive analysis
- Includes bytes, unique words, average word length

### Multiple AI Providers Configuration
Supported providers:
- **OpenAI**: GPT-4, GPT-3.5-turbo (set OPENAI_API_KEY)
- **Google Vertex AI**: Gemini Pro/Ultra (set GOOGLE_APPLICATION_CREDENTIALS)
- **Azure OpenAI**: Azure-hosted GPT models (set AZURE_OPENAI_KEY)
- **Anthropic**: Claude 3/2 models (set ANTHROPIC_API_KEY)
- **Ollama**: Local models like Llama, Mistral (run on localhost:11434)

Switch providers using `AIProviderManager.switch_provider("provider_name")` or via Settings > AI Configuration.

### Custom Text Processing Pipelines
Chain multiple operations together for complex transformations:
```python
# Example pipeline: clean, format, sort
pipeline = [
    {"tool": "pomera_whitespace", "operation": "normalize"},
    {"tool": "pomera_case_transform", "operation": "sentence"},
    {"tool": "pomera_sort", "operation": "alphabetical"}
]
```

### Intelligent Caching System
- Content-hash-based caching via `ContentHashCache` class
- Same input + operation returns cached result instantly
- Memory and disk caching with configurable TTL
- View cache stats: hits, misses, hit rate

## MCP Server Documentation

- [Feature Guide](https://github.com/matbanik/Pomera-AI-Commander/blob/main/docs/FEATURE_GUIDE.md): Detailed feature documentation
- [MCP Project Guide](https://github.com/matbanik/Pomera-AI-Commander/blob/main/docs/MCP_PROJECT.md): Complete MCP server documentation
- [Tools Documentation](https://github.com/matbanik/Pomera-AI-Commander/blob/main/docs/TOOLS_DOCUMENTATION.md): Comprehensive guide to all available tools

## Available MCP Tools

### Text Transform Tools
- `pomera_case_transform`: Transform text case (sentence, lower, upper, title, alternating, inverse)
- `pomera_whitespace`: Normalize whitespace, remove blank lines, trim lines
- `pomera_line_tools`: Add/remove line numbers, wrap lines, prefix/suffix operations
- `pomera_sort`: Sort lines alphabetically, numerically, by length, randomize

### Encoding Tools
- `pomera_encode`: Encoding operations (type: base64, hash, number_base)
  - base64: Encode/decode Base64, URL-safe Base64
  - hash: Generate MD5, SHA-1, SHA-256, SHA-512, CRC32 hashes
  - number_base: Convert between decimal, hex, binary, octal
- `pomera_string_escape`: Escape/unescape HTML, URL, JSON, regex characters

### Data Format Tools
- `pomera_json_xml`: Format, minify, convert between JSON and XML
- `pomera_markdown`: Convert markdown to HTML or plain text
- `pomera_column_tools`: Extract, reorder, merge CSV/TSV columns

### Extraction Tools
- `pomera_extract`: Extract content from text (type: regex, emails, urls)
  - regex: Extract text matching regex patterns
  - emails: Extract all email addresses from text
  - urls: Extract all URLs from text
- `pomera_html`: Strip HTML tags, extract text content
- `pomera_email_header_analyzer`: Parse and analyze email headers

### Utility Tools
- `pomera_url_parse`: Parse URLs into components (protocol, host, path, query)
- `pomera_timestamp`: Convert between Unix timestamps and human dates
- `pomera_cron`: Parse and explain cron expressions
- `pomera_text_wrap`: Wrap text at specified width
- `pomera_text_stats`: Count characters, words, lines, paragraphs
- `pomera_word_frequency`: Analyze word frequency in text
- `pomera_list_compare`: Find differences between two lists

### Generator Tools
- `pomera_generators`: Generate content (generator: password, uuid, lorem_ipsum, random_email, slug)
- `pomera_translator`: Translate text to Morse code, binary, NATO alphabet

### Notes Database Tools
- `pomera_notes`: Manage notes (action: save, get, list, search, update, delete)

## Quick Start

### Install via pip
```bash
pip install pomera-ai-commander
```

### Install via npm
```bash
npm install -g pomera-ai-commander
```

### Run as MCP Server
```bash
pomera-mcp
# or
pomera-ai-commander
# or
python pomera.py --mcp-server
```

### Configure in Cursor/Claude Desktop
```json
{
  "mcpServers": {
    "pomera": {
      "command": "pomera-mcp"
    }
  }
}
```

## Configuration Examples

### AI Provider Configuration (settings.json)
```json
{
  "ai_providers": {
    "openai": {
      "enabled": true,
      "api_key": "sk-...",
      "model": "gpt-4"
    },
    "vertex_ai": {
      "enabled": true,
      "project_id": "my-project",
      "model": "gemini-pro"
    }
  },
  "active_provider": "openai"
}
```

### Caching Configuration
```python
from core.content_hash_cache import ContentHashCache

cache = ContentHashCache(cache_dir=".cache", max_size_mb=100)
# Cache automatically used for all text processing operations
```

## Optional

- [Build Guide](https://github.com/matbanik/Pomera-AI-Commander/blob/main/BUILD.md): How to build from source
- [Troubleshooting](https://github.com/matbanik/Pomera-AI-Commander/blob/main/docs/TROUBLESHOOTING.md): Common issues and solutions
