Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Describe the bug clearly.

- OS:
- Go version:
- Python version (if examples are involved):
- MailCLI version or commit:

## Evidence

Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Describe the change in 2-5 sentences.
- [ ] Tests were added or updated where behavior changed
- [ ] `go test ./...` passes locally
- [ ] `go build ./cmd/mailcli` passes locally
- [ ] Python examples still compile when touched
- [ ] Go examples and demo artifacts were updated when touched
- [ ] User-facing docs were updated when contracts or workflows changed
- [ ] English and Chinese docs were both updated when needed

Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ jobs:
with:
go-version-file: go.mod

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Run Go tests
run: make test

Expand All @@ -30,7 +25,3 @@ jobs:

- name: Check local thread demo artifacts
run: make demo-local-thread-check

- name: Verify Python examples compile
run: |
python3 -m py_compile $(find examples/python -name '*.py' -print) $(find examples/providers -name '*.py' -print)
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ The goal is not to become a traditional terminal mail client. The goal is to bui
```bash
go test ./...
go build ./cmd/mailcli
python3 -m py_compile examples/python/*.py examples/providers/*.py
go test ./examples
make demo-local-thread-check
```

## Pull Requests
Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTING.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ MailCLI 是一个开源的 AI Native 邮件接口项目。
```bash
go test ./...
go build ./cmd/mailcli
python3 -m py_compile examples/python/*.py examples/providers/*.py
go test ./examples
make demo-local-thread-check
```

## Pull Request 请包含
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ test:
go test ./...

demo-local-thread-refresh: build
PYTHONDONTWRITEBYTECODE=1 python3 examples/python/refresh_local_thread_demo.py \
go run ./examples/go/refresh_local_thread_demo \
--mailcli-bin $(MAILCLI_BIN) \
--config $(FIXTURES_CONFIG) \
--account $(FIXTURES_ACCOUNT) \
--index $(FIXTURES_INDEX) \
--output-dir $(LOCAL_THREAD_DEMO_DIR)

demo-local-thread-check: build
PYTHONDONTWRITEBYTECODE=1 python3 examples/python/refresh_local_thread_demo.py \
go run ./examples/go/refresh_local_thread_demo \
--mailcli-bin $(MAILCLI_BIN) \
--config $(FIXTURES_CONFIG) \
--account $(FIXTURES_ACCOUNT) \
Expand Down
25 changes: 15 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ go build -o mailcli ./cmd/mailcli
./mailcli threads --index /tmp/mailcli-fixtures-index.db invoice

# 3. inspect the full agent boundary
python3 examples/python/agent_thread_assistant.py \
go run ./examples/go/agent_thread_assistant \
--mailcli-bin ./mailcli \
--config examples/config/fixtures-dir.yaml \
--account fixtures \
Expand All @@ -91,7 +91,7 @@ The repository already includes:

- a local fixture corpus under `testdata/emails`
- a zero-network config at `examples/config/fixtures-dir.yaml`
- runnable Python examples
- runnable Go examples under `examples/go`
- a full local round-trip demo at [Local Thread Demo](docs/en/examples/local-thread-demo.md)
- fixed outbound JSON and MIME pairs at [Outbound Draft Patterns](docs/en/examples/outbound-draft-patterns.md)

Expand Down Expand Up @@ -127,8 +127,8 @@ Working today:
- delete, move, mark-read/unread on remote mailboxes
- export the local index as JSONL, JSON, or CSV
- **watch** one or more mailboxes with IMAP IDLE push (streaming JSONL event feed, persistent seen state across restarts)
- manage config with `mailcli config show` / `mailcli config test`
- integrate with Python or shell agent workflows through stable JSON contracts
- create, inspect, diagnose, test, and inspect account capabilities with `mailcli config init` / `mailcli config show` / `mailcli config doctor` / `mailcli config test` / `mailcli config capabilities`
- integrate with Go, shell, and external agent workflows through stable JSON contracts
- LLM tool-use schemas for OpenAI and Anthropic (`tools/` directory)

Stable enough to build against for `v0.1 RC`:
Expand All @@ -147,7 +147,7 @@ Stable enough to build against for `v0.1 RC`:
- `mailcli mark`
- `mailcli export`
- `mailcli watch`
- `mailcli config show|test`
- `mailcli config init|show|doctor|test|capabilities`
- `StandardMessage`
- `DraftMessage`
- `ReplyDraft`
Expand Down Expand Up @@ -268,13 +268,18 @@ MailCLI solves that by providing a stable boundary:
```bash
# Pipe to AI agent with persistent deduplication:
mailcli watch --account work --index ~/.config/mailcli/index.db \
| python3 tools/agent_example.py
| go run ./examples/go/watch_reply_agent --from-address support@nono.im
```

### Config management

- `mailcli config init [--config] --account <name> --driver imap --host <host> --username <email> --password-env <ENV>` — create a starter config file that stores secret environment references such as `${MAILCLI_IMAP_PASSWORD}`, not raw passwords
- `mailcli config show [--config]` — print accounts (passwords redacted)
- `mailcli config doctor [--config]` — run local static diagnostics without connecting to IMAP or SMTP
- `mailcli config test [--config] [--account]` — test live connection
- `mailcli config capabilities [--config] [--account]` — print machine-readable account capabilities without connecting to the mailbox server

`config init`, `config doctor`, and `config capabilities` are safe onboarding commands for agents and setup scripts. They do not print configured password values. `config doctor` distinguishes missing secret references from unset environment variables such as `imap_password_env_unset`. `config test` is the command that performs a live mailbox connection check.

### Outbound Markdown baseline

Expand Down Expand Up @@ -461,7 +466,7 @@ cat test.eml | mailcli parse --format json -
If you want the full agent-side JSON and reply boundary, use:

```bash
python3 examples/python/agent_thread_assistant.py \
go run ./examples/go/agent_thread_assistant \
--mailcli-bin ./mailcli \
--config examples/config/fixtures-dir.yaml \
--account fixtures \
Expand All @@ -470,7 +475,7 @@ python3 examples/python/agent_thread_assistant.py \
--query invoice
```

If you want fixed JSON and MIME pairs for outbound composition without reading Python code, use:
If you want fixed JSON and MIME pairs for outbound composition without reading example code, use:

```bash
./mailcli reply --config examples/config/fixtures-dir.yaml --account fixtures --dry-run examples/artifacts/outbound-patterns/ack-reply.draft.json
Expand Down Expand Up @@ -561,15 +566,15 @@ mailcli reply --dry-run reply.json
### Run the agent example

```bash
python3 examples/python/agent_inbox_assistant.py \
go run ./examples/go/agent_inbox_assistant \
--mailcli-bin ./mailcli \
--email testdata/emails/verification.eml
```

### Run the thread agent example

```bash
python3 examples/python/agent_thread_assistant.py \
go run ./examples/go/agent_thread_assistant \
--mailcli-bin ./mailcli \
--config ~/.config/mailcli/config.yaml \
--account work \
Expand Down
28 changes: 19 additions & 9 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ go build -o mailcli ./cmd/mailcli
./mailcli threads --index /tmp/mailcli-fixtures-index.db invoice

# 3. 查看完整的 agent 边界
python3 examples/python/agent_thread_assistant.py \
go run ./examples/go/agent_thread_assistant \
--mailcli-bin ./mailcli \
--config examples/config/fixtures-dir.yaml \
--account fixtures \
Expand All @@ -91,7 +91,7 @@ flowchart LR

- `testdata/emails` 下的本地 fixture 语料
- 零网络配置 `examples/config/fixtures-dir.yaml`
- 可直接运行的 Python 示例
- `examples/go` 下可直接运行的 Go 示例
- 一份完整的本地往返说明:[Local Thread Demo](docs/zh-CN/examples/local-thread-demo.md)
- 一组固定的出站 JSON / MIME 对照样例:[Outbound Draft Patterns](docs/zh-CN/examples/outbound-draft-patterns.md)

Expand Down Expand Up @@ -127,8 +127,8 @@ MailCLI 当前处于 **pre-v0.1 release candidate** 阶段。
- 删除、移动、读/未读标记远端邮件
- 将本地索引导出为 JSONL、JSON 或 CSV
- **watch** 一个或多个邮箱(IMAP IDLE 推送事件流,重启后持久化去重)
- `mailcli config show` / `mailcli config test` 管理配置
- 通过稳定 JSON 契约与 Python / shell agent 工作流协作
- `mailcli config init` / `mailcli config show` / `mailcli config doctor` / `mailcli config test` / `mailcli config capabilities` 创建、查看、诊断、测试配置与账户能力
- 通过稳定 JSON 契约与 Go、shell 和外部 agent 工作流协作
- OpenAI 和 Anthropic 格式的 LLM Tool Use Schema(`tools/` 目录)

在 `v0.1 RC` 阶段,已经足够作为稳定集成边界的部分:
Expand All @@ -147,7 +147,7 @@ MailCLI 当前处于 **pre-v0.1 release candidate** 阶段。
- `mailcli mark`
- `mailcli export`
- `mailcli watch`
- `mailcli config show|test`
- `mailcli config init|show|doctor|test|capabilities`
- `StandardMessage`
- `DraftMessage`
- `ReplyDraft`
Expand Down Expand Up @@ -254,6 +254,16 @@ MailCLI 提供的是一个稳定边界:
- `mailcli reply --dry-run <reply.json>`
- `mailcli reply --config ~/.config/mailcli/config.yaml <reply.json>`

### 配置与能力发现

- `mailcli config init [--config] --account <name> --driver imap --host <host> --username <email> --password-env <ENV>`
- `mailcli config show [--config]`
- `mailcli config doctor [--config]`
- `mailcli config test [--config] [--account]`
- `mailcli config capabilities [--config] [--account]`

`config init` 会生成 starter YAML,并把秘密值写成 `${MAILCLI_IMAP_PASSWORD}` 这样的环境变量引用,而不是原始密码。`config doctor` 做本地静态诊断,不连接 IMAP / SMTP,并能区分“没有写 secret 引用”和“引用存在但环境变量未设置”,例如 `imap_password_env_unset`。`config capabilities` 输出稳定 JSON,帮助 Agent 在执行 `send`、`watch`、`delete` 等命令前判断当前账户能力。它只读取本地配置和内置 driver 的已知能力,不连接邮箱服务器,也不输出密码。真正联网检查连接的是 `config test`。

### 出站 Markdown 基线

- 标题
Expand Down Expand Up @@ -438,7 +448,7 @@ cat test.eml | mailcli parse --format json -
如果你想直接看 agent 侧完整 JSON 和 reply 边界,可以运行:

```bash
python3 examples/python/agent_thread_assistant.py \
go run ./examples/go/agent_thread_assistant \
--mailcli-bin ./mailcli \
--config examples/config/fixtures-dir.yaml \
--account fixtures \
Expand All @@ -447,7 +457,7 @@ python3 examples/python/agent_thread_assistant.py \
--query invoice
```

如果你想在不读 Python 示例的情况下直接查看固定的出站 JSON / MIME 对照,可以运行:
如果你想在不读示例代码的情况下直接查看固定的出站 JSON / MIME 对照,可以运行:

```bash
./mailcli reply --config examples/config/fixtures-dir.yaml --account fixtures --dry-run examples/artifacts/outbound-patterns/ack-reply.draft.json
Expand Down Expand Up @@ -538,15 +548,15 @@ mailcli reply --dry-run reply.json
### 运行 agent 示例

```bash
python3 examples/python/agent_inbox_assistant.py \
go run ./examples/go/agent_inbox_assistant \
--mailcli-bin ./mailcli \
--email testdata/emails/verification.eml
```

### 运行 thread agent 示例

```bash
python3 examples/python/agent_thread_assistant.py \
go run ./examples/go/agent_thread_assistant \
--mailcli-bin ./mailcli \
--config ~/.config/mailcli/config.yaml \
--account work \
Expand Down
Loading
Loading