Skip to main content

Shell and coding agent on claude and chatgpt

Project description

Shell and Coding agent for Claude and Chatgpt

  • Claude - An MCP server on claude desktop for autonomous shell, coding and desktop control agent. (mac only)
  • Chatgpt - Allows custom gpt to talk to your shell via a relay server. (linux or mac)

⚠️ Warning: do not use this repo if you aren't scared of "Autonomous shell command execution"

Tests Mypy strict Build

Updates

🚀 Highlights

  • Full Shell Access: No restrictions, complete control.
  • Desktop control on Claude: Screen capture, mouse control, keyboard control on claude desktop (on mac with docker linux)
  • 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.
  • Large file edit: Supports large file incremental edits to avoid token limit issues. Faster than full file write.
  • Interactive Command Handling: Supports interactive commands using arrow keys, interrupt, and ansi escape sequences.
  • REPL support: [beta] Supports python/node and other REPL execution.

Top use cases examples

  • Solve problem X using python, create and run test cases and fix any issues. Do it in a temporary directory
  • Find instances of code with X behavior in my repository
  • Git clone https://github.com/my/repo in my home directory, then understand the project, set up the environment and build
  • Create a golang htmx tailwind webapp, then open browser to see if it works (use with puppeteer mcp)
  • Edit or update a large file
  • In a separate branch create feature Y, then use github cli to create a PR to original branch
  • Command X is failing in Y directory, please run and fix issues
  • Using X virtual environment run Y command
  • Using cli tools, create build and test an android app. Finally run it using emulator for me to use
  • Fix all mypy issues in my repo at X path.
  • Using 'screen' run my server in background instead, then run another api server in bg, finally run the frontend build. Keep checking logs for any issues in all three
  • Create repo wide unittest cases. Keep iterating through files and creating cases. Also keep running the tests after each update. Do not modify original code.

Claude Setup

First install uv https://docs.astral.sh/uv/getting-started/installation/#installation-methods

Then update claude_desktop_config.json (~/Library/Application Support/Claude/claude_desktop_config.json)

{
  "mcpServers": {
    "wcgw": {
      "command": "uv",
      "args": [
        "tool",
        "run",
        "--from",
        "wcgw@latest",
        "--python",
        "3.12",
        "wcgw_mcp"
      ]
    }
  }
}

Then restart claude app.

If there's an error in setting up

  • Make sure uv in the system PATH by running uv --version and also ensure uv tool run wcgw --version works globally. Otherwise, re-install uv and follow instructions to add it into your .zshrc or .bashrc
  • If there's still an issue, check that uv tool run --from wcgw@latest --python 3.12 wcgw_mcp runs in your terminal. It should have no output and shouldn't exit.
  • Debug the mcp server using npx @modelcontextprotocol/inspector@0.1.7 uv tool run --from wcgw@latest --python 3.12 wcgw_mcp

[Optional] Computer use support using desktop on docker

Computer use is disabled by default. Add --computer-use to enable it. This will add necessary tools to Claude including ScreenShot, Mouse and Keyboard control.

{
  "mcpServers": {
    "wcgw": {
      "command": "uv",
      "args": [
        "tool",
        "run",
        "--from",
        "wcgw@latest",
        "--python",
        "3.12",
        "wcgw_mcp",
        "--computer-use"
      ]
    }
  }
}

Claude will be able to connect to any docker container with linux environment. Native system control isn't supported outside docker.

You'll need to run a docker image with desktop and optional VNC connection. Here's a demo image:

docker run -p 6080:6080 ghcr.io/anthropics/anthropic-quickstarts:computer-use-demo-latest

Then ask claude desktop app to control the docker os. It'll connect to the docker container and control it.

Connect to http://localhost:6080/vnc.html for desktop view (VNC) of the system running in the docker.

The following requirements should be installed and working in the linux docker image:

  1. Needs xdotool to execute commands on the desktop.
  2. Needs scrot to take screenshots.
  3. Needs convert from imagemagick to convert images.

Usage

Wait for a few seconds. You should be able to see this icon if everything goes right.

mcp icon over here

mcp icon

Then ask claude to execute shell commands, read files, edit files, run your code, etc.

If you've run the docker for LLM to access, you can ask it to control the "docker os". If you don't provide the docker container id to it, it'll try to search for available docker using docker ps command.

[Optional] Vs code extension

https://marketplace.visualstudio.com/items?itemName=AmanRusia.wcgw

Commands:

  • Select a text and press cmd+' and then enter instructions. This will switch the app to Claude and paste a text containing your instructions, file path, workspace dir, and the selected text.

Chatgpt Setup

Read here: https://github.com/rusiaaman/wcgw/blob/main/openai.md

Examples

Computer use example

computer-use

Shell example

example

[Optional] Local shell access with openai API key or anthropic API key

Openai

Add OPENAI_API_KEY and OPENAI_ORG_ID env variables.

Then run

uvx --from wcgw@latest wcgw_local --limit 0.1 # Cost limit $0.1

You can now directly write messages or press enter key to open vim for multiline message and text pasting.

Anthropic

Add ANTHROPIC_API_KEY env variable.

Then run

uvx --from wcgw@latest wcgw_local --claude

You can now directly write messages or press enter key to open vim for multiline message and text pasting.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wcgw-2.4.2.tar.gz (659.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wcgw-2.4.2-py3-none-any.whl (75.1 kB view details)

Uploaded Python 3

File details

Details for the file wcgw-2.4.2.tar.gz.

File metadata

  • Download URL: wcgw-2.4.2.tar.gz
  • Upload date:
  • Size: 659.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.21

File hashes

Hashes for wcgw-2.4.2.tar.gz
Algorithm Hash digest
SHA256 87f8bc535125459c98916e5be1686d6f2ab8567823c6743ff783022ab9c5cb0e
MD5 d043798ee44a7ae7402f2fccc5387297
BLAKE2b-256 951c65eacff771ca599a867c6fd7c5895d34ad41bbefac7f23614cfde63fc99e

See more details on using hashes here.

File details

Details for the file wcgw-2.4.2-py3-none-any.whl.

File metadata

  • Download URL: wcgw-2.4.2-py3-none-any.whl
  • Upload date:
  • Size: 75.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.21

File hashes

Hashes for wcgw-2.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 44a5cae091ba9b52f916900cacd0d892009ca78bfe9ad3f0f4d3e5bd9a4cbe5f
MD5 084961b7ae57ab1de5dff33fe58ac0f3
BLAKE2b-256 17a4e2710c814feb907e751cc95032a95e1cafb4de1cfc5d96868c4276d7b4f7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page