Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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.
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
21 changes: 17 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 Down
2 changes: 1 addition & 1 deletion 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 Down
Loading
Loading