Metadata-Version: 2.4
Name: meeting-ink-cli
Version: 0.1.0
Summary: Agent-friendly CLI for Meeting Ink — transcription, summaries, and translations
Author: weirenlan
License-Expression: MIT
Keywords: agent,cli,mcp,meeting,summary,transcription,translation
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
Requires-Python: >=3.12
Requires-Dist: browser-cookie3>=0.19
Requires-Dist: click>=8.0
Requires-Dist: httpx>=0.27
Requires-Dist: rich>=13.0
Provides-Extra: audio
Requires-Dist: mutagen>=1.47; extra == 'audio'
Provides-Extra: mcp
Requires-Dist: mcp>=1.0; extra == 'mcp'
Description-Content-Type: text/markdown

# meeting-ink-cli

Agent-friendly CLI for [Meeting Ink](https://ink.dwave.cc) — transcription, summaries, and translations.

Designed for both human users and AI agents (Claude Code, Codex, etc.).

## Installation

### uv (recommended)

```sh
uv tool install meeting-ink-cli
uv tool install 'meeting-ink-cli[audio]'      # audio duration detection
uv tool install 'meeting-ink-cli[mcp]'        # MCP server mode
uv tool install 'meeting-ink-cli[audio,mcp]'  # everything
```

### Homebrew

```sh
brew tap DeepWaveLab/mi_cli https://github.com/DeepWaveLab/mi_cli
brew install meeting-ink-cli
```

### pip

```sh
pip install meeting-ink-cli
pip install 'meeting-ink-cli[audio]'      # audio duration detection
pip install 'meeting-ink-cli[mcp]'        # MCP server mode
```

## Update

```sh
# uv
uv tool upgrade meeting-ink-cli

# Homebrew
brew update && brew upgrade meeting-ink-cli

# pip
pip install --upgrade meeting-ink-cli
```

## Quick Start

```sh
# Authenticate (auto-extract from browser cookies)
meeting-ink auth

# Or paste token directly / from stdin
meeting-ink auth eyJhbG...
echo $TOKEN | meeting-ink auth -

# List meetings
meeting-ink list

# Show meeting details
meeting-ink show 123

# View transcript
meeting-ink transcript 123

# Generate summary
meeting-ink summary 123 --generate --language zh-TW

# Translate transcript
meeting-ink translate 123 -l en

# Download artifacts
meeting-ink download 123 -t summary -o summary.md

# Upload audio for transcription
meeting-ink upload recording.mp3

# Import from YouTube
meeting-ink from-url "https://youtube.com/watch?v=..."

# Check quota
meeting-ink quota
```

## Commands

| Command | Description |
|---------|-------------|
| `auth [token]` | Save API token (stdin `-`, browser auto-extract, or interactive prompt) |
| `whoami` | Show user info and subscription |
| `quota` | Show transcription quota and usage |
| `list` | List meetings (`--page`, `--all`, `--limit`) |
| `show <id>` | Meeting detail with transcripts, summaries, translations |
| `upload <file>` | Upload audio file (`--duration`, `--name`, `--wait`) |
| `from-url <url>` | Import from YouTube/podcast URL |
| `transcript <id>` | View transcript (`--output` to save to file) |
| `summary <id>` | View/generate summary (`--topic`, `--template`, `--language`, `--generate`) |
| `translate <id>` | View/generate translation (`-l` language required) |
| `download <id>` | Download artifacts (`-t` type, `--output`, `--language`, `--force`) |
| `rename <id> <name>` | Rename a meeting |
| `delete <id>` | Delete a meeting (`--force` for non-interactive) |
| `serve` | Start MCP server on stdio |

## Transcripts, Summaries & Translations

```sh
# View transcript (checks meeting status first)
meeting-ink transcript 123
meeting-ink transcript 123 -o transcript.json

# View existing summary (pinned first, then most recent)
meeting-ink summary 123

# Generate new summary with template and language
meeting-ink summary 123 --generate --template standup --language en
meeting-ink summary 123 --topic "Action items" --per-speaker

# Translate transcript to another language
meeting-ink translate 123 -l en
meeting-ink translate 123 -l ja --no-wait

# Download any artifact
meeting-ink download 123 -t recording -o meeting.mp3
meeting-ink download 123 -t transcript -o transcript.json
meeting-ink download 123 -t summary -o summary.md
meeting-ink download 123 -t translation -l en -o translation.json
```

### Summary Templates

`general_meeting` (default), `standup`, `one_on_one`, `project_team_meeting`, `investor_update`, `expert_consultation`, `customer_discovery`, `customer_qbr`, `business_progress`, `bant`, `project_kickoff`, `user_research`, `ideate`, `issue_resolution`

### Supported Languages

`en-US`, `zh-TW`, `ja-JP`, `de-DE`, `fr-FR`, `ru-RU`, `es-ES`, `it-IT`, `th-TH`

Shortcuts: `en`, `zh`, `ja`, `de`, `fr`, `ru`, `es`, `it`, `th`

## Upload

Supported formats: mp3, wav, m4a, aac, ogg, flac, wma, webm.

Files over 50 MB are automatically chunked. Maximum file size: 2 GB.

```sh
# With automatic duration detection (requires mutagen)
meeting-ink upload recording.mp3

# Manual duration (seconds) if mutagen not installed
meeting-ink upload recording.mp3 --duration 3600

# Custom name, don't wait for transcription
meeting-ink upload recording.mp3 --name "Team standup" --no-wait
```

## Agent Usage

All commands support `--json` for machine-readable output:

```sh
meeting-ink list --json
# {"ok": true, "data": {"total": 5, "data": [...]}}

meeting-ink transcript 123 --json
# {"ok": true, "data": {"meeting_id": 123, "content": [...]}}

meeting-ink summary 123 --generate --json
# {"ok": true, "data": {"meeting_id": 123, "summary_id": 456, "content": "..."}}
```

Use `--help-json` for structured command metadata:

```sh
meeting-ink --help-json         # all commands
meeting-ink summary --help-json # command params
```

### Environment Variables

| Variable | Description |
|----------|-------------|
| `MEETING_INK_TOKEN` | Auth token (takes precedence over config file) |
| `MEETING_INK_OUTPUT` | Force output mode: `json` or `human` |

### Output Format

```json
{"ok": true, "data": ...}
{"ok": false, "error": {"code": "auth_error", "message": "..."}}
```

### Exit Codes

| Code | Meaning |
|------|---------|
| 0 | Success |
| 1 | API error (4xx/5xx) |
| 2 | Validation error (bad input, missing token) |
| 3 | Network error (timeout, unreachable) |

## MCP Server

Run as a Model Context Protocol server for AI agent integration:

```sh
uv pip install 'meeting-ink-cli[mcp]'
meeting-ink serve
```

## Configuration

Token is stored at `~/.config/meeting-ink/config.json` with 0600 permissions.

The `MEETING_INK_TOKEN` environment variable takes precedence over the config file.

## Development

```sh
git clone <repo>
cd mi_cli
uv sync

# Run tests
uv run pytest -v

# Run linting
uv run ruff check mi_cli/ tests/
uv run ruff format --check mi_cli/ tests/

# Run integration tests (requires MEETING_INK_TOKEN)
MEETING_INK_TOKEN=... uv run pytest -m integration
```

## Architecture

```
mi_cli/
  cli.py        # Click commands (14 commands)
  client.py     # httpx API client (cookie auth, retry, rate limit)
  config.py     # Token storage, browser cookie extraction
  output.py     # JSON envelope, TTY detection, Rich tables
  validate.py   # Input sanitization, language validation
  upload.py     # Azure Blob upload (single + chunked)
  polling.py    # Adaptive polling for async operations
  help_json.py  # --help-json for agent discoverability
  serve.py      # MCP server (optional)
```

## License

MIT
