Chrome debugging REPL with CDP, script injection, and Claude skill support
npm install chrome-jigA CLI tool for Chrome debugging with script injection, file watching, and Claude skill support.
chrome-jig is a CLI for Chrome debugging workflows: launch, inject scripts, evaluate JavaScript, watch files, and re-inject on change. It uses CDP (Chrome DevTools Protocol) underneath — the same protocol that Chrome MCP, Puppeteer, and other tools use.
Where it helps over generic CDP tools: Compound operations that would otherwise require multiple manual steps. A named script registry resolves short names to URLs via project config (.cjig.json). File watching detects changes and re-injects automatically. Idempotent launch reuses an existing Chrome instance instead of failing on port conflicts. These are workflow-level conveniences — they compose CDP primitives, they don't extend them.
Where it doesn't help: Single evaluations, screenshots, DOM inspection, network traces. Any CDP client can do these equally well. Chrome MCP's evaluate_script and this tool's eval both call Runtime.evaluate in the end.
Independent developer workflow: The CLI is usable without any LLM. cjig launch && cjig inject my-script && cjig repl is a complete development loop with no AI in the path.
``bashFrom npm registry
pnpm add -g chrome-jig
Quick Start
`bash
Launch Chrome with debugging enabled
cjig launchStart interactive REPL
cjig replIn REPL:
> document.title
"My Page"> .tabs
→ [0] My Page
https://example.com
> .inject my-harness
Injected: http://localhost:5173/harnesses/my-harness.js
`CLI Commands
$3
`bash
cjig launch # Launch with default profile
cjig launch --profile=testing # Named profile
cjig status # Check if Chrome is running
cjig status --host=192.168.1.5 # Check remote Chrome
`$3
`bash
cjig tabs # List open tabs
cjig tab example # Select tab by URL pattern
cjig tab 0 # Select tab by index
cjig open https://... # Open new tab
`$3
`bash
cjig inject my-script # Inject by name (from config)
cjig inject https://... # Inject by URL
`$3
`bash
cjig eval "document.title" # One-shot eval
cjig eval "window.myApi.status()" # Call injected API
cjig cljs-eval "(+ 1 2)" # Evaluate ClojureScript
cjig repl # Interactive REPL
`$3
`bash
cjig nrepl # Start server, auto-assign port
cjig nrepl --nrepl-port 7888 # Specific port
`Starts a TCP nREPL server for native editor integration. ClojureScript forms are compiled via squint and evaluated in the browser over CDP.
Editors discover the port via
.nrepl-port written to the current directory.- Conjure (Neovim): Connects automatically. Evaluate CLJS forms in your buffer with standard Conjure keybindings.
- CIDER (Emacs): Not yet supported — CIDER's handshake expects richer metadata than we currently provide.
REPL Commands
`
> expression Evaluate JavaScript in browser.help Show available commands
.tabs List open tabs
.tab Switch to tab
.open Open new tab
.inject Inject script
.reload Reload current tab
.watch [on|off] Toggle file watching
.build Run preBuild hook
.config Show current config
.clear Clear console
.exit Exit REPL
`Configuration
$3
`json
{
"defaults": {
"port": 9222,
"profile": "default"
},
"chrome": {
"path": "/path/to/chrome",
"flags": ["--disable-background-timer-throttling"]
}
}
`$3
`json
{
"scripts": {
"baseUrl": "http://localhost:5173/harnesses/",
"registry": {
"bs": {
"path": "block-segmenter-harness.js",
"label": "Block Segmenter",
"windowApi": "BlockSegmenter",
"alias": "BS",
"quickStart": "BS.overlayOn()"
}
}
},
"watch": {
"paths": ["dist/harnesses/*.js"],
"debounce": 300
},
"hooks": {
"preBuild": "pnpm build:harnesses"
}
}
`Environment Variables
| Variable | Default | Description |
| -------------- | ------------- | ----------------- |
|
CJIG_PORT | 9222 | CDP port |
| CJIG_PROFILE | default | Profile name |
| CJIG_HOST | localhost | Chrome host |
| CHROME_PATH | (auto-detect) | Chrome executable |Shell Setup
`bash
cjig env >> ~/.zshrc
source ~/.zshrc
`This adds:
-
cjr - alias for cjig repl
- cjl - alias for cjig launch
- cjt - alias for cjig tabsUse as Claude Skill
`bash
cjig install-skill # Symlinks this package to ~/.claude/skills/chrome-jig
cjig uninstall-skill # Removes the symlink
`Then Claude can use it via the SKILL.md instructions.
Directory Layout (XDG)
`
~/.config/cjig/
├── config.json # Global config
└── profiles/ # Named config profiles~/.local/share/cjig/
└── chrome-profiles/ # Chrome user-data dirs
└── default/
~/.local/state/cjig/
└── last-session.json # Session state
``See ARCHITECTURE.md for technical internals — module structure, data flow diagrams, CDP execution model, and design decisions.
MIT