You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-87Lines changed: 7 additions & 87 deletions
Original file line number
Diff line number
Diff line change
@@ -25,106 +25,26 @@ Experimental, in dev flux and looking for design/usage feedback!
25
25
go get github.com/lispyclouds/climate
26
26
```
27
27
28
-
### How it works and usage
28
+
### Rationale
29
29
30
30
climate allows the server to influence the CLI behaviour by using OpenAPI's [extensions](https://swagger.io/docs/specification/v3_0/openapi-extensions/). It encourages [spec-first](https://www.atlassian.com/blog/technology/spec-first-api-development) practices thereby keeping both users and maintenance manageable. It does just enough to handle the spec and nothing more.
31
31
32
32
Overall, the way it works:
33
33
- Each operation is converted to a Cobra command
34
34
- Each parameter is converted to a flag with its corresponding type
35
-
- Request bodies are a flag as of now, subject to change
35
+
- Request bodies are a flag as of now, subject to change. Name defaults to `climate-data` unless specified via `x-cli-name`
36
36
- The provided handlers are attached to each command, grouped and attached to the rootCmd
37
37
38
38
Influenced by some of the ideas behind [restish](https://rest.sh/) it uses the following extensions as of now:
39
-
-`x-cli-aliases`: A list of strings which would be used as the alternate names for:
40
-
- Operations: If set, will prefer the first of the list otherwise the `operationId`. Will use the rest as cobra aliases
41
-
- Request Body: Same preference as above but would a default of `climate-data` as the name of the param if not set
39
+
-`x-cli-aliases`: A list of strings which would be used as the alternate names for an operation
42
40
-`x-cli-group`: A string to allow grouping subcommands together. All operations in the same group would become subcommands in that group name
43
41
-`x-cli-hidden`: A boolean to hide the operation from the CLI menu. Same behaviour as a cobra command hide: it's present and expects a handler
44
42
-`x-cli-ignored`: A boolean to tell climate to omit the operation completely
43
+
-`x-cli-name`: A string to specify a differnt name. Applies to operations and request bodies as of now
0 commit comments