Universal Command for Openclaw

A unified framework to define command logic once and automatically deploy it across CLI, Next.js APIs, and Model Context Protocol (MCP) tools.

ianderrington
v1.0.0
Mar 1, 2026
0
881
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install universal-command

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 universal-command 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 Universal Command?

Universal Command is a powerful development framework designed to solve the problem of interface fragmentation. Instead of writing separate implementations for command-line tools, web APIs, and AI agent protocols, this package allows developers to maintain a single source of truth for their application logic.

By utilizing Openclaw Skills, developers can ensure that their logic remains consistent across all deployment surfaces while significantly reducing maintenance overhead. The skill provides a robust structure for defining input parameters, execution handlers, and interface-specific overrides, making it an essential tool for building modern, AI-ready applications that need to be accessible to both humans and automated agents.

Universal Command Use Cases

  • Building new Supernal commands or tools that require multiple access points.
  • Exposing internal application logic to AI agents via the Model Context Protocol (MCP).
  • Creating REST APIs with consistent validation patterns for Next.js or Express.
  • Adding a CLI interface to existing business logic without duplicating code.

How Universal Command Works

  1. Define a UniversalCommand instance with a unique name, description, and input schema.
  2. Implement a single asynchronous handler that contains the core business logic and receives validated arguments.
  3. Use the provided conversion methods such as toCLI(), toNextAPI(), or toMCP() to export the command to various platforms.
  4. Manage multiple commands through a CommandRegistry for centralized deployment and automated route generation.
  5. Execute logic within the framework to automatically handle input validation, type safety, and context-aware processing.

Universal Command Setup

Install the package via npm:

npm install @supernal/universal-command

Import and initialize your first command in your TypeScript project:

import { UniversalCommand } from '@supernal/universal-command';

Universal Command Data Schema & Taxonomy

Universal Command uses a structured input schema to define parameters and validate incoming data across all Openclaw Skills implementations.

Property Description Type
name The identifier for the command used in CLI and API routes. String
description Detailed explanation of the command purpose for AI discovery. String
parameters Array of input definitions including name, type, and requirements. Array
enum Restricts parameter values to a specific set of strings. Array
default Provides a fallback value if the parameter is not supplied. Mixed

Universal Command Advanced Features

  • Interface-specific overrides to customize formatting, streaming, or caching for specific platforms.
  • Execution context detection to modify behavior based on whether the caller is a CLI, API, or AI agent.
  • Runtime server support for Express and Next.js for instant deployment without manual routing.
  • Automated code generation for Next.js routes and MCP server configurations.
  • Integrated testing utilities to verify logic across all Openclaw Skills surfaces simultaneously.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*