[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-81802":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":15,"stars7d":16,"stars30d":12,"stars90d":14,"forks30d":14,"starsTrendScore":17,"compositeScore":18,"rankGlobal":9,"rankLanguage":9,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":9,"pushedAt":9,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":14,"starSnapshotCount":14,"syncStatus":27,"lastSyncTime":28,"discoverSource":29},81802,"grok-cli","Moore-developers\u002Fgrok-cli","Moore-developers","OAuth-first CLI for Grok and xAI capabilities",null,"Rust",48,10,1,0,5,9,15,3.12,"MIT License",false,"master",true,[],"2026-06-12 02:04:19","# grok-cli\n\n[中文说明](README.zh-CN.md)\n\n> Grok \u002F xAI in a terminal-first, scriptable, and agent-ready CLI.\n\n## Features\n\n- **OAuth-only auth** — sign in with SuperGrok or X Premium+, no API key needed.\n- **Flat command surface** — one CLI for chat, search, image, video, audio, and usage.\n- **Streaming by default** — readable text for humans, `--json` for automation.\n- **Media inputs** — local files and remote URLs for image, video, and audio.\n- **Cross-platform** — pre-built for macOS Apple Silicon and Windows x64.\n\n## Installation\n\n```bash\n# Agent runtime (recommended)\nnpx --yes skills add Moore-developers\u002Fgrok-cli --skill grok-cli --global --yes\n\n# From source (Rust 1.88+)\ncargo install --git https:\u002F\u002Fgithub.com\u002FMoore-developers\u002Fgrok-cli.git --locked\n\n# Release binary\n# Download from GitHub Releases\n```\n\nSource installs require Rust 1.88+ (toolchain pinned to 1.92.0). On macOS Apple Silicon and Windows x64, the bundled skill prefers the release binary.\n\nRelease assets:\n\n- macOS Apple Silicon: `grok-cli-macos-aarch64-apple-darwin.tar.gz`\n- Windows x64: `grok-cli-windows-x86_64-pc-windows-msvc.zip`\n\n## Quick Start\n\n```bash\n# 1. Log in with your browser\ngrok-cli login\n\n# 2. Verify the session\ngrok-cli status\n\n# 3. Run your first task\ngrok-cli chat \"Summarize the latest AI news\"\n\n# 4. Check usage\ngrok-cli usage\n```\n\nHeadless environment? Use `grok-cli login --manual-paste` for a code-based login flow.\n\n## Usage\n\n### Chat & Search\n\n```bash\n# Stream a response (default)\ngrok-cli chat \"What's new in AI?\"\ngrok-cli search \"Thoughts on Grok 3?\"\n\n# Non-streaming\ngrok-cli chat \"Summarize AI news\" --no-stream\n\n# With explicit X search results\ngrok-cli chat \"Latest xAI updates\" --with-x-search\n\n# Pure chat without web search\ngrok-cli chat \"Hello\" --no-web-search\n\n# JSON for scripts\ngrok-cli search --json --query \"Grok updates\"\n```\n\n### Image & Video\n\n```bash\ngrok-cli image \"A cinematic skyline at sunrise\"\ngrok-cli image-edit --image .\u002Fsource.png --prompt \"Make it cinematic\"\ngrok-cli video \"Animate a futuristic skyline\" --duration 8\ngrok-cli video-edit --video-url https:\u002F\u002Fexample.com\u002Fsource.mp4 --prompt \"Make it cinematic\"\ngrok-cli video-extend --video-url https:\u002F\u002Fexample.com\u002Fsource.mp4 --prompt \"Continue the camera move\" --duration 6\n```\n\n### Audio\n\n```bash\ngrok-cli tts \"Hello from Grok\"\ngrok-cli stt .\u002Fsample.wav\ngrok-cli stt-stream .\u002Fsample.wav --interim-results\n```\n\n### Model\n\n```bash\n# View current model\ngrok-cli model\n\n# Set a specific model for chat and search\ngrok-cli model --model grok-4.3\n```\n\n## JSON Output\n\nAll commands accept `--json` for stable structured output. The envelope is consistent:\n\n```json\n{\n  \"ok\": true,\n  \"command\": \"chat\",\n  \"data\": {}\n}\n```\n\nOn failure:\n\n```json\n{\n  \"ok\": false,\n  \"command\": \"chat\",\n  \"error\": {\n    \"code\": \"auth_missing\",\n    \"message\": \"...\",\n    \"relogin_required\": false,\n    \"entitlement_denied\": false\n  }\n}\n```\n\n## For AI Agents\n\nDesigned for Codex, Claude Code, Cursor, and other agent runtimes. Install the bundled skill — it handles auth, command routing, and install checks automatically:\n\n```bash\nnpx --yes skills add Moore-developers\u002Fgrok-cli --skill grok-cli --global --yes\n```\n\n## Commands\n\n| Command | Description |\n| --- | --- |\n| `login` | Start xAI OAuth login in the system browser |\n| `status` | Check OAuth session status |\n| `refresh` | Refresh the saved access token |\n| `logout` | Delete local auth state |\n| `chat` | Text chat with Grok (includes web search by default) |\n| `search` | Search X via Grok `x_search` |\n| `image` | Generate an image |\n| `image-edit` | Edit reference images |\n| `video` | Generate a video |\n| `video-edit` | Edit a video |\n| `video-extend` | Extend a video |\n| `tts` | Text-to-speech |\n| `stt` | Speech-to-text |\n| `stt-stream` | Streaming STT over WebSocket (experimental) |\n| `usage` | Show local session usage and rate-limit snapshots |\n| `model` | Set the default text model for `chat` and `search` |\n| `state` | Inspect redacted local auth state |\n\nUse `--help` on any command for details.\n\n## State\n\n- **Auth tokens**: `~\u002F.grok-cli\u002Fauth.json`\n- **Usage history**: `~\u002F.grok-cli\u002Fsession.db` (SQLite)\n\nUsage history tracks session totals, per-command events, media-type breakdowns, and rate-limit snapshots. Media files are not stored.\n\n## Development\n\n```bash\ncargo test\ncargo build --release\ncargo install --path . --force\n```\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) and [SECURITY.md](SECURITY.md).\n\n## Documentation\n\n- [Quickstart](docs\u002Fguides\u002Fquickstart.md)\n- [Command reference](docs\u002Fcommands\u002Findex.md)\n- [Troubleshooting](docs\u002Fguides\u002Ftroubleshooting.md)\n- [Changelog](CHANGELOG.md)\n","grok-cli 是一个以终端优先、可脚本化和代理就绪的命令行工具，用于访问 Grok 和 xAI 功能。其核心功能包括仅使用 OAuth 进行身份验证、支持聊天、搜索、图像、视频、音频处理及用量查询等，并默认采用流式输出以便于人类阅读或通过 `--json` 选项适配自动化流程。此外，它还支持本地文件与远程 URL 作为媒体输入源，且跨平台预构建了 macOS Apple Silicon 和 Windows x64 版本。该项目适用于需要在命令行环境中集成 AI 能力的开发者，尤其是在构建基于 AI 的自动化工作流时尤为适用。",2,"2026-06-11 04:06:45","CREATED_QUERY"]