Invoking Grok 4.2 via dLazy CLI in Agent

Introduction

When generating text, handling QA, or performing reasoning in environments like Cursor or Claude Code, it is common to write HTTP calls manually and maintain keys and parameters yourself. The grok 4.2 on SkillHub (coordinate @user_f95f21b8/dlazy-grok-4-2) encapsulates this capability as a standard Skill: Agents invoke the grok-4.2 subcommand of the dLazy CLI according to SKILL.md, and the hosted API completes the inference. Below is an introduction to what it is, what it can do, and how to install and use it.

What is this

grok 4.2 is a community Skill (source community) under the ai-agent category on SkillHub. The current version is 1.0.9, published by user_f95f21b8. The official description is: Efficient text generation, dialogue QA, and logical reasoning using Grok 4.2 text model.

The Skill itself acts as a thin client: it accesses the dLazy hosted API (api.dlazy.com; local media files are uploaded to files.dlazy.com) via the npm package @dlazy/cli (fixed at 1.0.9 in this Skill’s metadata). For CLI source code and maintenance details, refer to the Skill documentation: github.com/dlazyai/cli, maintained by dlazyai. The SkillHub page shows a rating of 100000 and 1892 downloads (statistics are based on SkillHub).

Core Features

Based on SKILL.md, the verified capabilities and conventions are as follows:

  1. Text-related Tasks: Text generation, dialogue QA, and logical reasoning, provided by the Grok 4.2 text model via the dLazy API.
  2. CLI Entry: Agents should execute dlazy grok-4.2 to obtain results; help information can be viewed via dlazy grok-4.2 -h.
  3. Main Parameters: --prompt (the prompt); --dry-run (only prints the payload and cost estimate); --no-wait (returns generateId immediately for asynchronous tasks); --timeout (max asynchronous wait limit, default 1800 seconds).
  4. Trigger Keywords (to facilitate Agent matching): grok 4.2, generate text, qa, chat.
  5. Tags: SkillHub marks requires_api_key=true; a dLazy API Key must be configured before use.

The successful response example in the documentation includes modelId and outputs (the example shows an image type URL); in asynchronous scenarios, outputs may be empty, requiring polling with dlazy status <generateId> --wait.

Installation and Activation

1. Install SkillHub CLI (if not already installed)

command -v skillhub && skillhub --version

If not installed, follow the SkillHub Installation Instructions, for example, the full installation command:

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

2. Install the Skill to the current Agent’s skills directory

When installing, you must use --dir to point to the skills directory recognized by the current client; otherwise, it defaults to ./skills/ and may not be loaded. Common paths (from official installation docs):

  • Cursor: ~/.cursor/skills/
  • Codex: ~/.codex/skills/ or .agents/skills/ under the project
  • Claude Code: ~/.claude/skills/

Installation command (form provided by SkillHub search index):

skillhub install dlazy-grok-4-2 --namespace user_f95f21b8 --dir <your skills directory>

The SkillHub page also suggests: Let the Agent install @user_f95f21b8/dlazy-grok-4-2 based on https://skillhub.cn/install/skillhub.md.

3. Install dLazy CLI

The Skill metadata requires npm and npx on the local machine and pins the CLI version:

npm install -g @dlazy/cli@1.0.9

Alternatively, use it on-demand without global installation:

npx @dlazy/cli@1.0.9 <command>

4. Configure API Key

dlazy auth set YOUR_API_KEY

The key is written to the user configuration directory (macOS/Linux: ~/.dlazy/config.json; Windows: %USERPROFILE%\.dlazy\config.json). It can also be passed via the environment variable DLAZY_API_KEY. Keys can be obtained at dlazy.com/dashboard/organization/api-key.

After completing the above steps, restart or refresh the Agent to trigger calls to dlazy grok-4.2 via the Skill in conversations.

Typical Usage

The following examples are taken directly from the official Skill SKILL.md and can be reproduced in the terminal.

View subcommand help:

dlazy grok-4.2 -h

Basic invocation (--prompt is required):

dlazy grok-4.2 --prompt 'prompt text'

Estimate only, without actually requesting the API:

dlazy grok-4.2 --prompt 'prompt text' --dry-run

In an Agent session, when a user mentions keywords such as “grok 4.2”, “generate text”, “qa”, or “chat”, the Agent should execute the above CLI command as required by the Skill and feed the JSON result (ok, result, etc. fields) back to the user.

Use Cases and Notes

Who it is for: Developers already using Agent workflows like SkillHub / Cursor who want to uniformly invoke Grok 4.2 text capabilities via Skills and are willing to use dLazy accounts and APIs.

Limitations and Precautions:

  1. Network and Compliance: Requests are sent to the dLazy cloud service; local file paths passed in will be uploaded according to CLI logic. Please read the dlazy.com terms of service before use.
  2. Costs and Balance: --dry-run can be used to view estimates first; if code: "insufficient_balance" is returned, you need to recharge in the console (docs point to the credits settings page).
  3. Authentication Failure: If 401 / unauthorized occurs, check if the Key has been configured via dlazy auth set or DLAZY_API_KEY.
  4. Dependency Version: Please use @dlazy/cli@1.0.9 to match the Skill, avoiding behavioral deviations caused by inconsistencies with Skill metadata.
  5. SkillHub Statistics: The page showing 0 installs only reflects the platform’s counting method and does not affect local usage via --dir installation.

Conclusion

grok 4.2 consolidates Grok 4.2 text generation, dialogue QA, and reasoning into a single CLI path, and delegates execution to Agents via a standard SkillHub Skill, reducing the repetitive labor of building custom API wrappers. Details and installation entries:

  • SkillHub Page: https://www.skillhub.cn/skills/user_f95f21b8/dlazy-grok-4-2
  • API Index Address: https://api.skillhub.cn/user_f95f21b8/dlazy-grok-4-2
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye