Metadata-Version: 2.4
Name: donelog
Version: 0.1.1
Summary: Automatically record what your AI coding agent did as tasks, and search them later.
Author: pham2006-ux
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development
Requires-Dist: mcp>=2.3.0
Requires-Dist: typer>=0.29.3
Requires-Dist: typing-extensions>=4.12
Requires-Dist: anthropic>=2.16.0 ; extra == 'api'
Requires-Python: >=3.11
Project-URL: Homepage, https://github.com/pham2006-ux/donelog
Project-URL: Documentation, https://github.com/pham2006-ux/donelog/blob/main/docs/cli.md
Project-URL: Issues, https://github.com/pham2006-ux/donelog/issues
Project-URL: Changelog, https://github.com/pham2006-ux/donelog/blob/main/CHANGELOG.md
Provides-Extra: api
Description-Content-Type: text/markdown

# donelog

[日本語版 README](https://github.com/pham2006-ux/donelog/blob/main/README.ja.md)

<!-- Demo GIF goes here: ![demo](docs/demo.gif) -->

> **Status:** under development. v0.1.0 is not released yet.

- donelog records each piece of work your AI coding agent (Claude Code) does as a **task**, automatically, through MCP.
- You can list and search those tasks later by keyword or status. Short Japanese words such as 「認証」 work too.
- You can ask in plain words, like "Is the login feature done?", and get an answer backed by real task IDs.

## Guides

| Guide | For |
| --- | --- |
| [CLI guide](https://github.com/pham2006-ux/donelog/blob/main/docs/cli.md) ([日本語](https://github.com/pham2006-ux/donelog/blob/main/docs/cli.ja.md)) | Using donelog in a terminal, step by step |
| [VS Code extension guide](https://github.com/pham2006-ux/donelog/blob/main/docs/vscode.md) ([日本語](https://github.com/pham2006-ux/donelog/blob/main/docs/vscode.ja.md)) | Using donelog from the sidebar of VS Code or Cursor |

## Installation

You need [uv](https://docs.astral.sh/uv/) and Python 3.11 or later. donelog is not on PyPI yet, so install it from the repository:

```sh
git clone https://github.com/pham2006-ux/donelog.git
cd donelog
uv tool install .
```

Check that it works (open a new terminal first):

```sh
donelog --version
```

If the command is not found, run `uv tool update-shell` and open a new terminal.

## Quick start

Run these in the folder of the project you want to track:

```sh
donelog init                      # create .donelog/ and add instructions to CLAUDE.md
donelog add "Write the README"    # add a task by hand
donelog list                      # newest first
donelog search 認証               # keyword search
donelog done T-0001               # mark as done
donelog status T-0001 todo        # change the status (todo, in_progress, done)
donelog edit T-0001 --title "Write the README (EN)"   # change what a task says
donelog delete T-0001             # delete for good (asks first)
```

## Connect to Claude Code

The easiest way is to let donelog do it. Run this **in your project folder**:

```sh
donelog init --connect-claude
```

This runs `claude mcp add` for you. You can also run it yourself: `donelog init` prints the exact command for your machine, for example:

```sh
claude mcp add --scope local donelog -- /home/you/.local/bin/donelog mcp
```

The server is registered for that project only (the `local` scope).
Then restart Claude Code and check the connection:

```sh
claude mcp list
```

You should see `donelog: ... ✓ Connected`. From now on, Claude Code records its work with the `add_task` and `update_task` tools, following the instructions that `donelog init` added to `CLAUDE.md`.

If something is missing, `donelog doctor` checks the whole setup and tells you how to fix each problem.

### Windows notes

- Use PowerShell or the VS Code terminal. Run the commands one by one.
- If you run donelog from a clone with `uv run` instead of `uv tool install`, `donelog init` prints a command with the full path to Python, for example:

  ```powershell
  claude mcp add --scope local donelog -- "C:\path\to\donelog\.venv\Scripts\python.exe" -m donelog mcp
  ```

- Claude Code treats `C:\work` and `c:\work` as different folders. Terminals use `C:`, but VS Code uses `c:`. `donelog init --connect-claude` registers both, so Claude Code finds donelog wherever you start it.
- To remove the registration: `claude mcp remove donelog`

## VS Code extension

The [vscode-extension/](https://github.com/pham2006-ux/donelog/tree/main/vscode-extension/) folder has a VS Code extension that shows the tasks in the sidebar, updates live while Claude Code works, and lets you search, ask, add, complete and export tasks. It uses the `donelog` command above, so install that first.
It is not on the Marketplace yet. To try it, build and install it from the repository (you need Node.js 20 or later):

```sh
cd vscode-extension
npm ci
npx vsce package --no-dependencies
code --install-extension donelog-0.1.0.vsix
```

See the [VS Code extension guide](https://github.com/pham2006-ux/donelog/blob/main/docs/vscode.md) for a step-by-step walkthrough, and [vscode-extension/README.md](https://github.com/pham2006-ux/donelog/blob/main/vscode-extension/README.md) for a summary.

## Ask in plain words (AI search)

```sh
donelog ask "Is the login feature done?"
```

```text
Answer: Done
The login form was added in T-0003 and its tests in T-0007.

Evidence:
  T-0003  done         Add the login form                        2026-12-02 14:36
  T-0007  done         Add login tests                           2026-12-02 15:10
```

The answer is one of **Done**, **In progress**, **Not started** or **Not recorded**, with the IDs of the tasks it is based on.
donelog only shows IDs that really exist in your task log; anything else the AI returns is removed.
With many tasks, donelog first picks the 100 most related (by keywords and newness) and sends only those.

### Inside Claude Code (no extra cost)

When you are already in Claude Code, just ask it, for example "Is the login feature done?".
Claude Code answers with the `search_tasks` tool, so no extra AI call is made.

### Choosing the AI (backend)

`donelog ask` uses the backend set in `.donelog/config.json`:

```json
{"ask_backend": "claude-code", "model": null}
```

| `ask_backend` | How it works | Cost |
| --- | --- | --- |
| `claude-code` (default) | Runs your installed Claude Code in non-interactive mode (`claude -p`) | Included in your Claude Pro/Max plan |
| `anthropic-api` | Calls the Anthropic API | Pay per use |

You can also choose per question: `donelog ask --backend anthropic-api "..."`.
`model` is optional; `null` means Claude Code's default model, or `claude-opus-5-5` for the API.

**claude-code:** donelog removes `ANTHROPIC_API_KEY` from the environment of the Claude Code it starts, so the question is always answered within your plan, never billed to an API key.

**anthropic-api:** install the optional package and set the key in an environment variable named `DONELOG_ANTHROPIC_API_KEY` (not `ANTHROPIC_API_KEY`: if that one is set, Claude Code itself switches from your plan to API billing; see [this support article](https://support.claude.com/en/articles/11145838-use-claude-code-with-your-pro-or-max-plan)).

```powershell
uv tool install --reinstall ".[api]"
$env:DONELOG_ANTHROPIC_API_KEY = "sk-ant-..."   # this terminal only
```

donelog never creates or reads `.env` files.

## Commands

| Command | What it does |
| --- | --- |
| `donelog init [--connect-claude]` | Create `.donelog/`, add it to `.gitignore`, add instructions to `CLAUDE.md` (asks first), and register the MCP server with Claude Code (`--connect-claude`) or show how to |
| `donelog add "title"` | Add a task by hand (`-m` summary, `--status`, `-f` file, `-t` tag) |
| `donelog list [--status S]` | List tasks, newest first |
| `donelog search WORDS [--status S]` | Search the title, summary, files and tags. Every word must match |
| `donelog show ID` | Show one task |
| `donelog done ID` | Mark a task as done |
| `donelog status ID... STATUS` | Change the status of one or more tasks to `todo`, `in_progress` or `done` (also back from done). All or nothing |
| `donelog edit ID` | Change a task's title (`--title`), summary (`-m`), status, files (`-f`, `--no-files`) or tags (`-t`, `--no-tags`). Options you leave out keep their value |
| `donelog delete ID... [--yes]` | Delete tasks for good. Asks first unless `--yes`. All or nothing; deleted IDs are never reused |
| `donelog ask "question" [--backend B]` | AI search: answer from the task log |
| `donelog export [--format md\|json] [-o FILE]` | Export all tasks |
| `donelog doctor` | Check the setup (project, task log, AI settings, CLAUDE.md, Claude Code connection) and show how to fix problems |
| `donelog mcp` | Start the MCP server (Claude Code runs this) |

Status is one of `todo`, `in_progress`, `done` (or `all` for filters). IDs look like `T-0001`; `1` also works.

### JSON output for scripts and editors

Add `--json` to `init`, `add`, `list`, `search`, `show`, `done`, `status`, `edit`, `delete`, `ask`, `doctor` or `export -o FILE` to get exactly one line of JSON. The VS Code extension uses this.

```json
{"ok": true, "data": {"count": 1, "truncated": false, "tasks": [{"display_id": "T-0001", "title": "...", "status": "done"}]}}
{"ok": false, "error": {"code": "not_initialized", "message": "..."}}
```

Error codes: `not_initialized`, `not_found`, `invalid`, `config`, `ask_failed`, `database`, `io`, `conflict`. The exit code is 1 when `ok` is false. With `--json`, `init` never asks questions: add `--yes` to update `CLAUDE.md`. Likewise `delete --json` needs `--yes`. `status` returns `results` with one `{task, changed, before}` per ID (and `task`/`changed` for the first one); `edit` returns `{task, changed, before}`, where `before` is the task as it was (the VS Code extension uses it for Undo); `delete` returns `deleted`, the list of deleted tasks.

## MCP tools

| Tool | What it does |
| --- | --- |
| `add_task` | Add a task (title, summary, status, files, tags). If a todo or in-progress task has the same title, that task is moved on instead (never back), keeping its summary |
| `update_task` | Change the status and/or summary |
| `search_tasks` | Search by keywords and status |
| `list_tasks` | List tasks, newest first |
| `get_task` | Get one task |
| `add_todo_tasks` | Add several todo tasks at once, for example from a requirements document. Titles that already exist are skipped |
| `list_unverified_tasks` | List done tasks that no AI has checked yet |
| `verify_task` | Record whether a done task is really finished. If it is not, the task goes back to in progress with a note |

### Planning and checking

- **From a requirements document to tasks.** Give Claude Code your requirements document and ask for tasks. It shows the list first, and after you agree, it registers every item as a todo task.
- **Checking done tasks.** Before its first change in a session, Claude Code checks the done tasks that nobody has checked yet. A task that is really finished is marked *verified*. A task that is not finished goes back to *in progress* with a note, and Claude Code asks you before it fixes anything.

## Data and privacy

- Tasks are stored in `.donelog/donelog.db` (SQLite) inside your project. There is no telemetry.
- Everything except `donelog ask` works offline and sends nothing.
- **`donelog ask` sends your question and up to 100 tasks (titles, summaries, file names, tags) to Claude**, through Claude Code or the Anthropic API, depending on the backend.
- `donelog init` adds `.donelog/` to `.gitignore`. To share tasks with your team, commit an export instead: `donelog export --format md -o DONELOG.md`.

## Development

```sh
uv sync --all-extras  # install dependencies (including the optional anthropic package)
uv run pytest         # run the tests
uv run ruff check .   # lint
uv run ruff format .  # format
```

## Contributing

Bug reports and ideas are welcome. See [CONTRIBUTING.md](https://github.com/pham2006-ux/donelog/blob/main/CONTRIBUTING.md). Changes are listed in [CHANGELOG.md](https://github.com/pham2006-ux/donelog/blob/main/CHANGELOG.md).

## License

[MIT](https://github.com/pham2006-ux/donelog/blob/main/LICENSE)
