{"id":"85ff0767-cd9d-43d6-8d90-a177f2818a6e","slug":"oss-skills-cli-development","name":"cli-development","description":"Design and build production-grade CLI tools that wrap REST APIs. Covers architecture (Kong struct-tag commands, layered internal packages), auth flows (OAuth2, keyring, multi-account), output formatting (JSON/plain/rich with stdout/stderr separation), agent-friendly design (stable exit codes, schema introspection, command allowlisting), and extensibility patterns. Use when building any Go CLI that wraps external APIs, designing CLI command hierarchies, implementing OAuth2 flows for CLI tools, or when the user mentions \"cli-development\", \"CLI architecture\", or \"API wrapper CLI\". Inspired by gogcli by Peter Steinberger (https://github.com/steipete/gogcli).","canonicalUrl":"https://xpersona.co/skill/oss-skills-cli-development","sourceUrl":"https://github.com/oss-skills/cli-development","homepage":null,"source":"GITHUB_OPENCLEW","vendor":{"slug":"oss-skills","label":"Oss Skills","url":"https://github.com/oss-skills/cli-development"},"protocols":["OPENCLEW"],"capabilities":["read","multiple","comments"],"trustScore":null,"trustConfidence":"unknown","artifactCount":0,"benchmarkCount":0,"lastRelease":null,"freshnessAt":"2026-03-01T06:05:20.079Z","freshnessLabel":"Mar 1, 2026","securityReviewed":true,"openapiReady":true,"stats":[{"label":"Trust score","value":"Unknown"},{"label":"Compatibility","value":"OpenClaw"},{"label":"Freshness","value":"Mar 1, 2026"},{"label":"Vendor","value":"Oss Skills"},{"label":"Artifacts","value":"0"},{"label":"Benchmarks","value":"0"},{"label":"Last release","value":"Unpublished"}],"factsPreview":[{"factKey":"docs_crawl","category":"integration","label":"Crawlable docs","value":"6 indexed pages on the official domain","href":"https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenclaw%2Fskills%2Ftree%2Fmain%2Fskills%2Fasleep123%2Fcaldav-calendar","sourceUrl":"https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenclaw%2Fskills%2Ftree%2Fmain%2Fskills%2Fasleep123%2Fcaldav-calendar","sourceType":"search_document","confidence":"medium","observedAt":"2026-04-15T05:03:46.393Z","isPublic":true},{"factKey":"vendor","category":"vendor","label":"Vendor","value":"Oss Skills","href":"https://github.com/oss-skills/cli-development","sourceUrl":"https://github.com/oss-skills/cli-development","sourceType":"profile","confidence":"medium","observedAt":"2026-03-01T06:05:20.079Z","isPublic":true},{"factKey":"protocols","category":"compatibility","label":"Protocol compatibility","value":"OpenClaw","href":"https://xpersona.co/api/v1/agents/oss-skills-cli-development/contract","sourceUrl":"https://xpersona.co/api/v1/agents/oss-skills-cli-development/contract","sourceType":"contract","confidence":"medium","observedAt":"2026-02-24T19:45:27.912Z","isPublic":true},{"factKey":"auth_modes","category":"compatibility","label":"Auth modes","value":"api_key, oauth","href":"https://xpersona.co/api/v1/agents/oss-skills-cli-development/contract","sourceUrl":"https://xpersona.co/api/v1/agents/oss-skills-cli-development/contract","sourceType":"contract","confidence":"high","observedAt":"2026-02-24T19:45:27.912Z","isPublic":true},{"factKey":"schema_refs","category":"artifact","label":"Machine-readable schemas","value":"OpenAPI or schema references published","href":"https://github.com/oss-skills/cli-development#input","sourceUrl":"https://xpersona.co/api/v1/agents/oss-skills-cli-development/contract","sourceType":"contract","confidence":"high","observedAt":"2026-02-24T19:45:27.912Z","isPublic":true},{"factKey":"handshake_status","category":"security","label":"Handshake status","value":"UNKNOWN","href":"https://xpersona.co/api/v1/agents/oss-skills-cli-development/trust","sourceUrl":"https://xpersona.co/api/v1/agents/oss-skills-cli-development/trust","sourceType":"trust","confidence":"medium","observedAt":null,"isPublic":true}],"highlights":["Schema refs published","Trust evidence available"],"agentCard":{"name":"cli-development","description":"Design and build production-grade CLI tools that wrap REST APIs. Covers architecture (Kong struct-tag commands, layered internal packages), auth flows (OAuth2, keyring, multi-account), output formatting (JSON/plain/rich with stdout/stderr separation), agent-friendly design (stable exit codes, schema introspection, command allowlisting), and extensibility patterns. Use when building any Go CLI that wraps external APIs, designing CLI command hierarchies, implementing OAuth2 flows for CLI tools, or when the user mentions \"cli-development\", \"CLI architecture\", or \"API wrapper CLI\". Inspired by gogcli by Peter Steinberger (https://github.com/steipete/gogcli).","source":"GITHUB_OPENCLEW","sourceId":"github:1158404199","repository":"https://github.com/oss-skills/cli-development","documentation":"https://xpersona.co/skill/oss-skills-cli-development/agent/oss-skills-cli-development","protocols":["OPENCLEW"],"capabilities":["read","multiple","comments"],"languages":["typescript"],"install":{"command":"git clone https://github.com/oss-skills/cli-development.git","ecosystem":"git"},"examples":[{"kind":"example","language":"text","snippet":"cmd/<binary>/main.go       # Minimal: cmd.Execute(os.Args[1:])\ninternal/\n  cmd/                     # Kong command structs + Run() methods\n    root.go                # CLI struct, RootFlags, Execute(), parser setup\n    exit_codes.go          # Stable exit code constants\n    <service>.go           # One file per service (admin.go, mail.go)\n  <api>/                   # API client wrappers per service\n  auth/                    # OAuth2 flow, token management, scope registry\n  config/                  # XDG config, JSON5, account/client mappings\n  secrets/                 # Keyring abstraction (OS keychain + file fallback)\n  outfmt/                  # Output formatting (JSON/plain/rich modes)\n  ui/                      # Terminal colors, printers (via context)\n  errfmt/                  # Error formatting, typed errors"},{"kind":"example","language":"go","snippet":"type RateLimitError struct { RetryAfter time.Duration; Attempt int }\ntype AuthRequiredError struct { Service, Account string; Cause error }\ntype NotFoundError struct { ResourceID string }\n\nfunc IsRateLimitError(err error) bool { ... }  // uses errors.As"}]}}