Metadata-Version: 2.4
Name: micro-cc
Version: 0.1.3
Summary: Harness that gives frontier models full system access — shell, filesystem, browser, MCP — running directly on the metal.
Author: George Salapa
License-Expression: MIT
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Requires-Dist: anthropic>=0.76.0
Requires-Dist: anyio>=4.0
Requires-Dist: beautifulsoup4>=4.14
Requires-Dist: fastapi>=0.135
Requires-Dist: google-search-results>=2.4
Requires-Dist: httpx>=0.28
Requires-Dist: httpx-sse>=0.4
Requires-Dist: lxml>=6.0
Requires-Dist: mammoth>=1.11
Requires-Dist: markdown-it-py>=4.0
Requires-Dist: markdownify>=1.2
Requires-Dist: mcp>=1.26
Requires-Dist: numpy>=2.4
Requires-Dist: openai>=2.16
Requires-Dist: openpyxl>=3.1
Requires-Dist: pandas>=3.0
Requires-Dist: pathvalidate>=3.3
Requires-Dist: pdfminer.six>=20260107
Requires-Dist: pillow>=12.0
Requires-Dist: playwright>=1.58
Requires-Dist: prompt_toolkit>=3.0
Requires-Dist: puremagic>=1.30
Requires-Dist: PyAutoGUI>=0.9
Requires-Dist: pydantic>=2.12
Requires-Dist: pydantic-settings>=2.13
Requires-Dist: python-dotenv>=1.2
Requires-Dist: python-pptx>=1.0
Requires-Dist: requests>=2.32
Requires-Dist: rich>=14.0
Requires-Dist: textual>=8.0
Requires-Dist: tiktoken>=0.12
Requires-Dist: uvicorn>=0.42
Requires-Dist: watchdog>=6.0
Requires-Dist: xlsxwriter>=3.2
Requires-Dist: youtube-transcript-api>=1.2

# micro·cc — cognitive compute

```
  ███╗   ███╗ ██████╗ ██████╗ ███████╗██╗
  ████╗ ████║██╔═══██╗██╔══██╗██╔════╝██║
  ██╔████╔██║██║   ██║██║  ██║█████╗  ██║
  ██║╚██╔╝██║██║   ██║██║  ██║██╔══╝  ██║
  ██║ ╚═╝ ██║╚██████╔╝██████╔╝███████╗███████╗
  ╚═╝     ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝╚══════╝
  ─────── on the metal ─────────────────────
```

Harness that gives frontier models full system access — shell, filesystem, browser, MCP — running directly on the metal. Planning, memory, and tool orchestration let models perform complex multi-step work autonomously. Point it at any project directory and go.

## Install

```bash
pip install micro-cc
```

## Environment

Create `~/.micro-cc/.env` with **one** endpoint — set Anthropic OR LiteLLM, not both. If both are set, Anthropic takes priority.

```
# Anthropic (direct)
ANTHROPIC_API_KEY=sk-ant-

# OR LiteLLM (proxy to Bedrock, Azure, etc.)
LITELLM_BASE_URL=https://your-proxy.com
LITELLM_API_KEY=sk-...

# Shared
OPENAI_API_KEY=sk-proj-
SERPAPI_KEY=
```

## Usage

```bash
microcc /path/to/your/project
```

**Controls:**
- `Enter` — submit prompt
- `Shift+Enter` — newline
- `Escape` — interrupt
- `/clear` — reset conversation
- `/model` — switch model
- `/exit` — quit

## Data

All conversation history and project state is stored in:

```
~/.micro-cc/
  .env                              API keys (you create this)
  projects/
    {project}_{hash}/
      messages.jsonl                conversation history
      summary.json                  sliding-window summary
      project_path.txt              maps hash back to directory
```

## Architecture

```
start_live_.py (CLI)                textual TUI + rich rendering
       │
       │ async for event in claude_loop()
       ▼
claude_loop_.py (Core)              API calls, tool execution, JSONL storage
       │
       │ execute_tool_call()
       ▼
tools/                              bash_, read_, write_, edit_, glob_, grep_
       │
       ▼
~/.micro-cc/projects/{hash}/        conversation persistence
```

**How it works:**
1. CLI starts FileWatcher on project dir, enters prompt loop
2. User query → `claude_loop()` async generator
3. Builds system prompt with project's `CLAUDE.md` + any file changes detected
4. Calls Anthropic API with tool definitions
5. Executes tool calls locally, loops until the model stops calling tools
6. Yields events (`thinking`, `tool_call`, `tool_result`, `final_text`) for CLI to render
7. Saves conversation to JSONL (stripped of thinking blocks for replay)

**Tools:**
| Tool | Description |
|------|-------------|
| `bash_` | Subprocess execution in project_dir, timeout support |
| `read_` | Read files with line numbers, offset/limit |
| `write_` | Create/overwrite files, auto-creates dirs |
| `edit_` | Surgical string replacement (fails if ambiguous) |
| `glob_` | Find files by pattern, sorted by mtime |
| `grep_` | Regex search with context lines |

**Path handling:** Relative paths resolve to `project_dir`, absolute paths work anywhere.

**File watcher:** Detects external changes, injects into system prompt so the model sees what you edited.
