← Back to Skills Marketplace
gh-xj

agentcli-go

by xj · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
580
Downloads
0
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install agentcli-go
Description
agentcli-go framework reference for building Go CLI tools. Use when working on agentcli-go itself, scaffolding new CLI projects, adding commands, integrating...
README (SKILL.md)

agentcli-go

Shared Go CLI helpers and framework modules.

Module: github.com/gh-xj/agentcli-go Repo: github.com/gh-xj/agentcli-go | Versioning: v0.x.y (pre-1.0)


API Surface

File Exported Symbols
log.go InitLogger() — zerolog setup, respects -v/--verbose
args.go ParseArgs(args), RequireArg(args, name), GetArg(args, name), HasFlag(args, name)
exec.go RunCommand(name, args...), RunOsascript(script), Which(bin), CheckDependency(bin)
fs.go FileExists(path), EnsureDir(path), GetBaseName(path)
core_context.go AppContext{Meta, Values}, NewAppContext(ctx)
lifecycle.go Hook interface (Preflight, Postflight), RunLifecycle(app, hook, run)
errors.go CLIError, ResolveExitCode(err), ExitSuccess, ExitUsage
scaffold.go ScaffoldNew(baseDir, name, module), ScaffoldAddCommand(rootDir, name, desc, preset), Doctor(rootDir) DoctorReport
cobrax/cobrax.go Execute(RootSpec, args) int, NewRoot(RootSpec) *cobra.Command, CommandSpec, RootSpec
configx/configx.go Load(Options) map[string]any, Decode[T](raw), NormalizeEnv(prefix, environ)

Scaffold Workflows

New project

agentcli new --name my-tool --module github.com/me/my-tool
# or programmatically:
agentcli.ScaffoldNew(".", "my-tool", "github.com/me/my-tool")

Generates: main.go, cmd/root.go, internal/app/, internal/config/, internal/io/, internal/tools/smokecheck/, pkg/version/, test/, Taskfile.yml, README.md

Add command

agentcli add command --name sync --preset file-sync
agentcli add command --name deploy --desc "run deploy checks"

Presets: file-sync, http-client, deploy-helper

Doctor check

agentcli doctor [--dir ./my-tool]
# returns DoctorReport JSON with findings

Golden Project Layout

my-tool/
├── main.go                          # os.Exit(cmd.Execute(os.Args[1:]))
├── cmd/
│   ├── root.go                      # cobrax.Execute(RootSpec{...})
│   └── \x3Ccommand>.go                 # func \x3CName>Command() command
├── internal/
│   ├── app/{bootstrap,lifecycle,errors}.go
│   ├── config/{schema,load}.go
│   ├── io/output.go
│   └── tools/smokecheck/main.go
├── pkg/version/version.go
├── test/
│   ├── e2e/cli_test.go
│   └── smoke/version.schema.json
└── Taskfile.yml

cobrax Pattern

// cmd/root.go
return cobrax.Execute(cobrax.RootSpec{
    Use:   "my-tool",
    Short: "my-tool CLI",
    Meta:  agentcli.AppMeta{Name: "my-tool", Version: version.Version},
    Commands: []cobrax.CommandSpec{
        {Use: "sync", Short: "sync files", Run: SyncCommand().Run},
    },
}, args)

Persistent flags auto-wired: --verbose/-v, --config, --json, --no-color Values accessible via app.Values["json"], app.Values["config"], etc.


configx Pattern

raw, err := configx.Load(configx.Options{
    Defaults: map[string]any{"env": "default"},
    FilePath: configPath,   // optional JSON file
    Env:      configx.NormalizeEnv("MYTOOL_", os.Environ()),
    Flags:    map[string]string{"env": flagVal},
})
cfg, err := configx.Decode[config.Config](raw)
// Precedence: Defaults \x3C File \x3C Env \x3C Flags

Taskfile Tasks

Task Purpose
task ci Canonical CI: preflight + lint + test + build + smoke + schema checks
task verify Local aggregate (wraps ci)
task lint go vet + golangci-lint
task smoke Deterministic smoke tests (subset of unit tests)
task schema:check Validate JSON contracts against schemas
task docs:check Ensure skill docs match CLI help signatures
task fmt Format all Go files

Rules

  • Flat package — everything in package agentcli, no sub-packages (except cobrax, configx)
  • Exported only — all functions PascalCase; this is a library
  • No business logic — generic utilities only; must be reused across 2+ projects to qualify
  • log.Fatal allowed in RequireArg, CheckDependency (CLI-oriented helpers)
  • Minimal deps — zerolog, lo, cobra only; justify new additions

Out of Scope

  • Project-specific logic (put that in consuming projects)
  • Adding functions used by only one project
Usage Guidance
This skill is just a reference document for a Go CLI framework and does not itself install code or request secrets, so the direct risk is low. Before using any generated scaffolding or adding the referenced library to a project: 1) verify the upstream repository (github.com/gh-xj/agentcli-go) and its integrity/license; 2) inspect the actual library code (especially functions like RunCommand/RunOsascript) to ensure they don't execute untrusted input or run networked installs; and 3) when running scaffolding commands, review any generated scripts or Taskfile tasks before executing them on your machine.
Capability Analysis
Type: OpenClaw Skill Name: agentcli-go Version: 1.0.0 The skill bundle is classified as suspicious due to the exposure of high-risk capabilities without explicit malicious intent. Specifically, the `exec.go` module, as described in `SKILL.md`, provides `RunCommand` and `RunOsascript` functions, enabling the AI agent to execute arbitrary shell commands and AppleScript. This presents a significant remote code execution (RCE) vulnerability if the agent is prompted maliciously. Additionally, `scaffold.go` allows file system modifications, and `configx.go` can read environment variables, posing further risks for data exfiltration or unauthorized changes. While these functionalities might be plausible for a CLI framework, their direct exposure to an AI agent without clear safeguards makes the skill highly susceptible to abuse.
Capability Assessment
Purpose & Capability
The name and description match the SKILL.md content: it documents a Go CLI framework, scaffold workflows, API surface, and recommended project layout. Nothing in the file requests unrelated credentials, binaries, or external services.
Instruction Scope
SKILL.md is a documentation/reference artifact describing APIs and example commands (e.g., agentcli new). It does not instruct the agent to read arbitrary host files, send data externally, or access secrets. Note: the documented API surface includes helpers like RunCommand and RunOsascript which imply the library can execute shell/macOS scripts when used in code — this is expected for a CLI framework but worth auditing in any concrete implementation before running generated scaffolding against untrusted input.
Install Mechanism
No install spec is present (instruction-only). Nothing will be written to disk or downloaded by the skill itself.
Credentials
The skill declares no required environment variables or credentials. The doc references patterns for loading environment variables in consumer projects, which is appropriate and proportional.
Persistence & Privilege
always is false and the skill is user-invocable. It does not request persistent/system-wide privileges or modify other skills' configuration.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install agentcli-go
  3. After installation, invoke the skill by name or use /agentcli-go
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial publish — API surface, scaffold workflows, cobrax/configx patterns, golden project layout
Metadata
Slug agentcli-go
Version 1.0.0
License
All-time Installs 1
Active Installs 1
Total Versions 1
Frequently Asked Questions

What is agentcli-go?

agentcli-go framework reference for building Go CLI tools. Use when working on agentcli-go itself, scaffolding new CLI projects, adding commands, integrating... It is an AI Agent Skill for Claude Code / OpenClaw, with 580 downloads so far.

How do I install agentcli-go?

Run "/install agentcli-go" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is agentcli-go free?

Yes, agentcli-go is completely free (open-source). You can download, install and use it at no cost.

Which platforms does agentcli-go support?

agentcli-go is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created agentcli-go?

It is built and maintained by xj (@gh-xj); the current version is v1.0.0.

💬 Comments