Skip to content
Merged
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
9 changes: 2 additions & 7 deletions draft.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This document is licensed under the MIT license

| Date | Author | Description |
|------|--------|-------------|
| 2026-04-19 | Bob Lail | Made the root command an instance of [Command Object](#command-object) |
| 2026-03-24 | Bob Lail | Add default value for `arity` to [Argument Object](#argument-object) |
| 2025-07-15 | Patrik Svensson | Added `interactive` to root command and commands |
| 2025-07-16 | Patrik Svensson | Added [Metadata Object](#metadata-object) |
Expand Down Expand Up @@ -102,15 +103,9 @@ This is the root object of the OpenCLI Description.
| Field Name | Type | Default Value | Description |
|------------|:----:|---------------|-------------|
| opencli | `string` | - | **REQUIRED** The OpenCLI version number |
| command | [Command Object](#command-object) | - | **REQUIRED** The root command |
| info | [CliInfo Object](#cliinfo-object) | - | **REQUIRED** Information about the CLI |
| conventions | [Conventions Object](#conventions-object) | - | The conventions used by the CLI |
| arguments | [[Argument Object](#argument-object)] | - | Root command arguments |
| options | [[Option Object](#option-object)] | - | Root command options |
| commands | [[Command Object](#command-object)] | - | Root command sub commands |
| exitCodes | [[ExitCode Object](#exitcode-object)] | - | Root command exit codes |
| examples | [`string`] | - | Examples of how to use the CLI |
| interactive | `bool` | `false` | Indicates whether or not the command requires interactive input |
| metadata | [[Metadata Object](#metadata-object)] | - | Custom metadata |

#### CliInfo Object

Expand Down
99 changes: 51 additions & 48 deletions examples/dotnet.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,56 @@
{
"$schema": "../schema.json",
"opencli": "0.1",
"command": {
"name": "dotnet",
"options": [
{
"name": "--help",
"aliases": [ "-h" ],
"description": "Display help."
},
{
"name": "--info",
"description": "Display .NET information."
},
{
"name": "--list-sdks",
"description": "Display the installed SDKs."
},
{
"name": "--list-runtimes",
"description": "Display the installed runtimes."
}
],
"commands": [
{
"name": "build",
"arguments": [
{
"name": "PROJECT | SOLUTION",
"description": "The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.",
}
],
"options": [
{
"name": "--configuration",
"aliases": [ "-c" ],
"description": "The configuration to use for building the project. The default for most projects is 'Debug'.",
"arguments": [
{
"name": "CONFIGURATION",
"required": true,
"arity": {
"minimum": 1,
"maximum": 1
}
}
]
}
]
}
]
},
"info": {
"title": "dotnet",
"version": "9.0.1",
Expand All @@ -10,52 +60,5 @@
"identifier": "MIT",
"url": "https://opensource.org/license/mit"
}
},
"options": [
{
"name": "--help",
"aliases": [ "-h" ],
"description": "Display help."
},
{
"name": "--info",
"description": "Display .NET information."
},
{
"name": "--list-sdks",
"description": "Display the installed SDKs."
},
{
"name": "--list-runtimes",
"description": "Display the installed runtimes."
}
],
"commands": [
{
"name": "build",
"arguments": [
{
"name": "PROJECT | SOLUTION",
"description": "The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.",
}
],
"options": [
{
"name": "--configuration",
"aliases": [ "-c" ],
"description": "The configuration to use for building the project. The default for most projects is 'Debug'.",
"arguments": [
{
"name": "CONFIGURATION",
"required": true,
"arity": {
"minimum": 1,
"maximum": 1
}
}
]
}
]
}
]
}
}
Loading
Loading