From eec7633ecdfa5d210aa416822687d2f581aa9a79 Mon Sep 17 00:00:00 2001 From: Vinod Muthusamy Date: Fri, 30 Jan 2026 18:59:29 -0600 Subject: [PATCH 1/2] refactor: move CLI to top-level and clean up configs - Move kaizen/frontend/cli to kaizen/cli - Update .gitignore for .claude directories and kaizen_data - Remove demo workdir config files (.claude/settings.local.json, .mcp.json) - Update pyproject.toml and tests for new CLI location --- .gitignore | 5 ++++- AGENTS.md | 3 ++- README_phoenix_sync.md | 12 ++++++------ demo/workdir/.claude/settings.local.json | 20 -------------------- demo/workdir/.mcp.json | 12 ------------ kaizen/{frontend => }/cli/__init__.py | 0 kaizen/{frontend => }/cli/cli.py | 0 pyproject.toml | 2 +- tests/unit/test_cli.py | 4 ++-- 9 files changed, 15 insertions(+), 43 deletions(-) delete mode 100644 demo/workdir/.claude/settings.local.json delete mode 100644 demo/workdir/.mcp.json rename kaizen/{frontend => }/cli/__init__.py (100%) rename kaizen/{frontend => }/cli/cli.py (100%) diff --git a/.gitignore b/.gitignore index fd4d28af..19210d9a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,7 @@ *.egg-info *.db* .DS_Store -__pycache__ \ No newline at end of file +__pycache__ +kaizen_data +demo/workdir/.claude/ +.claude diff --git a/AGENTS.md b/AGENTS.md index 79b4562c..043780b9 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -64,4 +64,5 @@ pre-commit install ## Coding Standards - Use Ruff for linting and formatting (configured in pyproject.toml) - Run pre-commit hooks before committing -- All new features need tests (unit + e2e where applicable) \ No newline at end of file +- All new features need tests (unit + e2e where applicable) +- Use uv to run Python commands, including pip. diff --git a/README_phoenix_sync.md b/README_phoenix_sync.md index aad70624..e48b238a 100644 --- a/README_phoenix_sync.md +++ b/README_phoenix_sync.md @@ -32,20 +32,20 @@ No additional dependencies required - uses only stdlib for Phoenix API calls. ```bash # Basic sync with defaults -uv run python -m kaizen.frontend.cli.cli sync phoenix +uv run python -m kaizen.cli.cli sync phoenix # Custom Phoenix URL and namespace -uv run python -m kaizen.frontend.cli.cli sync phoenix \ +uv run python -m kaizen.cli.cli sync phoenix \ --url http://phoenix.example.com:6006 \ --namespace my_namespace # Fetch more spans and include errors -uv run python -m kaizen.frontend.cli.cli sync phoenix \ +uv run python -m kaizen.cli.cli sync phoenix \ --limit 500 \ --include-errors # Full options -uv run python -m kaizen.frontend.cli.cli sync phoenix \ +uv run python -m kaizen.cli.cli sync phoenix \ --url http://localhost:6006 \ --namespace production \ --project my_project \ @@ -145,7 +145,7 @@ Two entity types are stored: ```bash # Sync every hour -0 * * * * cd /path/to/kaizen && uv run python -m kaizen.frontend.cli.cli sync phoenix --limit 100 +0 * * * * cd /path/to/kaizen && uv run python -m kaizen.cli.cli sync phoenix --limit 100 ``` ### Systemd Timer @@ -158,7 +158,7 @@ Description=Kaizen Phoenix Sync [Service] Type=oneshot WorkingDirectory=/path/to/kaizen -ExecStart=/path/to/uv run python -m kaizen.frontend.cli.cli sync phoenix +ExecStart=/path/to/uv run python -m kaizen.cli.cli sync phoenix Environment=PHOENIX_URL=http://localhost:6006 Environment=KAIZEN_NAMESPACE_ID=production ``` diff --git a/demo/workdir/.claude/settings.local.json b/demo/workdir/.claude/settings.local.json deleted file mode 100644 index 61d29ae5..00000000 --- a/demo/workdir/.claude/settings.local.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "permissions": { - "allow": [ - "mcp__guidelines__get_guidelines", - "mcp__filesystem__list_allowed_directories", - "mcp__filesystem__search_files", - "mcp__filesystem__read_text_file", - "mcp__guidelines__save_trajectory", - "mcp__filesystem__list_directory", - "mcp__filesystem__write_file" - ], - "deny": [ - "Read(../demo/**)" - ] - }, - "enabledMcpjsonServers": [ - "filesystem", - "guidelines" - ] -} \ No newline at end of file diff --git a/demo/workdir/.mcp.json b/demo/workdir/.mcp.json deleted file mode 100644 index 5b6487ee..00000000 --- a/demo/workdir/.mcp.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "mcpServers": { - "filesystem": { - "type": "sse", - "url": "http://localhost:8202/sse" - }, - "guidelines": { - "type": "sse", - "url": "http://localhost:8201/sse" - } - } -} diff --git a/kaizen/frontend/cli/__init__.py b/kaizen/cli/__init__.py similarity index 100% rename from kaizen/frontend/cli/__init__.py rename to kaizen/cli/__init__.py diff --git a/kaizen/frontend/cli/cli.py b/kaizen/cli/cli.py similarity index 100% rename from kaizen/frontend/cli/cli.py rename to kaizen/cli/cli.py diff --git a/pyproject.toml b/pyproject.toml index 78d4c8c5..394c3477 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,7 @@ examples = [ ] [project.scripts] -kaizen = "kaizen.frontend.cli.cli:app" +kaizen = "kaizen.cli.cli:app" [dependency-groups] dev = [ diff --git a/tests/unit/test_cli.py b/tests/unit/test_cli.py index 431367f5..addfe214 100644 --- a/tests/unit/test_cli.py +++ b/tests/unit/test_cli.py @@ -6,7 +6,7 @@ import pytest from typer.testing import CliRunner -from kaizen.frontend.cli.cli import app +from kaizen.cli.cli import app from kaizen.schema.core import Namespace, RecordedEntity from kaizen.schema.conflict_resolution import EntityUpdate from kaizen.schema.exceptions import ( @@ -22,7 +22,7 @@ @pytest.fixture def mock_client(): """Create a mock KaizenClient.""" - with patch("kaizen.frontend.cli.cli.get_client") as mock_get_client: + with patch("kaizen.cli.cli.get_client") as mock_get_client: client = MagicMock() mock_get_client.return_value = client yield client From 69c80487705f890e5c5a3dce1feb3dda14e66612 Mon Sep 17 00:00:00 2001 From: Vinod Muthusamy Date: Fri, 30 Jan 2026 19:08:07 -0600 Subject: [PATCH 2/2] docs: update AGENTS.md directory tree for CLI move Move cli from frontend subdirectory to kaizen top-level in the project directory tree documentation. --- AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 043780b9..f4e3c2dc 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -25,10 +25,10 @@ Kaizen is a Python library and service which enables AI agents to improve throug │   └── claudecode ├── kaizen (Primary Source Root) │   ├── backend (Entity Database Backend implementations, primarily vector databases) +│ ├── cli (A CLI wrapper over the native Python client) │   ├── config (All configurations which are derived from environment variables or instantiated as an object) │   ├── db (A sqlite database for when vector databases are a poor fit for the data) │   ├── frontend (Interfaces to interact with the backend) -│   │   ├── cli (A CLI wrapper over the native Python client) │   │   ├── client (A native Python client which thinly wraps the configured backend) │   │   └── mcp (An MCP server implementing some high-level methods useful for AI agents) │   ├── llm (All code that prompts an LLM)