Kimi CLI Headless Execution for Openclaw

A technical guide for executing Kimi Code CLI in non-interactive, headless environments like CI/CD and background scripts.

aiyouwolegequ
v0.0.1
Apr 15, 2026
0
667
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install test-rate-limit

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 test-rate-limit 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 Kimi CLI Headless Execution?

The Kimi CLI Headless Execution skill is designed to transition Kimi Code CLI from an interactive terminal user interface (TUI) to a powerful automation engine. By utilizing specific flags like quiet and print, this skill allows agents to perform code analysis, refactoring, and generation without human intervention. It is a critical component for users of Openclaw Skills who need to integrate high-level AI reasoning into automated DevOps pipelines, scripts, and non-TTY environments.

This skill ensures that commands are constructed with the correct lifecycle management, including session persistence and automated approval systems. It bridges the gap between manual AI interaction and programmatic code manipulation, providing a robust framework for developer-focused automation.

Kimi CLI Headless Execution Use Cases

  • Automating code refactoring and bug fixing within CI/CD pipelines.
  • Running background code analysis and documentation generation tasks.
  • Integrating Kimi AI capabilities into custom shell scripts and local automation tools.
  • Managing long-running AI tasks using multi-iteration autonomous modes.

How Kimi CLI Headless Execution Works

  1. Environment Check: The skill first verifies the installation of the Kimi CLI and checks for active authentication or API key configuration.
  2. Mode Selection: It determines the optimal output mode (quiet for clean text, print for verbose logs, or stream-json for programmatic parsing).
  3. Context Configuration: The working directory is set to ensure the AI has the correct project context.
  4. Command Construction: A precise command string is generated, incorporating safety flags like yolo for automated file writes when necessary.
  5. Execution & Parsing: The command is executed, and the skill captures exit codes and stdout/stderr to provide actionable summaries or trigger next steps.

Kimi CLI Headless Execution Setup

To get started with this skill for Openclaw Skills, ensure the Kimi CLI is installed and authenticated:

# Install the CLI tool
pip install kimi-cli

# Authenticate your account
kimi login

# (Optional) Verify installation
kimi --version

Ensure your environment variables or ~/.kimi/config.toml are correctly configured with your API keys for non-interactive access.

Kimi CLI Headless Execution Data Schema & Taxonomy

The skill manages inputs and outputs through a structured schema to maintain consistency across Openclaw Skills workflows:

Attribute Description Type
task_description The specific instruction for the AI agent String
output_mode Verbosity settings (quiet, print, stream-json) Enum
auto_approve Whether to enable --yolo for automated modifications Boolean
work_dir The directory where the task is executed Path
session_strategy Handling of session persistence (new, continue, resume) Enum

Kimi CLI Headless Execution Advanced Features

  • Ralph Iteration Mode: Allows the agent to loop through multiple thought-action cycles automatically until a task is completed.
  • Stream-JSON Integration: Provides structured output for every step of the AI's reasoning process, ideal for downstream data processing.
  • Wire Protocol Support: Enables the CLI to run as a local service, facilitating communication with IDE plugins or other automated agents.
  • Session Resume: Restores specific previous interaction contexts by using unique session IDs for continuous multi-stage workflows.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*