wcgw 3.0.6__tar.gz → 4.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of wcgw might be problematic. Click here for more details.

Files changed (129) hide show
  1. {wcgw-3.0.6 → wcgw-4.0.0}/.github/workflows/python-tests.yml +1 -2
  2. {wcgw-3.0.6 → wcgw-4.0.0}/Dockerfile +20 -4
  3. {wcgw-3.0.6 → wcgw-4.0.0}/PKG-INFO +59 -15
  4. {wcgw-3.0.6 → wcgw-4.0.0}/README.md +58 -13
  5. {wcgw-3.0.6 → wcgw-4.0.0}/gpt_action_json_schema.json +39 -116
  6. {wcgw-3.0.6 → wcgw-4.0.0}/gpt_instructions.txt +12 -11
  7. {wcgw-3.0.6 → wcgw-4.0.0}/pyproject.toml +1 -2
  8. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw/client/bash_state/bash_state.py +182 -13
  9. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw/client/diff-instructions.txt +29 -15
  10. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw/client/file_ops/diff_edit.py +2 -1
  11. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw/client/file_ops/search_replace.py +37 -21
  12. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw/client/memory.py +5 -2
  13. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw/client/modes.py +7 -7
  14. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw/client/repo_ops/display_tree.py +3 -3
  15. wcgw-4.0.0/src/wcgw/client/repo_ops/file_stats.py +152 -0
  16. wcgw-4.0.0/src/wcgw/client/repo_ops/repo_context.py +266 -0
  17. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw/client/tool_prompts.py +13 -16
  18. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw/client/tools.py +500 -89
  19. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw/relay/serve.py +8 -52
  20. wcgw-4.0.0/src/wcgw/types_.py +233 -0
  21. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw_cli/anthropic_client.py +1 -1
  22. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw_cli/openai_client.py +1 -1
  23. wcgw-4.0.0/static/workflow-demo.gif +0 -0
  24. {wcgw-3.0.6 → wcgw-4.0.0}/tests/test_edit.py +27 -19
  25. wcgw-4.0.0/tests/test_file_range_tracking.py +144 -0
  26. {wcgw-3.0.6 → wcgw-4.0.0}/tests/test_mcp_server.py +6 -7
  27. wcgw-4.0.0/tests/test_readfiles.py +89 -0
  28. {wcgw-3.0.6 → wcgw-4.0.0}/tests/test_tools.py +91 -12
  29. {wcgw-3.0.6 → wcgw-4.0.0}/uv.lock +1 -12
  30. wcgw-3.0.6/src/wcgw/client/repo_ops/repo_context.py +0 -148
  31. wcgw-3.0.6/src/wcgw/types_.py +0 -146
  32. {wcgw-3.0.6 → wcgw-4.0.0}/.github/workflows/python-publish.yml +0 -0
  33. {wcgw-3.0.6 → wcgw-4.0.0}/.github/workflows/python-types.yml +0 -0
  34. {wcgw-3.0.6 → wcgw-4.0.0}/.gitignore +0 -0
  35. {wcgw-3.0.6 → wcgw-4.0.0}/.gitmodules +0 -0
  36. {wcgw-3.0.6 → wcgw-4.0.0}/.python-version +0 -0
  37. {wcgw-3.0.6 → wcgw-4.0.0}/.vscode/settings.json +0 -0
  38. {wcgw-3.0.6 → wcgw-4.0.0}/LICENSE +0 -0
  39. {wcgw-3.0.6 → wcgw-4.0.0}/openai.md +0 -0
  40. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/.git +0 -0
  41. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  42. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  43. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/.github/workflows/main-checks.yml +0 -0
  44. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/.github/workflows/publish-pypi.yml +0 -0
  45. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/.github/workflows/pull-request-checks.yml +0 -0
  46. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/.github/workflows/shared.yml +0 -0
  47. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/.gitignore +0 -0
  48. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/.python-version +0 -0
  49. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/CODE_OF_CONDUCT.md +0 -0
  50. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/CONTRIBUTING.md +0 -0
  51. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/LICENSE +0 -0
  52. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/README.md +0 -0
  53. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/RELEASE.md +0 -0
  54. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/SECURITY.md +0 -0
  55. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/examples/README.md +0 -0
  56. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/examples/servers/simple-prompt/.python-version +0 -0
  57. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/examples/servers/simple-prompt/README.md +0 -0
  58. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/examples/servers/simple-prompt/mcp_simple_prompt/__init__.py +0 -0
  59. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/examples/servers/simple-prompt/mcp_simple_prompt/__main__.py +0 -0
  60. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/examples/servers/simple-prompt/mcp_simple_prompt/server.py +0 -0
  61. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/examples/servers/simple-prompt/pyproject.toml +0 -0
  62. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/examples/servers/simple-resource/.python-version +0 -0
  63. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/examples/servers/simple-resource/README.md +0 -0
  64. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/examples/servers/simple-resource/mcp_simple_resource/__init__.py +0 -0
  65. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/examples/servers/simple-resource/mcp_simple_resource/__main__.py +0 -0
  66. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/examples/servers/simple-resource/mcp_simple_resource/server.py +0 -0
  67. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/examples/servers/simple-resource/pyproject.toml +0 -0
  68. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/examples/servers/simple-tool/.python-version +0 -0
  69. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/examples/servers/simple-tool/README.md +0 -0
  70. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/examples/servers/simple-tool/mcp_simple_tool/__init__.py +0 -0
  71. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/examples/servers/simple-tool/mcp_simple_tool/__main__.py +0 -0
  72. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/examples/servers/simple-tool/mcp_simple_tool/server.py +0 -0
  73. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/examples/servers/simple-tool/pyproject.toml +0 -0
  74. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/pyproject.toml +0 -0
  75. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/src/mcp_wcgw/__init__.py +0 -0
  76. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/src/mcp_wcgw/client/__init__.py +0 -0
  77. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/src/mcp_wcgw/client/__main__.py +0 -0
  78. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/src/mcp_wcgw/client/session.py +0 -0
  79. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/src/mcp_wcgw/client/sse.py +0 -0
  80. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/src/mcp_wcgw/client/stdio.py +0 -0
  81. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/src/mcp_wcgw/py.typed +0 -0
  82. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/src/mcp_wcgw/server/__init__.py +0 -0
  83. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/src/mcp_wcgw/server/__main__.py +0 -0
  84. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/src/mcp_wcgw/server/models.py +0 -0
  85. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/src/mcp_wcgw/server/session.py +0 -0
  86. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/src/mcp_wcgw/server/sse.py +0 -0
  87. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/src/mcp_wcgw/server/stdio.py +0 -0
  88. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/src/mcp_wcgw/server/websocket.py +0 -0
  89. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/src/mcp_wcgw/shared/__init__.py +0 -0
  90. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/src/mcp_wcgw/shared/context.py +0 -0
  91. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/src/mcp_wcgw/shared/exceptions.py +0 -0
  92. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/src/mcp_wcgw/shared/memory.py +0 -0
  93. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/src/mcp_wcgw/shared/progress.py +0 -0
  94. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/src/mcp_wcgw/shared/session.py +0 -0
  95. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/src/mcp_wcgw/shared/version.py +0 -0
  96. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/src/mcp_wcgw/types.py +0 -0
  97. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/tests/__init__.py +0 -0
  98. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/tests/client/__init__.py +0 -0
  99. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/tests/client/test_session.py +0 -0
  100. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/tests/client/test_stdio.py +0 -0
  101. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/tests/conftest.py +0 -0
  102. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/tests/server/__init__.py +0 -0
  103. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/tests/server/test_session.py +0 -0
  104. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/tests/server/test_stdio.py +0 -0
  105. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/tests/shared/test_memory.py +0 -0
  106. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/tests/test_types.py +0 -0
  107. {wcgw-3.0.6 → wcgw-4.0.0}/src/mcp_wcgw_fork/uv.lock +0 -0
  108. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw/__init__.py +0 -0
  109. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw/client/__init__.py +0 -0
  110. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw/client/common.py +0 -0
  111. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw/client/encoder/__init__.py +0 -0
  112. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw/client/mcp_server/Readme.md +0 -0
  113. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw/client/mcp_server/__init__.py +0 -0
  114. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw/client/mcp_server/server.py +0 -0
  115. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw/client/repo_ops/path_prob.py +0 -0
  116. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw/client/repo_ops/paths_model.vocab +0 -0
  117. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw/client/repo_ops/paths_tokens.model +0 -0
  118. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw/py.typed +0 -0
  119. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw/relay/client.py +0 -0
  120. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw/relay/static/privacy.txt +0 -0
  121. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw_cli/__init__.py +0 -0
  122. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw_cli/__main__.py +0 -0
  123. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw_cli/cli.py +0 -0
  124. {wcgw-3.0.6 → wcgw-4.0.0}/src/wcgw_cli/openai_utils.py +0 -0
  125. {wcgw-3.0.6 → wcgw-4.0.0}/static/claude-ss.jpg +0 -0
  126. {wcgw-3.0.6 → wcgw-4.0.0}/static/computer-use.jpg +0 -0
  127. {wcgw-3.0.6 → wcgw-4.0.0}/static/example.jpg +0 -0
  128. {wcgw-3.0.6 → wcgw-4.0.0}/static/rocket-icon.png +0 -0
  129. {wcgw-3.0.6 → wcgw-4.0.0}/static/ss1.png +0 -0
@@ -28,8 +28,7 @@ jobs:
28
28
  uv venv --python "${{ matrix.python-version }}"
29
29
  - name: Run tests with coverage
30
30
  run: |
31
- uv pip install pytest pytest-cov
32
- uv run pytest --cov=wcgw --cov-report=xml --cov-report=term-missing
31
+ uv run --python "${{ matrix.python-version }}" pytest --cov=wcgw --cov-report=xml --cov-report=term-missing
33
32
  - name: Upload coverage reports to Codecov
34
33
  uses: codecov/codecov-action@v4
35
34
  if: success()
@@ -8,17 +8,30 @@ WORKDIR /app
8
8
  # Copy the project's pyproject.toml and lock file for dependency installation
9
9
  COPY pyproject.toml /app/
10
10
  COPY uv.lock /app/
11
+ COPY README.md /app/
11
12
 
12
13
  # Enable bytecode compilation and set link mode to copy for dependencies
13
14
  ENV UV_COMPILE_BYTECODE=1
14
15
  ENV UV_LINK_MODE=copy
15
16
 
17
+ # Install dependencies including git
18
+ RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
19
+
16
20
  # Install dependencies
17
21
  RUN --mount=type=cache,target=/root/.cache/uv \
18
22
  uv sync --frozen --no-install-project --no-dev --no-editable
19
23
 
20
24
  # Copy the entire project into the container
21
- COPY . /app
25
+ COPY src /app/src
26
+
27
+ # Check if src/mcp_wcgw_fork is empty and clone the repository if needed
28
+ RUN if [ ! -d "/app/src/mcp_wcgw_fork" ] || [ -z "$(ls -A /app/src/mcp_wcgw_fork)" ]; then \
29
+ mkdir -p /app/src/mcp_wcgw_fork && \
30
+ git clone https://github.com/rusiaaman/python-sdk.git /app/src/mcp_wcgw_fork && \
31
+ echo "Repository cloned successfully"; \
32
+ else \
33
+ echo "src/mcp_wcgw_fork already exists and is not empty"; \
34
+ fi
22
35
 
23
36
  # Install the project
24
37
  RUN --mount=type=cache,target=/root/.cache/uv \
@@ -27,15 +40,18 @@ RUN --mount=type=cache,target=/root/.cache/uv \
27
40
  # Use a smaller image to run the application
28
41
  FROM python:3.12-slim-bookworm
29
42
 
43
+ RUN apt-get update && apt-get install -y screen && rm -rf /var/lib/apt/lists/*
44
+
30
45
  # Set the working directory in the container
31
- WORKDIR /app
46
+ WORKDIR /workspace
32
47
 
33
48
  # Copy the installed application from the previous stage
34
- COPY --from=uv /root/.local /root/.local
35
49
  COPY --from=uv --chown=app:app /app/.venv /app/.venv
50
+ # Copy the cloned repository if it exists
51
+ COPY --from=uv --chown=app:app /app/src/mcp_wcgw_fork /app/src/mcp_wcgw_fork
36
52
 
37
53
  # Add the virtual environment to the PATH
38
54
  ENV PATH="/app/.venv/bin:$PATH"
39
55
 
40
56
  # Specify the command to run on container start
41
- ENTRYPOINT ["wcgw_mcp"]
57
+ ENTRYPOINT ["wcgw_mcp"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wcgw
3
- Version: 3.0.6
3
+ Version: 4.0.0
4
4
  Summary: Shell and coding agent on claude and chatgpt
5
5
  Project-URL: Homepage, https://github.com/rusiaaman/wcgw
6
6
  Author-email: Aman Rusia <gapypi@arcfu.com>
@@ -17,7 +17,6 @@ Requires-Dist: pyte>=0.8.2
17
17
  Requires-Dist: python-dotenv>=1.0.1
18
18
  Requires-Dist: rich>=13.8.1
19
19
  Requires-Dist: semantic-version>=2.10.0
20
- Requires-Dist: shell>=1.0.1
21
20
  Requires-Dist: syntax-checker>=0.3.0
22
21
  Requires-Dist: tokenizers>=0.21.0
23
22
  Requires-Dist: toml>=0.10.2
@@ -30,8 +29,8 @@ Description-Content-Type: text/markdown
30
29
 
31
30
  Empowering chat applications to code, build and run on your local machine.
32
31
 
33
- - Claude - An MCP server on claude desktop for autonomous shell and coding agent. (mac only)
34
- - Chatgpt - Allows custom gpt to talk to your shell via a relay server. (linux or mac)
32
+ - Claude - An MCP server on claude desktop for autonomous shell and coding agent. (mac, linux, windows on wsl)
33
+ - Chatgpt - Allows custom gpt to talk to your shell via a relay server. (linux, mac, windows on wsl)
35
34
 
36
35
  ⚠️ Warning: do not allow BashCommand tool without reviewing the command, it may result in data loss.
37
36
 
@@ -39,7 +38,11 @@ Empowering chat applications to code, build and run on your local machine.
39
38
  [![Mypy strict](https://github.com/rusiaaman/wcgw/actions/workflows/python-types.yml/badge.svg?branch=main)](https://github.com/rusiaaman/wcgw/actions/workflows/python-types.yml)
40
39
  [![Build](https://github.com/rusiaaman/wcgw/actions/workflows/python-publish.yml/badge.svg)](https://github.com/rusiaaman/wcgw/actions/workflows/python-publish.yml)
41
40
  [![codecov](https://codecov.io/gh/rusiaaman/wcgw/graph/badge.svg)](https://codecov.io/gh/rusiaaman/wcgw)
42
- [![smithery badge](https://smithery.ai/badge/wcgw)](https://smithery.ai/server/wcgw)
41
+ [![Reddit](https://img.shields.io/badge/Reddit-r%2Fwcgw_mcp-red)](https://www.reddit.com/r/wcgw_mcp/)
42
+
43
+ ## Demo
44
+
45
+ ![Workflow Demo](static/workflow-demo.gif)
43
46
 
44
47
  ## Updates
45
48
 
@@ -53,7 +56,6 @@ Empowering chat applications to code, build and run on your local machine.
53
56
 
54
57
  - [9 Dec 2024] [Vscode extension to paste context on Claude app](https://marketplace.visualstudio.com/items?itemName=AmanRusia.wcgw)
55
58
 
56
-
57
59
  ## 🚀 Highlights
58
60
 
59
61
  - ⚡ **Create, Execute, Iterate**: Ask claude to keep running compiler checks till all errors are fixed, or ask it to keep checking for the status of a long running command till it's done.
@@ -96,6 +98,8 @@ Empowering chat applications to code, build and run on your local machine.
96
98
 
97
99
  ## Claude setup (using mcp)
98
100
 
101
+ ### Mac and linux
102
+
99
103
  First install `uv` using homebrew `brew install uv`
100
104
 
101
105
  (**Important:** use homebrew to install uv. Otherwise make sure `uv` is present in a global location like /usr/bin/)
@@ -131,18 +135,33 @@ _If there's an error in setting up_
131
135
  - Try using `uv` version `0.6.0` for which this tool was tested.
132
136
  - Debug the mcp server using `npx @modelcontextprotocol/inspector@0.1.7 uv tool run --from wcgw@latest --python 3.12 wcgw_mcp`
133
137
 
134
- ### Alternative configuration using smithery (npx required)
138
+ ### Windows on wsl
135
139
 
136
- You need to first install uv using homebrew. `brew install uv`
140
+ This mcp server works only on wsl on windows.
137
141
 
138
- Then to configure wcgw for Claude Desktop automatically via [Smithery](https://smithery.ai/server/wcgw):
142
+ To set it up, [install uv](https://docs.astral.sh/uv/getting-started/installation/)
139
143
 
140
- ```bash
141
- npx -y @smithery/cli install wcgw --client claude
142
- ```
144
+ Then add or update the claude config file `%APPDATA%\Claude\claude_desktop_config.json` with the following
143
145
 
144
- _If there's an error in setting up_
145
- - Try removing ~/.cache/uv folder
146
+ ```json
147
+ {
148
+ "mcpServers": {
149
+ "wcgw": {
150
+ "command": "wsl.exe",
151
+ "args": [
152
+ "uv",
153
+ "tool",
154
+ "run",
155
+ "--from",
156
+ "wcgw@latest",
157
+ "--python",
158
+ "3.12",
159
+ "wcgw_mcp"
160
+ ]
161
+ }
162
+ }
163
+ }
164
+ ```
146
165
 
147
166
  ### Usage
148
167
 
@@ -174,6 +193,7 @@ There are three built-in modes. You may ask Claude to run in one of the modes, l
174
193
  Note: in code-writer mode either all commands are allowed or none are allowed for now. If you give a list of allowed commands, Claude is instructed to run only those commands, but no actual check happens. (WIP)
175
194
 
176
195
  #### Attach to the working terminal to investigate
196
+
177
197
  If you've `screen` command installed, wcgw runs on a screen instance automatically. If you've started wcgw mcp server, you can list the screen sessions:
178
198
 
179
199
  `screen -ls`
@@ -184,7 +204,7 @@ You can then attach to the session using `screen -x 93358.wcgw.235521`
184
204
 
185
205
  You may interrupt any running command safely.
186
206
 
187
- You can interact with the terminal but beware that the AI might be running in parallel and it may conflict with what you're doing. It's recommended to keep your interactions to minimum.
207
+ You can interact with the terminal but beware that the AI might be running in parallel and it may conflict with what you're doing. It's recommended to keep your interactions to minimum.
188
208
 
189
209
  You shouldn't exit the session using `exit `or Ctrl-d, instead you should use `ctrl+a+d` to safely detach without destroying the screen session.
190
210
 
@@ -204,6 +224,30 @@ Read here: https://github.com/rusiaaman/wcgw/blob/main/openai.md
204
224
 
205
225
  ![example](https://github.com/rusiaaman/wcgw/blob/main/static/example.jpg?raw=true)
206
226
 
227
+ ## Using mcp server over docker
228
+
229
+ First build the docker image `docker build -t wcgw https://github.com/rusiaaman/wcgw.git`
230
+
231
+ Then you can update `/Users/username/Library/Application Support/Claude/claude_desktop_config.json` to have
232
+
233
+ ```
234
+ {
235
+ "mcpServers": {
236
+ "filesystem": {
237
+ "command": "docker",
238
+ "args": [
239
+ "run",
240
+ "-i",
241
+ "--rm",
242
+ "--mount",
243
+ "type=bind,src=/Users/username/Desktop,dst=/workspace/Desktop",
244
+ "wcgw",
245
+ ]
246
+ }
247
+ }
248
+ }
249
+ ```
250
+
207
251
  ## [Optional] Local shell access with openai API key or anthropic API key
208
252
 
209
253
  ### Openai
@@ -2,8 +2,8 @@
2
2
 
3
3
  Empowering chat applications to code, build and run on your local machine.
4
4
 
5
- - Claude - An MCP server on claude desktop for autonomous shell and coding agent. (mac only)
6
- - Chatgpt - Allows custom gpt to talk to your shell via a relay server. (linux or mac)
5
+ - Claude - An MCP server on claude desktop for autonomous shell and coding agent. (mac, linux, windows on wsl)
6
+ - Chatgpt - Allows custom gpt to talk to your shell via a relay server. (linux, mac, windows on wsl)
7
7
 
8
8
  ⚠️ Warning: do not allow BashCommand tool without reviewing the command, it may result in data loss.
9
9
 
@@ -11,7 +11,11 @@ Empowering chat applications to code, build and run on your local machine.
11
11
  [![Mypy strict](https://github.com/rusiaaman/wcgw/actions/workflows/python-types.yml/badge.svg?branch=main)](https://github.com/rusiaaman/wcgw/actions/workflows/python-types.yml)
12
12
  [![Build](https://github.com/rusiaaman/wcgw/actions/workflows/python-publish.yml/badge.svg)](https://github.com/rusiaaman/wcgw/actions/workflows/python-publish.yml)
13
13
  [![codecov](https://codecov.io/gh/rusiaaman/wcgw/graph/badge.svg)](https://codecov.io/gh/rusiaaman/wcgw)
14
- [![smithery badge](https://smithery.ai/badge/wcgw)](https://smithery.ai/server/wcgw)
14
+ [![Reddit](https://img.shields.io/badge/Reddit-r%2Fwcgw_mcp-red)](https://www.reddit.com/r/wcgw_mcp/)
15
+
16
+ ## Demo
17
+
18
+ ![Workflow Demo](static/workflow-demo.gif)
15
19
 
16
20
  ## Updates
17
21
 
@@ -25,7 +29,6 @@ Empowering chat applications to code, build and run on your local machine.
25
29
 
26
30
  - [9 Dec 2024] [Vscode extension to paste context on Claude app](https://marketplace.visualstudio.com/items?itemName=AmanRusia.wcgw)
27
31
 
28
-
29
32
  ## 🚀 Highlights
30
33
 
31
34
  - ⚡ **Create, Execute, Iterate**: Ask claude to keep running compiler checks till all errors are fixed, or ask it to keep checking for the status of a long running command till it's done.
@@ -68,6 +71,8 @@ Empowering chat applications to code, build and run on your local machine.
68
71
 
69
72
  ## Claude setup (using mcp)
70
73
 
74
+ ### Mac and linux
75
+
71
76
  First install `uv` using homebrew `brew install uv`
72
77
 
73
78
  (**Important:** use homebrew to install uv. Otherwise make sure `uv` is present in a global location like /usr/bin/)
@@ -103,18 +108,33 @@ _If there's an error in setting up_
103
108
  - Try using `uv` version `0.6.0` for which this tool was tested.
104
109
  - Debug the mcp server using `npx @modelcontextprotocol/inspector@0.1.7 uv tool run --from wcgw@latest --python 3.12 wcgw_mcp`
105
110
 
106
- ### Alternative configuration using smithery (npx required)
111
+ ### Windows on wsl
107
112
 
108
- You need to first install uv using homebrew. `brew install uv`
113
+ This mcp server works only on wsl on windows.
109
114
 
110
- Then to configure wcgw for Claude Desktop automatically via [Smithery](https://smithery.ai/server/wcgw):
115
+ To set it up, [install uv](https://docs.astral.sh/uv/getting-started/installation/)
111
116
 
112
- ```bash
113
- npx -y @smithery/cli install wcgw --client claude
114
- ```
117
+ Then add or update the claude config file `%APPDATA%\Claude\claude_desktop_config.json` with the following
115
118
 
116
- _If there's an error in setting up_
117
- - Try removing ~/.cache/uv folder
119
+ ```json
120
+ {
121
+ "mcpServers": {
122
+ "wcgw": {
123
+ "command": "wsl.exe",
124
+ "args": [
125
+ "uv",
126
+ "tool",
127
+ "run",
128
+ "--from",
129
+ "wcgw@latest",
130
+ "--python",
131
+ "3.12",
132
+ "wcgw_mcp"
133
+ ]
134
+ }
135
+ }
136
+ }
137
+ ```
118
138
 
119
139
  ### Usage
120
140
 
@@ -146,6 +166,7 @@ There are three built-in modes. You may ask Claude to run in one of the modes, l
146
166
  Note: in code-writer mode either all commands are allowed or none are allowed for now. If you give a list of allowed commands, Claude is instructed to run only those commands, but no actual check happens. (WIP)
147
167
 
148
168
  #### Attach to the working terminal to investigate
169
+
149
170
  If you've `screen` command installed, wcgw runs on a screen instance automatically. If you've started wcgw mcp server, you can list the screen sessions:
150
171
 
151
172
  `screen -ls`
@@ -156,7 +177,7 @@ You can then attach to the session using `screen -x 93358.wcgw.235521`
156
177
 
157
178
  You may interrupt any running command safely.
158
179
 
159
- You can interact with the terminal but beware that the AI might be running in parallel and it may conflict with what you're doing. It's recommended to keep your interactions to minimum.
180
+ You can interact with the terminal but beware that the AI might be running in parallel and it may conflict with what you're doing. It's recommended to keep your interactions to minimum.
160
181
 
161
182
  You shouldn't exit the session using `exit `or Ctrl-d, instead you should use `ctrl+a+d` to safely detach without destroying the screen session.
162
183
 
@@ -176,6 +197,30 @@ Read here: https://github.com/rusiaaman/wcgw/blob/main/openai.md
176
197
 
177
198
  ![example](https://github.com/rusiaaman/wcgw/blob/main/static/example.jpg?raw=true)
178
199
 
200
+ ## Using mcp server over docker
201
+
202
+ First build the docker image `docker build -t wcgw https://github.com/rusiaaman/wcgw.git`
203
+
204
+ Then you can update `/Users/username/Library/Application Support/Claude/claude_desktop_config.json` to have
205
+
206
+ ```
207
+ {
208
+ "mcpServers": {
209
+ "filesystem": {
210
+ "command": "docker",
211
+ "args": [
212
+ "run",
213
+ "-i",
214
+ "--rm",
215
+ "--mount",
216
+ "type=bind,src=/Users/username/Desktop,dst=/workspace/Desktop",
217
+ "wcgw",
218
+ ]
219
+ }
220
+ }
221
+ }
222
+ ```
223
+
179
224
  ## [Optional] Local shell access with openai API key or anthropic API key
180
225
 
181
226
  ### Openai
@@ -10,16 +10,16 @@
10
10
  }
11
11
  ],
12
12
  "paths": {
13
- "/v1/create_file": {
13
+ "/v1/file_write_or_edit": {
14
14
  "post": {
15
15
  "x-openai-isConsequential": false,
16
- "summary": "Create File",
17
- "operationId": "create_file_v1_create_file_post",
16
+ "summary": "File Write Or Edit",
17
+ "operationId": "file_write_or_edit_v1_file_write_or_edit_post",
18
18
  "requestBody": {
19
19
  "content": {
20
20
  "application/json": {
21
21
  "schema": {
22
- "$ref": "#/components/schemas/WriteIfEmptyWithUUID"
22
+ "$ref": "#/components/schemas/FileWriteOrEdithUUID"
23
23
  }
24
24
  }
25
25
  },
@@ -32,47 +32,7 @@
32
32
  "application/json": {
33
33
  "schema": {
34
34
  "type": "string",
35
- "title": "Response Create File V1 Create File Post"
36
- }
37
- }
38
- }
39
- },
40
- "422": {
41
- "description": "Validation Error",
42
- "content": {
43
- "application/json": {
44
- "schema": {
45
- "$ref": "#/components/schemas/HTTPValidationError"
46
- }
47
- }
48
- }
49
- }
50
- }
51
- }
52
- },
53
- "/v1/full_file_edit": {
54
- "post": {
55
- "x-openai-isConsequential": false,
56
- "summary": "File Edit Find Replace",
57
- "operationId": "file_edit_find_replace_v1_full_file_edit_post",
58
- "requestBody": {
59
- "content": {
60
- "application/json": {
61
- "schema": {
62
- "$ref": "#/components/schemas/FileEditWithUUID"
63
- }
64
- }
65
- },
66
- "required": true
67
- },
68
- "responses": {
69
- "200": {
70
- "description": "Successful Response",
71
- "content": {
72
- "application/json": {
73
- "schema": {
74
- "type": "string",
75
- "title": "Response File Edit Find Replace V1 Full File Edit Post"
35
+ "title": "Response File Write Or Edit V1 File Write Or Edit Post"
76
36
  }
77
37
  }
78
38
  }
@@ -288,10 +248,7 @@
288
248
  },
289
249
  "additionalProperties": false,
290
250
  "type": "object",
291
- "required": [
292
- "allowed_globs",
293
- "allowed_commands"
294
- ],
251
+ "required": ["allowed_globs", "allowed_commands"],
295
252
  "title": "CodeWriterMode"
296
253
  },
297
254
  "Command": {
@@ -303,9 +260,7 @@
303
260
  },
304
261
  "additionalProperties": false,
305
262
  "type": "object",
306
- "required": [
307
- "command"
308
- ],
263
+ "required": ["command"],
309
264
  "title": "Command"
310
265
  },
311
266
  "CommandWithUUID": {
@@ -328,7 +283,7 @@
328
283
  "$ref": "#/components/schemas/SendAscii"
329
284
  }
330
285
  ],
331
- "title": "ActionJson"
286
+ "title": "Action Json"
332
287
  },
333
288
  "wait_for_seconds": {
334
289
  "anyOf": [
@@ -349,10 +304,7 @@
349
304
  },
350
305
  "additionalProperties": false,
351
306
  "type": "object",
352
- "required": [
353
- "action_json",
354
- "user_id"
355
- ],
307
+ "required": ["action_json", "user_id"],
356
308
  "title": "CommandWithUUID"
357
309
  },
358
310
  "ContextSaveWithUUID": {
@@ -393,15 +345,19 @@
393
345
  ],
394
346
  "title": "ContextSaveWithUUID"
395
347
  },
396
- "FileEditWithUUID": {
348
+ "FileWriteOrEdithUUID": {
397
349
  "properties": {
398
350
  "file_path": {
399
351
  "type": "string",
400
352
  "title": "File Path"
401
353
  },
402
- "file_edit_using_search_replace_blocks": {
354
+ "percentage_to_change": {
355
+ "type": "integer",
356
+ "title": "Percentage To Change"
357
+ },
358
+ "file_content_or_search_replace_blocks": {
403
359
  "type": "string",
404
- "title": "File Edit Using Search Replace Blocks"
360
+ "title": "File Content Or Search Replace Blocks"
405
361
  },
406
362
  "user_id": {
407
363
  "type": "string",
@@ -413,10 +369,11 @@
413
369
  "type": "object",
414
370
  "required": [
415
371
  "file_path",
416
- "file_edit_using_search_replace_blocks",
372
+ "percentage_to_change",
373
+ "file_content_or_search_replace_blocks",
417
374
  "user_id"
418
375
  ],
419
- "title": "FileEditWithUUID"
376
+ "title": "FileWriteOrEdithUUID"
420
377
  },
421
378
  "HTTPValidationError": {
422
379
  "properties": {
@@ -460,11 +417,7 @@
460
417
  },
461
418
  "mode_name": {
462
419
  "type": "string",
463
- "enum": [
464
- "wcgw",
465
- "architect",
466
- "code_writer"
467
- ],
420
+ "enum": ["wcgw", "architect", "code_writer"],
468
421
  "title": "Mode Name"
469
422
  },
470
423
  "code_writer_config": {
@@ -504,6 +457,17 @@
504
457
  "type": "array",
505
458
  "title": "File Paths"
506
459
  },
460
+ "show_line_numbers_reason": {
461
+ "anyOf": [
462
+ {
463
+ "type": "string"
464
+ },
465
+ {
466
+ "type": "null"
467
+ }
468
+ ],
469
+ "title": "Show Line Numbers Reason"
470
+ },
507
471
  "user_id": {
508
472
  "type": "string",
509
473
  "format": "uuid",
@@ -512,10 +476,7 @@
512
476
  },
513
477
  "additionalProperties": false,
514
478
  "type": "object",
515
- "required": [
516
- "file_paths",
517
- "user_id"
518
- ],
479
+ "required": ["file_paths", "user_id"],
519
480
  "title": "ReadFileWithUUID"
520
481
  },
521
482
  "SendAscii": {
@@ -530,9 +491,7 @@
530
491
  },
531
492
  "additionalProperties": false,
532
493
  "type": "object",
533
- "required": [
534
- "send_ascii"
535
- ],
494
+ "required": ["send_ascii"],
536
495
  "title": "SendAscii"
537
496
  },
538
497
  "SendSpecials": {
@@ -547,8 +506,7 @@
547
506
  "Key-left",
548
507
  "Key-right",
549
508
  "Ctrl-c",
550
- "Ctrl-d",
551
- "Ctrl-z"
509
+ "Ctrl-d"
552
510
  ]
553
511
  },
554
512
  "type": "array",
@@ -557,9 +515,7 @@
557
515
  },
558
516
  "additionalProperties": false,
559
517
  "type": "object",
560
- "required": [
561
- "send_specials"
562
- ],
518
+ "required": ["send_specials"],
563
519
  "title": "SendSpecials"
564
520
  },
565
521
  "SendText": {
@@ -571,9 +527,7 @@
571
527
  },
572
528
  "additionalProperties": false,
573
529
  "type": "object",
574
- "required": [
575
- "send_text"
576
- ],
530
+ "required": ["send_text"],
577
531
  "title": "SendText"
578
532
  },
579
533
  "StatusCheck": {
@@ -586,9 +540,7 @@
586
540
  },
587
541
  "additionalProperties": false,
588
542
  "type": "object",
589
- "required": [
590
- "status_check"
591
- ],
543
+ "required": ["status_check"],
592
544
  "title": "StatusCheck"
593
545
  },
594
546
  "ValidationError": {
@@ -617,38 +569,9 @@
617
569
  }
618
570
  },
619
571
  "type": "object",
620
- "required": [
621
- "loc",
622
- "msg",
623
- "type"
624
- ],
572
+ "required": ["loc", "msg", "type"],
625
573
  "title": "ValidationError"
626
- },
627
- "WriteIfEmptyWithUUID": {
628
- "properties": {
629
- "file_path": {
630
- "type": "string",
631
- "title": "File Path"
632
- },
633
- "file_content": {
634
- "type": "string",
635
- "title": "File Content"
636
- },
637
- "user_id": {
638
- "type": "string",
639
- "format": "uuid",
640
- "title": "User Id"
641
- }
642
- },
643
- "additionalProperties": false,
644
- "type": "object",
645
- "required": [
646
- "file_path",
647
- "file_content",
648
- "user_id"
649
- ],
650
- "title": "WriteIfEmptyWithUUID"
651
574
  }
652
575
  }
653
576
  }
654
- }
577
+ }
@@ -33,23 +33,24 @@ Instructions for `BashCommand`:
33
33
 
34
34
  Instructions for `Read Files`
35
35
  - Read full file content of one or more files.
36
- - Provide absolute file paths only
37
-
38
- Instructions for `Write if Empty`
39
- - Write content to an empty or non-existent file. Provide file path and content. Use this instead of BashCommand for writing new files.
40
- - Provide absolute file path only.
41
- - For editing existing files, use FileEdit.
36
+ - Provide absolute paths only (~ allowed)
37
+ - Only if the task requires line numbers understanding:
38
+ - You may populate "show_line_numbers_reason" with your reason, by default null/empty means no line numbers are shown.
39
+ - You may extract a range of lines. E.g., `/path/to/file:1-10` for lines 1-10. You can drop start or end like `/path/to/file:1-` or `/path/to/file:-10`
40
+
41
+ Instructions for `FileWriteOrEdit`
42
+ - Writes or edits a file based on the percentage of changes.
43
+ - Use absolute path only (~ allowed).
44
+ - First write down percentage of lines that need to be replaced in the file (between 0-100) in percentage_to_change
45
+ - percentage_to_change should be low if mostly new code is to be added. It should be high if a lot of things are to be replaced.
46
+ - If percentage_to_change > 50, provide full file content in file_content_or_search_replace_blocks
47
+ - If percentage_to_change <= 50, file_content_or_search_replace_blocks should be search/replace blocks.
42
48
 
43
49
  Instructions for `ContextSave`
44
50
  - Saves provided description and file contents of all the relevant file paths or globs in a single text file.
45
51
  - Provide random unqiue id or whatever user provided.
46
52
  - Leave project path as empty string if no project path
47
53
 
48
- Instructions for `FileEdit`:
49
- - Use absolute file path only.
50
- - Use SEARCH/REPLACE blocks to edit the file.
51
- Only edit the files using the following SEARCH/REPLACE blocks.
52
-
53
54
  ```
54
55
  <<<<<<< SEARCH
55
56
  def hello():
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  authors = [{ name = "Aman Rusia", email = "gapypi@arcfu.com" }]
3
3
  name = "wcgw"
4
- version = "3.0.6"
4
+ version = "4.0.0"
5
5
  description = "Shell and coding agent on claude and chatgpt"
6
6
  readme = "README.md"
7
7
  requires-python = ">=3.11"
@@ -11,7 +11,6 @@ dependencies = [
11
11
  "rich>=13.8.1",
12
12
  "python-dotenv>=1.0.1",
13
13
  "pexpect>=4.9.0",
14
- "shell>=1.0.1",
15
14
  "toml>=0.10.2",
16
15
  "petname>=2.6",
17
16
  "pyte>=0.8.2",