OpenCode CLI Controller for Openclaw

A specialized skill to orchestrate AI-driven code generation and project management via the OpenCode CLI local API.

malek262
v1.1.0
Feb 17, 2026
2
1.6k
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install opencode-api-control-skill

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 opencode-api-control-skill 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 OpenCode CLI Controller?

This skill serves as a bridge between an AI supervisor and the OpenCode CLI, enabling programmatic control through a local web server API. It empowers developers to act as high-level orchestrators, directing OpenCode to handle implementation, file operations, and quality checks without needing to modify source code directly.

By leveraging this tool among your Openclaw Skills, you can automate complex development workflows across a local network while maintaining a strict separation between the orchestrator and the executor. It provides a robust interface for session management, provider selection, and real-time task monitoring, ensuring that the AI agent remains a supervisor of the coding process rather than a manual file editor.

OpenCode CLI Controller Use Cases

  • Automated project creation and management through the OpenCode API
  • Executing AI-powered coding tasks, debugging, and code analysis remotely
  • Managing multiple development sessions and monitoring task progress programmatically
  • Integrating specific AI providers and models for specialized development workflows
  • Orchestrating multi-phase development cycles from planning to implementation

How OpenCode CLI Controller Works

  1. Initialize the OpenCode web server and verify its health status via the API to ensure the local environment is ready.
  2. Update the local providers cache using included scripts to sync available AI models and configurations.
  3. Create or select a project directory and initialize a unique development session with a specific ID.
  4. Send high-level instructions to the OpenCode engine using specific providers, models, or system defaults.
  5. Monitor task progress using either real-time event streaming or intelligent polling strategies with exponential backoff.
  6. Verify task completion and review generated changes via automated diff summaries and status checks.

OpenCode CLI Controller Setup

Ensure that curl, jq, and bash are installed on your system before beginning. You should have the OpenCode CLI installed and configured.

# Grant execution permissions to the scripts
chmod +x scripts/*.sh

# Start the OpenCode server
bash ./scripts/start_server.sh

# Wait 10-15 seconds for initialization, then update the providers cache
bash ./scripts/update_providers.sh

OpenCode CLI Controller Data Schema & Taxonomy

The skill manages state and configuration using a structured file system within its root directory to ensure reliable project orchestration.

Component Description
config.json Stores the base URL and base projects directory settings.
providers.json Caches details of currently connected AI providers and available models.
./state/ Directory containing JSON files for current and project-specific session states.
./scripts/ A collection of bash utilities for API interaction, monitoring, and state management.

OpenCode CLI Controller Advanced Features

  • Real-time event monitoring with text delta generation and live status tracking
  • Intelligent polling with exponential backoff to minimize API overhead and resource usage
  • Support for multi-phase development phases including Planning, Implementation, and Review agents
  • Robust state persistence and loading for managing complex projects across multiple sessions
  • Automated provider and model selection based on user-defined hints or configurations
  • Explicit operational boundaries that prevent direct file modification, ensuring the orchestrator-executor model

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*