Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
b6ac909
alt sources
bcdxn Aug 14, 2026
9caf03b
feat: urfave cli alternative sources
bcdxn Aug 15, 2026
003b7c6
reviewed urfave impl
bcdxn Aug 16, 2026
bfce2d7
feat: enable alternative sources for cobra
bcdxn Aug 16, 2026
5e6d6fb
fix: make urfavecli load config conditional
bcdxn Aug 16, 2026
f559563
fix: default bug
bcdxn Aug 17, 2026
b74a3fc
fix: examples
bcdxn Aug 17, 2026
f5ac203
fix: global flags and alt sources
bcdxn Aug 17, 2026
24e105d
fix: alt sources resolution bug in supported frameworks
bcdxn Aug 17, 2026
14e5001
fix: flags on groups gap
bcdxn Aug 17, 2026
bf0e1ee
fix: variadic errors in yargs
bcdxn Aug 17, 2026
caa50cc
fix: add yargs alt source capability + minor fixes
bcdxn Aug 18, 2026
8356c2d
fix: missing yargs shorthand name when processing alt sources
bcdxn Aug 18, 2026
a11e3b6
fix: global flags missing normalization
bcdxn Aug 18, 2026
98a6839
fix: bug wher toInt64 generated runtime config silently trucated float64
bcdxn Aug 18, 2026
679e7bc
fix: altSourceItems called twice in resolveSliceFlag logic
bcdxn Aug 19, 2026
61c7bbd
fix: silently dropping shorthand in yargs templates
bcdxn Aug 19, 2026
0c8ff38
fix: minor fixes
bcdxn Aug 19, 2026
98d2624
fix: handle global flags in a more elegant way
bcdxn Aug 19, 2026
75b172d
fix: import bug + add docs
bcdxn Aug 20, 2026
75be0df
doc: update documentation for yargs
bcdxn Aug 20, 2026
8045f76
add docs + minor fixes
bcdxn Aug 24, 2026
abfc314
Potential fix for pull request finding
bcdxn Aug 28, 2026
ac90a19
fix: address PR comments
bcdxn Aug 28, 2026
e42f34b
fix: spec error
bcdxn Aug 28, 2026
f0c2ae2
Potential fix for pull request finding
bcdxn Aug 28, 2026
ab666de
Potential fix for pull request finding
bcdxn Aug 28, 2026
cbbf4e7
fix: address pr comments
bcdxn Aug 28, 2026
12e2da1
fix: address pr comments
bcdxn Aug 28, 2026
e6bd02a
fix: required flags with alt sources
bcdxn Aug 29, 2026
0bb978b
fix: docs syntax error
bcdxn Aug 29, 2026
f81cc5c
fix: address variadic typing issues
bcdxn Aug 29, 2026
d0c888f
fix: how yargs handles choices in global flags
bcdxn Aug 29, 2026
8473063
fix: how cobra handles choices in global flags
bcdxn Aug 29, 2026
4305017
fix: urfave cli global options choice validations
bcdxn Aug 30, 2026
ac013ce
Potential fix for pull request finding
bcdxn Aug 30, 2026
57555f8
Potential fix for pull request finding
bcdxn Aug 30, 2026
6139982
Potential fix for pull request finding
bcdxn Aug 30, 2026
9ca1fd2
fix: add examples to petstore example
bcdxn Aug 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ OpenCLI Specification is a declarative, language-agnostic document specification
- `go.mod` - Go module definition
- `go.work` - Workspace configuration
- `Makefile` - Build targets (test, gen-docs, release)
- `opencli.ocs.yaml` - Self-documenting spec for this project
- `ocli.ocs.yaml` - Self-documenting spec for this project
- `spec.schema.json` - JSON Schema that defines the OpenCLI Specification. This is the central pillar of the repository. All of the other packages and documentation serves this specification.

## Key Functionality
Expand All @@ -120,6 +120,9 @@ OpenCLI Specification is a declarative, language-agnostic document specification

## Important Notes

- The project is self-documenting: `opencli.ocs.yaml` describes the CLI itself
- The project is self-documenting: `ocli.ocs.yaml` describes the CLI itself
- Generated code uses `gencli` package and directory naming convention to avoid conflicts. We can safely regenerate the code in the repo without fear of clobbering any of the logic
- Web app uses Next.js 16 App Router with static export
- You should always prioritize human-readable code that is maintainable and testable. Strive for elegance over cleverness
- Don't guess about how newer libraries work based on old training data. Look up the docs via go.pkg.dev or using the built in websearch tool call.
- For temporary, test, scratch files always use the subdirectory `./.scratch` within the workspace. And be sure to clean up after yourself when done.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ coverage.txt
.DS_Store
Thumbs.db
tmp*
.scratch
scratch*

node_modules
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ To keep the project reliable, we require all code changes to be accompanied by a

The code, examples, schema, and web editor are all implemented within this same repository so you can evaluate the ecosystem end to end without context switching. If you are only exploring, start with `README.md` and `examples/`; if you are validating behavior, use the build and test targets in this document.

- `spec/`, `opencli.ocs.yaml`, `spec.schema.json`: Core OpenCLI spec types, canonical example spec, and JSON Schema.
- `spec/`, `ocli.ocs.yaml`, `spec.schema.json`: Core OpenCLI spec types, canonical example spec, and JSON Schema.
- `cmd/`: Entry points for executables (Cobra CLI and WASM target).
- `internal/`: Internal CLI implementation details and supporting utilities.
- `codec/`: Spec encode/decode logic and fixtures.
Expand Down
22 changes: 18 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,23 @@ test: generate

version = $(shell git describe --tags HEAD)


.PHONY: gen-docs
gen-docs: generate
@go run cmd/ocli/main.go gen docs \
--format markdown \
--out ./docs \
opencli.ocs.yaml
ocli.ocs.yaml
@go run cmd/ocli/main.go gen docs \
--format html-embed \
--out ./web/public \
opencli.ocs.yaml
ocli.ocs.yaml
@go run cmd/ocli/main.go gen docs \
--format man \
--out ./docs \
opencli.ocs.yaml
mkdir -p build && mv docs/opencli.ocs.1 build/ocli.1
ocli.ocs.yaml
mkdir -p build && mv docs/ocli.ocs.1 build/ocli.1


.PHONY: gen-examples
gen-examples: generate
Expand All @@ -44,6 +46,17 @@ gen-examples: generate
--framework cobra \
--out ./examples/code/cobra/pleasantries/internal \
./examples/pleasantries-cli.ocs.yaml
@go run cmd/ocli/main.go gen cli \
--framework urfavecli \
--out ./examples/code/urfavecli/pleasantries/internal \
./examples/pleasantries-cli.ocs.yaml

.PHONY: gen-ocli
gen-ocli:
@go run cmd/ocli/main.go gen cli \
--framework cobra \
--out ./internal/cli \
./ocli.ocs.yaml

.PHONY: release
release: gen-docs gen-examples
Expand All @@ -67,6 +80,7 @@ build-wasm: copy-wasm-exec generate

.PHONY: build-ui
build-ui: build-wasm gen-docs
cp ./examples/petstore-cli.ocs.yaml ./web/public/petstore-cli.ocs.yaml
cp ./spec.schema.json ./web/src/spec.schema.json
cd web && npm ci && npm run build

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ OpenCLI specification is a document specification that can be used to describe C
Use the CLI to validate specs, generate docs and generate boilerplate code.

- [Markdown Docs](https://github.com/bcdxn/opencli/blob/main/docs/opencli.ocs.md)
- [OpenCLI Spec-compliant Document](https://github.com/bcdxn/opencli/blob/main/opencli.ocs.yaml)
- [OpenCLI Spec-compliant Document](https://github.com/bcdxn/opencli/blob/main/ocli.ocs.yaml)

## Live Editor

Expand All @@ -88,7 +88,7 @@ The CLI above can be described using an OpenCLI Specification Document in YAML (
```yaml
# cli.yaml

opencliVersion: 1.0.0-alpha.13
opencliVersion: 1.0.0-alpha.14

info:
title: Pleasantries
Expand Down Expand Up @@ -243,7 +243,7 @@ Run the CLI to generate the OpenCLI document.

```sh
pleasantries __opencli
# opencliVersion: 1.0.0-alpha.13
# opencliVersion: 1.0.0-alpha.14
# info:
# title: pleasantries
# summary: A fun CLI that greets the caller
Expand Down
2 changes: 1 addition & 1 deletion adapters/ocobra/ocobra.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"github.com/spf13/pflag"
)

const defaultOpenCLIVersion = "1.0.0-alpha.13"
const defaultOpenCLIVersion = "1.0.0-alpha.14"

// config holds the functional-option state.
type config struct {
Expand Down
2 changes: 1 addition & 1 deletion adapters/ourfave/ourfave.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"github.com/urfave/cli/v3"
)

const defaultOpenCLIVersion = "1.0.0-alpha.13"
const defaultOpenCLIVersion = "1.0.0-alpha.14"

// config holds the functional-option state.
type config struct {
Expand Down
Loading
Loading