---
name: "cobra-cli-add"
section: "1"
platform: "linux"
package: "cobra-cli"
version: "1.3.0-3+b17"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/cobra-cli-add"
---

# cobra-cli-add(1)

Add a command to a Cobra Application

## NAME

cobra-cli-add - Add a command to a Cobra Application

## SYNOPSIS

**cobra add** \[*COMMAND NAME*\] \[*OPTIONS*\]

## DESCRIPTION

Add (cobra-cli add) will create a new command, with a license and the appropriate structure for a Cobra-based CLI application, and register it to its parent (default RootCmd).

If you want your command to be public, pass in the command name with an initial uppercase letter.

Example: cobra-cli add server -\> resulting in a new cmd/server.go

## ALIASES

**add**, **command**

## OPTIONS

- **-h**, **--help**

  help for add

- **-p**, **--parent** *string*

  variable name of parent command for this command (default “rootCmd”)

## OPTIONS INHERITED FROM PARENT COMMAND

- **-a**, **--author** *string*

  author name for copyright attribution (default “YOUR NAME”)

- **--config** *string*

  config file (default is $HOME/.cobra.yaml)

- **-l**, **--license** *string*

  name of license for the project

- **--viper**

  Use Viper for configuration

## SEE ALSO

**[cobra-cli(1)](/cobra-cli/1.md)**, **[cobra-cli-init(1)](/cobra-cli-init/1.md)**
