Taskfile.yml•2.78 kB
version: '3'
vars:
UV_RUN: uv run
PYTHONPATH: "{{.TASKFILE_DIR}}/src"
tasks:
dev:
desc: Run the development MCP server
cmd: "{{.UV_RUN}} python -m wanikani_mcp.server --mode stdio"
dev-http:
desc: Run the development HTTP server
cmd: "{{.UV_RUN}} python -m wanikani_mcp.server --mode http --port 8000"
build:
desc: Build the application
cmd: echo "Build complete - Python packages ready"
test:
desc: Run tests
cmd: "{{.UV_RUN}} pytest"
lint:
desc: Run linter and formatter
cmds:
- "{{.UV_RUN}} ruff check ."
- "{{.UV_RUN}} ruff format ."
lint-check:
desc: Check linting without fixing
cmd: "{{.UV_RUN}} ruff check ."
type-check:
desc: Run type checker
cmd: uvx ty check .
db-migrate:
desc: Run database migrations
cmd: "{{.UV_RUN}} alembic upgrade head"
db-create-migration:
desc: Create a new database migration
cmd: "{{.UV_RUN}} alembic revision --autogenerate -m \"{{.CLI_ARGS}}\""
install:
desc: Install dependencies
cmd: uv sync
clean:
desc: Clean build artifacts
cmds:
- rm -rf __pycache__/
- rm -rf .pytest_cache/
- rm -rf .coverage
- find . -name "*.pyc" -delete
check:
desc: Run all checks (lint, type-check, test)
cmds:
- task: lint-check
- task: type-check
- task: test
mcp-connect:
desc: Connect to Claude Code MCP
cmd: 'claude mcp add-json wanikani "{\"command\": \"uv\", \"args\": [\"run\", \"python\", \"-m\", \"wanikani_mcp.server\"], \"env\": {}, \"cwd\": \"{{.PWD}}\"}"'
mcp-verify:
desc: Verify MCP connection
cmd: claude mcp list | grep wanikani || echo "MCP not connected. Run 'task mcp-connect' first."
debug-db:
desc: Open database shell for debugging
env:
PYTHONPATH: "{{.TASKFILE_DIR}}/src"
cmd: "{{.UV_RUN}} python -c 'import sys; sys.path.insert(0, \"src\"); from wanikani_mcp.database import get_engine; from sqlmodel import Session, text; engine = get_engine(); session = Session(engine); print(\"Database connected. Use session.exec(text(\\\"SELECT ...\\\")) for queries\"); import IPython; IPython.embed()'"
debug-leeches:
desc: Debug leech detection query
env:
PYTHONPATH: "{{.TASKFILE_DIR}}/src"
cmd: "{{.UV_RUN}} python -c 'import sys; sys.path.insert(0, \"src\"); from wanikani_mcp.database import get_engine; from wanikani_mcp.models import *; from sqlmodel import Session, select, text; engine = get_engine(); session = Session(engine); print(\"Users:\", session.exec(select(User)).all()); print(\"ReviewStatistics count:\", session.exec(text(\"SELECT COUNT(*) FROM reviewstatistic\")).one()); print(\"Sample ReviewStatistics:\", session.exec(select(ReviewStatistic).limit(5)).all())'"