Grok Image CLI for Openclaw

A secure command-line tool for generating and editing high-quality images using the xAI Grok API models.

cyberash-dev
v0.2.1
Feb 21, 2026
0
2.2k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install grok-image-cli

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install grok-image-cli using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Grok Image CLI?

Grok Image CLI is a professional-grade command-line interface designed to streamline the process of generating and editing images through the xAI Grok API. Powered by the official Vercel AI SDK, it provides a robust bridge between your terminal and advanced models like grok-2-image-1212 and grok-imagine-image-pro. As a key utility within the ecosystem of Openclaw Skills, it emphasizes security and developer productivity, offering a seamless way to incorporate AI-driven visual creation into any local or automated workflow.

The tool is built with a focus on cross-platform compatibility and secure data handling. It avoids plaintext storage of sensitive information by leveraging native OS credential stores, such as the macOS Keychain and Windows Credential Manager. Whether you are generating assets for a new project or performing complex edits on existing images, this tool provides the flexibility and power needed for modern AI-assisted development.

Grok Image CLI Use Cases

  • Rapidly generating UI/UX mockups or placeholder assets directly from the terminal during development.
  • Automating batch image generation with specific aspect ratios for multi-platform marketing content.
  • Editing existing photos or remote images using natural language prompts to apply styles or modifications.
  • Integrating high-quality AI image generation into automated scripts and workflows using Openclaw Skills.

How Grok Image CLI Works

  1. Installation occurs via npm or source, making the grok-img command available globally across macOS, Windows, or Linux.
  2. The user authenticates securely using the auth login command, which stores the xAI API key in the system's native secure storage.
  3. A generation or edit command is issued, where the user specifies parameters such as the model, prompt, aspect ratio, and output directory.
  4. The CLI sends an authorized HTTPS request to the xAI API, processing the visual transformation or creation request.
  5. The resulting images are downloaded and saved directly to the local file system in the specified output folder.

Grok Image CLI Setup

Ensure you have Node.js >= 20.19.0 installed. Install the package globally and authenticate with your xAI API key:

npm install -g grok-image-cli
grok-img auth login

You can verify your authentication status at any time using:

grok-img auth status

Grok Image CLI Data Schema & Taxonomy

Grok Image CLI maintains a clean footprint by avoiding local configuration files. Data is managed as follows:

Data Type Storage Method Location
API Credentials Native OS Credential Store macOS Keychain / Windows Credential Manager / Linux Secret Service
Output Images Local File System Default: ./grok-images (configurable via -o flag)
Configuration CLI Flags Passed at runtime per execution

Grok Image CLI Advanced Features

  • Support for multiple xAI models including grok-imagine-image-pro and grok-2-image-1212 for varied quality and style requirements.
  • Remote image processing capability, allowing you to edit images directly from a URL without manual downloading.
  • Batch generation support, enabling the creation of up to 10 images simultaneously with a single command.
  • Flexible aspect ratio controls with support for common formats like 16:9, 4:3, and custom ratios like 21:9.
  • Environment variable fallback for CI/CD environments where interactive login is not possible, enhancing the utility of Openclaw Skills in automated pipelines.

SKILL.md


Loading

Related Openclaw Skills

Featured*