← 全部工具

suzuki-shunsuke/cmdx

热度 65 更新于 效率与自动化

Task runner. It provides useful help messages and supports interactive prompts and validation of arguments

githubauto-collected

安装

暂未验证可直接使用的安装命令,请查看项目官方文档或 Release。

cmdx

Task runner. It provides useful help messages and supports interactive prompts.

Overview

cmdx is the task runner. Using cmdx you can manage tasks for your project such as test, build, format, lint, and release.

For example, This is the tasks for cmdx itself.

$ cmdx -l
init, i - setup git hooks
coverage, c - test a package (fzf is required)
test, t - test
fmt - format the go code
vet, v - go vet
lint, l - lint the go code
release, r - release the new version
durl - check dead links (durl is required)
ci-local - run the Drone pipeline at localhost (drone-cli is required)

$ cmdx help release

cmdx release - release the new version

USAGE: cmdx release <version

DESCRIPTION: release the new version ARGUMENTS: version


`cmdx` searches the configuration file from the current directory to the root directory recursively, and runs the task at the directory where the configuration file exists.

## Features

- Easy to install (one binary)
- Parse the flag and positional arguments
- Useful help messages
- Interactive prompt by [AlecAivazis/survey](https://github.com/AlecAivazis/survey)
- Validate requirements
- Validate flag and positional arguments
- Timeout
  • Nested tasks (Sub tasks)

Getting Started

Create the configuration file.

$ cmdx --init
$ cat .cmdx.yaml

Edit the configuration file and register the task hello.

$ vi .cmdx.yaml
$ cat .cmdx.yaml
---
tasks:
- name: hello
  description: hello command
  usage: hello command
  flags:
  - name: source
    short: s
    usage: source file path
    required: true
  • NAME
  • name: switch

type: bool args: