# 使用 Homebrew, apt, Nix 安装 cobra-cli

查看 cobra-cli 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:cobra-cli
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install cobra-cli
```

  证据: local Homebrew formula metadata

### Linux

- Debian apt (92%):

```sh
sudo apt install cobra-cli
```

  证据: Debian stable package indexes: cobra-cli from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- Nix (92%):

```sh
nix profile install nixpkgs#cobra-cli
```

  证据: nixpkgs package indexes: pkgs/by-name/co/cobra-cli/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:cobra-cli
- **软件包管理器:** Homebrew
- **版本:** 1.3.0
- **来源摘要:** Tool to generate cobra applications and commands
- **主页:** <https://cobra.dev>
- **仓库:** <https://github.com/spf13/cobra-cli>
- **最后更新:** 2026-07-25T14:20:51-04:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- cobra-cli (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 1.3.0
## 项目历史与用法

cobra-cli is the generator companion for Cobra, the Go library used to build command-line applications. It matters less as a standalone framework and more as a small scaffolding tool in the Go CLI ecosystem.

### 项目历史

The standalone `spf13/cobra-cli` repository was created in 2022 and released v1.3.0 in March 2022. Its README describes it as Cobra's generator for creating an application skeleton and adding commands.

The tool reflects a split between the Cobra runtime library and a generator binary. The README points users to `go install github.com/spf13/cobra-cli@latest`, then exposes only two core operations: `cobra-cli init` and `cobra-cli add`.

### 采用历史

cobra-cli inherits its importance from Cobra's wide use in Go command-line projects. The input shows packaging in Homebrew, Debian, Ubuntu, and Nix, while Go module distribution is the upstream installation path.

### 使用方式

`cobra-cli init` creates a barebones Cobra application inside a Go module. `cobra-cli add` adds subcommands under the generated `cmd` structure.

The optional `~/.cobra.yaml` file stores repeated generator defaults such as author, license, year, and whether to wire in Viper support.

### 为什么软件包爱好者会关心

cobra-cli is a neat example of Go's module-aware binary install story: the package manager formula is convenient, but upstream expects `go install` to fetch and build the command.

It also shows the packaging split common in developer tools: a library (`spf13/cobra`) carries most of the ecosystem weight, while a smaller generator binary gets packaged separately for repeatable local scaffolding.

### 时间线

- 2022: `spf13/cobra-cli` repository created.
- 2022: v1.3.0 release published.
- 2022: Go module proxy lists v1.3.0 for `github.com/spf13/cobra-cli`.
- 2020s: Packaged by Homebrew, Debian, Ubuntu, and Nix according to the input package-manager facts.

### Related projects

- Cobra is the underlying Go CLI framework that generated applications use.
- Viper is the related configuration library that cobra-cli can wire into new projects with `--viper`.

### 来源

- <https://github.com/spf13/cobra-cli>
- <https://raw.githubusercontent.com/spf13/cobra-cli/main/README.md>
- <https://cobra.dev/docs>
- <https://proxy.golang.org/github.com/spf13/cobra-cli/@v/list>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: ~/.cobra.yaml
## 其他软件包管理器记录

- Debian apt - cobra-cli - 1.3.0-3+b17: normalized package name match | Debian stable package indexes: cobra-cli from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Cobra CLI tool to generate Go applications and commands | https://github.com/spf13/cobra-cli
- Nix - cobra-cli: normalized package name match | nixpkgs package indexes: pkgs/by-name/co/cobra-cli/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - cobra-cli - 1.3.0-3build1: normalized package name match | Ubuntu 24.04 LTS package indexes: cobra-cli from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Cobra CLI tool to generate Go applications and commands | https://github.com/spf13/cobra-cli


## Combined YAML source

View the package source record on GitHub. [combined/cobra-cli.yml](https://github.com/mxcl/pkgdb/blob/main/combined/cobra-cli.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
