Minimal terminal CLI to send prompts into a real browser tab such as https://chatgpt.com.
Released under the MIT License. See LICENSE.
sky now defaults to a local unchainedsky-cli transport, so the normal path does not require a Sky API key or Sky agent. If you can open ChatGPT in Chrome and log in with your OpenAI account, sky can drive that browser session from the terminal.
- Drives a local Chrome session through
unchainedsky-cli - Navigates your connected browser to a URL
- Injects prompt text into visible chat input and optionally submits
- Supports one-shot mode and interactive shell mode
- Falls back to native browser actions if JS submit is not confirmed
- Shows a terminal thinking indicator and waits for render completion before final response capture
- Still supports the legacy Sky MCP transport with
--transport sky-mcp
Requires Python 3.10+.
pip install sky-prompt
sky --setupsky --setup will:
- install
unchainedsky-cliandpyreplabif they are missing - install a
skylauncher in~/.local/binwhen possible - launch Chrome to
https://chatgpt.com - tell you the next
skycommand to run
If pyreplab install fails, setup still completes and interactive /run falls back to local until pyreplab is installed.
If you want to run from a git checkout instead of PyPI:
git clone https://github.com/protostatis/sky_prompt.git
cd sky_prompt
./sky --setupOptional manual dependency installs:
pip install unchainedsky-cli pyreplabOptional repo-local development install with uv:
uv syncCustom alias setup if you want a second command name such as sk:
./sky --setup-alias sk
sk --help- Run setup:
sky --setup-
If ChatGPT is not already logged in for that browser session, finish the login in the opened browser tab.
-
Run a one-shot prompt:
sky -p "Explain MCP in one paragraph"- Run interactive mode:
sky -iUse scripts/orchestrator.py when ChatGPT should stay on one tab while browser
tools execute on another. The script prepares two aliases on the same
unchained port:
sky-chatforsky -psky-toolsformcportertool calls
Prepare or refresh the aliases only:
python3 scripts/orchestrator.py --prepare-tabs-onlyRun the full loop:
python3 scripts/orchestrator.py "find the cheapest laptop under 1000 on Amazon"Useful flags:
python3 scripts/orchestrator.py --incognito "compare hotel prices in Chicago"
python3 scripts/orchestrator.py --chat-tab-alias agent-chat --tool-tab-alias agent-tools "audit signup flow"
python3 scripts/orchestrator.py --skip-tab-setup "reuse existing aliases"The default transport is:
sky --transport unchainedThe simplest path is:
sky --setupManual flow if you want more control:
unchainedis installed and available inPATH, or you pass--unchained-cmd.skywill auto-launch Chrome on--unchained-port(default9222) if nothing is already listening there.- In the default profile mode, the selected Chrome profile is logged into the target site.
Useful flags:
sky --setup --chrome-profile "Profile 3"
sky --setup --incognito
sky --setup --guest
sky --setup --unchained-port 9333
sky --unchained-port 9333 "hello"
sky --browser-tab auto "hello"
sky --unchained-cmd "uvx unchainedsky-cli" "hello"--incognito and --guest auto-launch a fresh Chrome session instead of reusing a named profile. Those modes usually require logging into ChatGPT again in that window.
If ~/.local/bin is not on PATH, sky --setup will still work but your shell may not see the installed sky launcher until you add that directory to PATH.
If you still want to use the hosted Sky MCP path:
sky --transport sky-mcp -p "Explain MCP in one paragraph"Credentials are read from ~/sky-agent/.env or the environment:
export SKY_API_KEY="uc_live_..."
export SKY_AGENT_ID="claude-xxxxxxxx"sky still supports the first-run setup/import flow for that legacy transport.
One-shot on ChatGPT:
sky --url https://chatgpt.com -p "Write a 5-line Python script for a Poisson PMF"Interactive demo with format switching:
sky -i
# then inside shell:
/format markdown
show me a numpy ascii chart for poisson(lambda=4)
/format plain
now summarize in 3 bulletsOne-shot prompt:
sky "Summarize MCP in one paragraph"Interactive shell mode (default when no prompt is passed):
skyInside -i, Up/Down arrows recall your previous prompts (saved in ~/.sky_prompt_history).
Explicit flags:
sky -prompt "Hello from prompt mode"
sky -chatRead prompt from stdin:
echo "Write a haiku about browser automation" | \
skyFill only, do not submit:
sky --no-submit "Draft text only"Tune response waiting:
sky --wait-timeout 240 --poll-interval 1.0 "Long response request"Use another website:
sky --url https://chatgpt.com "What is MCP?"Choose output formatting:
sky --output-format markdown "Explain MCP"
sky --output-format plain "Explain MCP"
sky --output-format json "Explain MCP"json mode includes structured artifacts for automation:
artifacts.code_blocksdetected scriptsartifacts.command_blocksrunnable shell command groupsartifacts.output_blocksdetected output/result sectionsartifacts.copy_itemscopy-ready chunksartifacts.tool_hintssuggested runner commands
Run built-in closed-loop self-tests:
./sky --self-testDeveloper test loop (recommended while iterating):
./scripts/test_loop.sh
./scripts/test_loop.sh --watchsky --setup already tries to install sky into ~/.local/bin.
Use this when you want a second command name instead, for example sk:
sky --setup-alias skOptional flags:
sky --setup-alias sk --alias-dir ~/.local/bin
sky --setup-alias sk --force-aliasThen run:
sk -p "something short"Inside interactive mode:
/helpshow commands/url <url>navigate to another site/submit on|offtoggle auto-submit/format markdown|plain|jsonchange response rendering format/backend [local|pyreplab]choose/runexecution backend (default: pyreplab, falls back to local if unavailable)/py <code>passthrough inline Python directly into pyreplab session/pyfile <path.py>passthrough a local setup script into pyreplab session/history [n]show recent turns (default last 10)/lastreprint the latest turn using current format mode/cells [n|all]list detected runnable code cells (*marks the current cell)/show [cell_id]print cell content (defaults to the current cell)/run [cell_id] [timeout_seconds]execute a cell with the active backend (defaults to the current cell and prints the source first)/fork <source_cell_id> [new_cell_id]clone a cell for mutation/edit <cell_id>open cell in$EDITOR/$VISUAL/save <cell_id> <path>save a cell to disk/diff <cell_a> <cell_b>show unified diff between cells/ddmrun ddm read/exitquit
Press Ctrl-C during /run to cancel the active execution and stay inside -i.
Playground loop example:
sky -i
# ask for code, then:
/cells
/py import pandas as pd
/pyfile ./setup_lab.py
/run
/fork py1 py2
/edit py2
/diff py1 py2
/run py2pyreplab is the default /run backend when it is available, and sky falls back to local if it is not.
local still handles bash and other non-Python cells directly in the current workspace, and shell cells get python/python3/pip shims that point at the same interpreter sky is using.
/py, /pyfile, and /run share the same pyreplab session, so pre-imports persist for later cell runs.
Each -i session uses its own isolated pyreplab session directory to avoid cross-project leakage.
Use an explicit pyreplab command path:
sky -i --run-backend pyreplab --pyreplab-cmd /path/to/pyreplab
# or set PYREPLAB_CMD and use /backend pyreplab inside -iFast launch shortcut:
sky -i --pyreplabIf sky --setup reported that ~/.local/bin is missing from PATH, add it:
export PATH="$HOME/.local/bin:$PATH"Then run:
sky "Explain what an MCP session id is"- For the default
unchainedtransport, profile mode reuses the Chrome profile you launched.--incognitoand--guestcreate a fresh browser session instead. SKY_API_KEY,SKY_AGENT_ID, and~/sky-agent/.envonly matter when you opt into--transport sky-mcp.skytalks to a browser tab, not the OpenAI API directly. For ChatGPT usage, the only account dependency is your normal web login session.- The main CLI is intended to work on macOS and Linux anywhere
unchainedsky-cli, Chrome, and Python are available. - Browser foregrounding and window parking are macOS-only conveniences. On Linux and other non-macOS platforms,
skynow skips that focus management and leaves the browser/window state alone. - On macOS,
SKY_FOREGROUND_BROWSER=submit(the default) brings Chrome to the foreground for the submit sequence once and then returns focus to the terminal. SetSKY_FOREGROUND_BROWSER=pollfor aggressive background-safe polling,SKY_FOREGROUND_BROWSER=0to disable, orSKY_BROWSER_APPto override the browser app name. scripts/test_install_terminal.shis macOS-only because it drives Terminal throughosascript; it is not the cross-platform install test path.- Different sites use different input DOM patterns; this script targets common chat UIs and may need selector tweaks for edge cases.
- Use
--debugto print tool and transport diagnostics. - Interactive mode clears stale draft text on startup.
- Tool-path tags like
[js_eval]/[fallback]are hidden by default and shown only with--debug.
SkyPrompt is available under the MIT License. See LICENSE.