The philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” The dsh-plugin-grok plugin introduced in this article is a developer preview plugin that uses the local Grok Build CLI to provide text, image, and video generation capabilities for models. It does not call Imagine via raw HTTP requests; instead, it directly executes the local grok binary.
Plugin Overview¶
- Plugin Name:
dsh-plugin-grok - Maintainer:
toolazytoname - Category: Model Inference
- License: MIT
- Core Value: Exposes the local Grok Build CLI as a DSH tool, supporting text, image, and video generation.
Installation and Enabling¶
Install the plugin under the web profile:
dsh plugin --profile web add github:toolazytoname/dsh-plugin-grok
After installation, restart dsh web and force refresh the browser.
If pnpm version >= 10 blocks the git prepare script, you can allow the build in the corresponding profile configuration:
# 在 ~/.dsh/profiles/web/pnpm-workspace.yaml
allowBuilds:
dsh-plugin-grok: true
Or install directly from a local checkout directory:
dsh plugin --profile web add /absolute/path/to/dsh-plugin-grok
Prerequisites¶
The following conditions must be met before using this plugin:
- Local Environment: Install Grok Build CLI and ensure the
grokcommand is available inPATH(usually located at~/.grok/bin/grok). - Authentication Method: Provide one of the following (official CLI priority is as follows):
grok login: A SuperGrok or grok.com session, which is written to~/.grok/auth.json. If both are present, this method takes priority.XAI_API_KEY: An API key obtained from console.x.ai.
- Network Proxy: When using the plugin in mainland China, set the environment variable
https_proxyorHTTPS_PROXY(for example, the Clash mixed porthttp://127.0.0.1:7891); the plugin forwards these variables.
Core Features¶
This plugin exposes three tools to the model:
grok_ask: For text tasks, including code review, planning, and writing. It callsgrok --prompt-file … --always-approveunder the hood.grok_imagine_image: For generating or editing still images. It callsgrokand restricts the tool set toimage_genandimage_edit.grok_imagine_video: For generating video clips. It callsgrokand restricts the tool set toimage_genandimage_to_video. Grok does not natively support text-to-video generation; this plugin implements it by first generating a still image and then converting it to video.
All operations will fail if grok is missing, no authentication is provided, the prompt is empty, the command exits with a non-zero code, or the media path cannot be resolved after the media run.
Typical Usage¶
You can test the plugin status and features via the CLI:
# 查看插件状态
npx dsh-plugin-grok status
# 文本生成
npx dsh-plugin-grok ask "summarize this repo"
# 图像生成
npx dsh-plugin-grok image "a red cube on a table" --ratio 1:1
# 视频生成
npx dsh-plugin-grok video "slow cinematic push-in" --duration 6 --resolution 480p
Notes and Limitations¶
- Quota Consumption: Users who use
grok loginconsume SuperGrok/coding-plan quota; users who use an API key consume console credits. - Generation Speed: Image and video generation are relatively slow.
- Video Generation Mechanism: Videos are generated by first creating still frames and then animating them, rather than being natively text-to-video.
- Process Isolation: Each tool call starts a local
grokprocess and does not use ACP or thegrok agent stdiowrapper. - Development Status: DeepSeek Harness is in developer preview; Cordis’s
apply+ctx.tools.registerinterface may change. - License: MIT License.