Skip to content

Grok

Mode: Default Grok adapter + optional explicit consumer web path · Domain: grok.com

Commands

CommandDescription
opencli grok askKeep the default Grok ask behavior
opencli grok ask --webUse the explicit grok.com consumer web UI flow

Usage Examples

bash
# Default / compatibility path
opencli grok ask --prompt "Explain quantum computing in simple terms"

# Explicit consumer web path
opencli grok ask --prompt "Explain quantum computing in simple terms" --web

# Best-effort fresh chat on the consumer web path
opencli grok ask --prompt "Hello" --web --new

# Set custom timeout (default: 120s)
opencli grok ask --prompt "Write a long essay" --web --timeout 180

Options

OptionDescription
--promptThe message to send (required)
--timeoutWait timeout in seconds (default: 120)
--newStart a new chat before sending (default: false)
--webOpt into the explicit grok.com consumer web flow (default: false)

Behavior

  • opencli grok ask keeps the upstream/default behavior intact.
  • opencli grok ask --web switches to the newer hardened consumer-web implementation.
  • The --web path adds stricter composer detection, clearer blocked/session-gated hints, and waits for a stabilized assistant bubble before returning.

Prerequisites

  • The Grok adapter still depends on browser-backed access to grok.com
  • For --web, Chrome should already be running with an authenticated Grok consumer session
  • Browser Bridge extension installed

Caveats

  • --web drives the Grok consumer web UI in the browser, not an API.
  • It depends on an already-authenticated session and can fail if Grok shows login, challenge, rate-limit, or other session-gating UI.
  • It may break when the Grok composer DOM, submit button behavior, or message bubble structure changes.

Released under the Apache-2.0 License.