Metadata-Version: 2.4
Name: unix-chrome-cli
Version: 0.1.0
Summary: Drive Chrome's DevTools Protocol over a unix domain socket
License-Expression: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: websockets

# unix-chrome-cli
Connect to the chrome dev socket running via unix domain socket.


## Motivation
I don't like having privileged services run on localhost. In theory, you could run everything in docker / network jails but it is a pain. Unix domain sockets are a nice alternative to TCP ip sockets with limited access.

Using [netns-jail](https://github.com/talwrii/netns-jail) (by me) you can route traffic that would go through TCP ip on localhost through a unix domain socket. Once you have done this, this tool lets you connect to chrome's development socket through unix domain sockets.

## Alternatives
You don't need to use this at all. You could just let things run on localhost and connect to this. Ther are then a variety of tools you can use. You can use playwright. You can use selenium.

You could make a similar `netns` style wrapper with socat running in it to redirect TCP connections to unix domain socket.

## Installation
`pipx install unix-chrome-cli`


## Usage
Start chrome in a jail with a unix domain socket port.

`netns-jail --nat --dns --forward /tmp/chrome.sock:localhost:9222 -- google-chrome --user-data-dir=/tmp/cj --remote-debugging-port=9222`

Connect `uchrome set-socket /tmp/chrome.sock`

You can then run various commands.

* `uchrome go url`
* `uchrome back`
* `uchrome dom`


## LLM use
You can then use this with something like claude code.

