Skip to content

ChatGPT Web

Mode: 🔐 Browser · Domain: chatgpt.com

Commands

CommandDescription
opencli chatgpt ask <prompt>Send a prompt and wait for the visible response
opencli chatgpt send <prompt>Send a prompt without waiting
opencli chatgpt readRead the current conversation
opencli chatgpt historyList visible conversation history links from the sidebar
opencli chatgpt detail <id-or-url>Open a conversation by /c/<id> and read it
opencli chatgpt newStart a new conversation
opencli chatgpt statusCheck page and login state
opencli chatgpt image <prompt>Generate images in ChatGPT web and optionally save them locally

Usage Examples

bash
# Ask and wait for the answer
opencli chatgpt ask "Summarize the tradeoffs of browser session reuse"

# Continue the same ChatGPT tab but do not wait for the answer
opencli chatgpt send "Now turn that into a checklist"

# Read the current conversation
opencli chatgpt read --markdown true

# List recent visible conversations and read one by id or URL
opencli chatgpt history --limit 10
opencli chatgpt detail "https://chatgpt.com/c/<conversation-id>"

# Start a fresh chat
opencli chatgpt new

# Generate an image and save it to the default directory
opencli chatgpt image "a cyberpunk city at night"

# Upload a local image, ask ChatGPT to edit it, and save the result
opencli chatgpt image "make the background blue" --image ./cat.png

# Upload multiple local images for a combined edit
opencli chatgpt image "combine these into a poster" --image ./cat.png,./logo.png

# Save to a custom output directory
opencli chatgpt image "a robot sketching on paper" --op ~/Downloads/chatgpt-images

# Only generate in ChatGPT and print the conversation link
opencli chatgpt image "a tiny watercolor fox" --sd true

Options

OptionDescription
promptPrompt to send (required for ask, send, and image)
--timeoutMax seconds for ask to wait for a response (default: 120)
--newStart a new conversation before ask / send
--markdownConvert assistant message HTML to Markdown for read / detail
--limitMax visible history conversations to return (default: 20)
--imageLocal image path to attach before prompting; comma-separated paths are supported
--opOutput directory for downloaded images (default: ~/Pictures/chatgpt)
--sdSkip download and only print the ChatGPT conversation link

Behavior

  • ChatGPT web commands use persistent site sessions by default, so consecutive ask / send / read / detail commands continue in the same ChatGPT tab. Use --site-session ephemeral for one-shot isolated tabs.
  • ask waits for the first stable assistant response after sending. send submits only and returns immediately.
  • history reads visible /c/<id> links from the ChatGPT sidebar; it does not use private backend APIs.
  • image opens a fresh chatgpt.com/new page before sending the image prompt.
  • When --image is provided, local images are uploaded first and the prompt is sent as an image edit request.
  • image output is plain status / file / link, not a markdown table.
  • When --sd is enabled, the command does not download files and only prints the ChatGPT link.
  • Downloaded files are named with a timestamp to avoid overwriting prior runs.

Prerequisites

Caveats

  • This adapter targets the ChatGPT web UI, not the macOS desktop app.
  • It depends on the current browser session and can fail if ChatGPT shows login, challenge, quota, or other gating UI.
  • DOM or product changes on ChatGPT can break composer detection, image detection, or export behavior.

Released under the Apache-2.0 License.