How should we represent argument types? #11
Replies: 7 comments 11 replies
|
@mdonnalley this could be useful to ease the usage of CLIs built with oclif by AI agents. You can help defining the standard using oclif's well rounded model. Then you can create |
|
@AllanOricil answered here: oclif/oclif#1806 (comment) |
|
Love the initiative! 🤗 It would be quite valuable to support argument types to automate parsing from the specs to a strongly typed language. I would think that having a default
In case of list arguments e.g. separated by Should cover most of the usecases and things can be expanded further in minor versions. |
|
Perhaps with JSON Schema as OpenAPI do? |
|
Here is an initial proposal. I've aimed to keep the functionality minimal while still ensuring usability. Primitive types
Additional type-specific keywords can be used to refine the data type, for example, limit the string length or specify a maximum value for an integer. An optional Schema
FormatsInteger
Float
String
|
|
Whether a file is input/output, directory/file, and file type are concerns that are useful for autocompletion system, for example. |
|
For practical reasons, I think it makes sense to use exactly the data types and formats from the JSON schema version used to express the OpenCLI format ( |
Uh oh!
There was an error while loading. Please reload this page.
All reactions