CLI framework which supports both command and subcommand based on docopt.
$ pip install owcli
Create owcli project.
$ owcli init <app_name> --python <python_version>
Run
$ cd <app_name>
$ pipenv install
$ pipenv run python <app_name>/main.py --help
$ owcli init testapp --python 3.13
------------------------
| Create entries... |
------------------------
π /mnt/c/Users/syoum/git/github.com/tadashi-aikawa/owcli/testapp
βπ Pipfile
βπ README.md
βπ setup.py
βπ testapp
βπ commands
βπ cmd1
βπ main.py
βπ __init__.py
βπ cmd2
βπ main.py
βπ subcmd1
βπ main.py
βπ __init__.py
βπ subcmd2
βπ main.py
βπ __init__.py
βπ __init__.py
βπ __init__.py
βπ main.py
βπ __init__.py
------------------------
| Next you have to ... |
------------------------
.
.
$ cd testapp
$ pipenv install
$ pipenv shell
$ python testapp/main.py --help
Usage:
testapp <command> [<subcommand>] [<args>...]
testapp <command> [<subcommand>] (-h | --help)
testapp (-h | --help)
testapp --version
Commands:
cmd1 Command1
cmd2 Command2
$ python testapp/main.py cmd2 -h
Usage:
testapp cmd2 [<subcommand>] [<args>...]
testapp cmd2 (-h | --help)
Subcommands:
subcmd1 Subcommand1
subcmd2 Subcommand2
$ python testapp/main.py cmd2 subcmd1 --help
Subcommand1
Usage:
testapp cmd2 subcmd1 <names>... [-f|--flag]
testapp cmd2 subcmd1 (-h | --help)
Options:
<names>... Names
-f --flag Flag
-h --help Show this screen.
$ python testapp/main.py cmd2 subcmd1 hoge hoga hogu -f
flag: true
names:
- hoge
- hoga
- hogu
- uv
- make
- bats
$ make test-cli
https://github.com/tadashi-aikawa/owcli/actions/workflows/release.yaml?query=workflow%3ARelease
This software is released under the MIT License, see LICENSE.txt.