此项目已归档。 Learn 更多
# Go CLI 库()](https://pkg.go.dev/github.com/mitchellh/cli)
cli 是一个用于在 Go 中实现命令行接口的库。
cli 是为 CLI 提供支持的库
[包装机](https://github.com/mitchellh/packer),
[领事](https://github.com/hashicorp/consul),
[保险库](https://github.com/hashicorp/vault),
[Terraform](https://github.com/hashicorp/terraform),
[Nomad](https://github.com/hashicorp/nomad) 等。
## 特性
* 基于子命令的易于使用的 CLI: `cli foo`, `cli bar` 等
* 支持嵌套子命令,例如 `cli foo bar`。
* 可选支持默认子命令,以便 `cli` 可以执行某些操作
除了错误之外。
- 支持在 Go 中使用回调函数来自动完成子命令、标志和参数的 shell 自动补全。您无需编写任何 shell 代码。