- Run a relay server with a domain name and https support (or use ngrok) use the instructions in next section.
- Create a custom gpt that connects to the relay server, instructions in next sections.
- Run the client in any directory of choice.
uvx wcgw@latest
- The custom GPT can now run any command on your terminal
Run the server
gunicorn --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:443 src.wcgw.relay.serve:app --certfile fullchain.pem --keyfile privkey.pem
If you don't have public ip and domain name, you can use ngrok
or similar services to get a https address to the api.
Then specify the server url in the wcgw
command like so:
uv tool run --python 3.12 wcgw@latest --server-url wss://your-url/v1/register
Run the server
uv tool run --python 3.12 --from wcgw@latest wcgw_relay
This will start an uvicorn server on port 8000. You can use ngrok to get a public address to the server.
ngrok http 8000
Then specify the ngrok address in the wcgw
command like so:
uv tool run --python 3.12 wcgw@latest --server-url wss://4900-1c2c-6542-b922-a596-f8f8.ngrok-free.app/v1/register
I've used the following instructions and action json schema to create the custom GPT. (Replace wcgw.arcfu.com with the address to your server)
https://github.com/rusiaaman/wcgw/blob/main/gpt_instructions.txt https://github.com/rusiaaman/wcgw/blob/main/gpt_action_json_schema.json
Let the chatgpt know your user id in any format. E.g., "user_id=" followed by rest of your instructions.
Your commands are relayed through a server to the terminal client.
Chatgpt sends a request to the relay server using the user id that you share with it. The relay server holds a websocket with the terminal client against the user id and acts as a proxy to pass the request.
It's secure in both the directions. Either a malicious actor or a malicious Chatgpt has to correctly guess your UUID for any security breach.
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.