agentcli-go for Openclaw

A comprehensive Go framework for scaffolding and building standardized CLI tools optimized for AI agent integration.

gh-xj
v1.0.0
Feb 23, 2026
0
1.6k
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install agentcli-go

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 agentcli-go 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 agentcli-go?

agentcli-go is a specialized framework designed to accelerate the development of Go-based command-line interfaces. It provides a suite of shared helpers and modules that simplify the repetitive tasks involved in creating robust agentic tools. By leveraging this framework within the Openclaw Skills ecosystem, developers can ensure their CLI projects follow a consistent architecture, making them easier to debug, extend, and integrate with autonomous agents.

The framework excels at handling core CLI requirements such as configuration management, logging, and process lifecycle hooks. It is built to be modular yet opinionated, enforcing a Golden Project Layout that keeps codebases organized and maintainable. Whether you are building a simple utility or a complex multi-agent bridge, this tool provides the foundational infrastructure needed to scale.

agentcli-go Use Cases

  • Rapidly scaffolding new Go CLI projects with standardized directory structures.
  • Adding pre-configured command presets like file synchronization or HTTP clients to existing tools.
  • Managing complex configuration hierarchies where environment variables, flags, and files must interact seamlessly.
  • Implementing health checks and environment validation using the built-in doctor reporting system.
  • Creating highly testable CLI tools with integrated smoke testing and schema validation.

How agentcli-go Works

  1. Initialize a new project or command using the agentcli-go scaffolding engine to generate the Golden Project Layout.
  2. Define your application's entry point using the cobrax pattern, which automatically wires persistent flags like verbose, config, and JSON output.
  3. Configure your application's settings via configx, which handles precedence across defaults, files, environment variables, and CLI flags.
  4. Implement your business logic within the provided AppContext, utilizing shared helpers for logging, file system operations, and external command execution.
  5. Integrate lifecycle hooks to manage preflight and postflight operations, ensuring clean execution and error handling.
  6. Use the included Taskfile to run a canonical CI pipeline that includes linting, formatting, and deterministic smoke tests.

agentcli-go Setup

To start using this library in your Go project, install the module:

go get github.com/gh-xj/agentcli-go

You can scaffold a new project directly through the CLI or programmatically within your Openclaw Skills workflow:

# Scaffolding a new tool
agentcli new --name my-tool --module github.com/me/my-tool

# Adding a new command to an existing project
agentcli add command --name sync --preset file-sync

agentcli-go Data Schema & Taxonomy

The framework enforces a structured layout for all projects to maintain compatibility across the Openclaw Skills ecosystem:

Directory Purpose
cmd/ Contains CLI command definitions using the cobrax pattern
internal/app/ Core application logic, bootstrap, and lifecycle management
internal/config/ Configuration schemas and loading logic
pkg/version/ Versioning metadata and build information
test/smoke/ Deterministic JSON-based smoke tests and schemas

Configuration is typically handled via a JSON file or environment variables prefixed with the application name (e.g., MYTOOL_CONFIG).

agentcli-go Advanced Features

  • Advanced lifecycle management using the Hook interface for Preflight and Postflight automation.
  • Automated configuration normalization that maps system environment variables to structured Go types.
  • Built-in scaffolding presets for common agent tasks like file-sync, http-client, and deployment-helpers.
  • Comprehensive Taskfile integration for one-command CI/CD, including schema validation and documentation checks.
  • Automatic dependency checking and binary location helpers for managing external CLI requirements.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*