Documentation

Examples

Minimal Tool

A simple tool with one command, one argument, one flag, and one option.

{
  "$schema": "https://commandly.divyeshio.in/specification/tool.json",
  "binaryName": "curl",
  "displayName": "Curl",
  "info": {
    "description": "curl is a command line tool for transferring data with URLs."
  },
  "parameters": [],
  "commands": [
    {
      "key": "curl",
      "displayName": "curl",
      "description": "Run curl to download files.",
      "sortOrder": 1,
      "parameters": [
        {
          "key": "target",
          "displayName": "Target",
          "description": "URL to download.",
          "parameterType": "Argument",
          "dataType": "String",
          "isRequired": true,
          "position": 0,
          "sortOrder": 1
        },
        {
          "key": "--output",
          "displayName": "Output",
          "description": "Write to file instead of stdout.",
          "parameterType": "Option",
          "dataType": "String",
          "aliases": ["-o"],
          "keyValueSeparator": " ",
          "sortOrder": 2
        },
        {
          "key": "--location",
          "displayName": "Location",
          "description": "Follow redirects.",
          "parameterType": "Flag",
          "dataType": "Boolean",
          "aliases": ["-L"],
          "sortOrder": 3
        }
      ]
    }
  ]
}

Tool with Subcommands

A tool with a subcommand. Subcommands are nested inside the command they belong to, and each command owns its parameters; recursive makes a parameter inherited by the commands beneath it.

{
  "$schema": "https://commandly.divyeshio.in/specification/tool.json",
  "binaryName": "mytool",
  "displayName": "My Tool",
  "parameters": [],
  "commands": [
    {
      "key": "mytool",
      "displayName": "mytool",
      "sortOrder": 1,
      "parameters": [
        {
          "key": "--verbose",
          "displayName": "Verbose",
          "description": "Enable verbose output.",
          "parameterType": "Flag",
          "dataType": "Boolean",
          "aliases": ["-v"],
          "recursive": true,
          "sortOrder": 1
        }
      ],
      "commands": [
        {
          "key": "mytool-scan",
          "displayName": "scan",
          "description": "Run a scan.",
          "sortOrder": 2,
          "parameters": [
            {
              "key": "--target",
              "displayName": "Target",
              "description": "Host to scan.",
              "parameterType": "Option",
              "dataType": "String",
              "isRequired": true,
              "aliases": ["-t"],
              "sortOrder": 1
            }
          ]
        }
      ]
    }
  ]
}

Enum Parameter

A parameter that accepts one of a fixed set of values.

{
  "key": "--format",
  "displayName": "Output Format",
  "description": "Format for the output.",
  "parameterType": "Option",
  "dataType": "Enum",
  "sortOrder": 1,
  "enum": {
    "values": [
      { "value": "json", "displayName": "JSON", "isDefault": true, "sortOrder": 1 },
      { "value": "csv", "displayName": "CSV", "sortOrder": 2 },
      { "value": "table", "displayName": "Table", "sortOrder": 3 }
    ]
  }
}

Exclusion Group

Two parameters that cannot be used together:

{
  "key": "mytool",
  "displayName": "mytool",
  "exclusionGroups": [
    {
      "key": "output-mode",
      "displayName": "Output Mode",
      "exclusionType": "mutual_exclusive",
      "parameterKeys": ["--silent", "--verbose"]
    }
  ]
}

Tool with Validation and Dependencies

Two parameters where --password carries a minimum-length validation and a dependency on --username:

[
  {
    "key": "--username",
    "displayName": "Username",
    "parameterType": "Option",
    "dataType": "String",
    "sortOrder": 1
  },
  {
    "key": "--password",
    "displayName": "Password",
    "parameterType": "Option",
    "dataType": "String",
    "sortOrder": 2,
    "validations": [
      {
        "key": "pwd-min",
        "validationType": "min_length",
        "validationValue": "8",
        "errorMessage": "Password must be at least 8 characters."
      }
    ],
    "dependencies": [
      {
        "key": "pwd-requires-user",
        "parameterKey": "--password",
        "dependsOnParameterKey": "--username",
        "dependencyType": "requires"
      }
    ]
  }
]

Tool with Single-Dash Flags

Some CLIs (Go/kingpin tools such as httpx, dnsx, nuclei) spell their full-name flags with a single dash. The key carries its own dashes, so nothing extra is needed.

{
  "$schema": "https://commandly.divyeshio.in/specification/tool.json",
  "binaryName": "httpx",
  "displayName": "HTTPx",
  "commands": [],
  "parameters": [
    {
      "key": "-list",
      "displayName": "List",
      "description": "File containing the URLs to probe.",
      "parameterType": "Option",
      "dataType": "String",
      "aliases": ["-l"],
      "sortOrder": 1
    },
    {
      "key": "-silent",
      "displayName": "Silent",
      "description": "Silent mode.",
      "parameterType": "Flag",
      "dataType": "Boolean",
      "sortOrder": 2
    }
  ]
}

-silent is the full flag, and -l is listed as a short name.

Tool with Installation Sources

A tool that documents how to install it, using several install methods.

{
  "$schema": "https://commandly.divyeshio.in/specification/tool.json",
  "binaryName": "httpx",
  "displayName": "HTTPx",
  "info": {
    "description": "Fast and multi-purpose HTTP toolkit.",
    "url": "https://github.com/projectdiscovery/httpx"
  },
  "installation": {
    "sources": [
      {
        "key": "go-install",
        "method": "package_manager",
        "manager": "go",
        "command": "go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest",
        "url": "https://docs.projectdiscovery.io/opensource/httpx/install"
      },
      {
        "key": "brew",
        "method": "package_manager",
        "manager": "brew",
        "command": "brew install httpx",
        "url": "https://docs.projectdiscovery.io/opensource/httpx/install",
        "os": ["linux", "macos"]
      },
      {
        "key": "docker",
        "method": "docker",
        "command": "docker pull projectdiscovery/httpx:latest",
        "url": "https://docs.projectdiscovery.io/opensource/httpx/install"
      },
      {
        "key": "release-binary",
        "method": "binary",
        "command": "https://github.com/projectdiscovery/httpx/releases",
        "note": "Download the latest binary for your OS and unzip it."
      }
    ]
  },
  "commands": [{ "key": "httpx", "displayName": "httpx", "sortOrder": 1 }],
  "parameters": []
}