Minimal terminal CLI to prompt browser chat UIs through a local browser or Sky MCP.
Project description
SkyPrompt
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.
What It Does
- 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
Install
Requires Python 3.10+.
pip install sky-prompt
sky --setup
sky --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 --setup
Optional manual dependency installs:
pip install unchainedsky-cli pyreplab
Optional repo-local development install with uv:
uv sync
Custom alias setup if you want a second command name such as sk:
./sky --setup-alias sk
sk --help
Quickstart
- 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 -i
Local Browser Flow
The default transport is:
sky --transport unchained
The simplest path is:
sky --setup
Manual 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.
Legacy Sky MCP Flow
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.
Demo
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 bullets
Quick Usage (Claude-Like)
One-shot prompt:
sky "Summarize MCP in one paragraph"
Interactive shell mode (default when no prompt is passed):
sky
Inside -i, Up/Down arrows recall your previous prompts (saved in ~/.sky_prompt_history).
Explicit flags:
sky -prompt "Hello from prompt mode"
sky -chat
Read prompt from stdin:
echo "Write a haiku about browser automation" | \
sky
Fill 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-test
Developer test loop (recommended while iterating):
./scripts/test_loop.sh
./scripts/test_loop.sh --watch
Custom Alias Setup
sky --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 sk
Optional flags:
sky --setup-alias sk --alias-dir ~/.local/bin
sky --setup-alias sk --force-alias
Then run:
sk -p "something short"
Interactive Commands
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 py2
pyreplab 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 -i
Fast launch shortcut:
sky -i --pyreplab
Add To PATH
If 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"
Notes
- 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.
License
SkyPrompt is available under the MIT License. See LICENSE.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sky_prompt-0.2.0.tar.gz.
File metadata
- Download URL: sky_prompt-0.2.0.tar.gz
- Upload date:
- Size: 82.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae28517758f04c23541f231a98588d759833e4fb9d25a650ae019d782d4d02ae
|
|
| MD5 |
4ee0af43fa82d9d3e4224618bdb9d69e
|
|
| BLAKE2b-256 |
e8732bf930decdcae39c5cf54fe6e71fe0c88c0091e8f32588c614f0db621454
|
File details
Details for the file sky_prompt-0.2.0-py3-none-any.whl.
File metadata
- Download URL: sky_prompt-0.2.0-py3-none-any.whl
- Upload date:
- Size: 83.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc041dbb764a40bc66f348baf9ffce2421aa4e905d9d3488f090a9c817dfecd6
|
|
| MD5 |
df0c4ed7d4a08531a12846a173989096
|
|
| BLAKE2b-256 |
8a76e330282096fcb500bcfbdc1094e8cb0028029a2f035051d9e358bfe24850
|