Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tadashi-aikawa/owcli
CLI framework which supports both command and subcommand.
https://github.com/tadashi-aikawa/owcli
Last synced: 25 days ago
JSON representation
CLI framework which supports both command and subcommand.
- Host: GitHub
- URL: https://github.com/tadashi-aikawa/owcli
- Owner: tadashi-aikawa
- License: mit
- Created: 2019-04-18T15:01:55.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-07-30T13:07:29.000Z (over 1 year ago)
- Last Synced: 2024-09-14T15:23:17.646Z (about 2 months ago)
- Language: Python
- Size: 116 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
owcli
=====[![pypi](https://img.shields.io/pypi/v/owcli.svg)](https://pypi.org/project/owcli/)
[![versions](https://img.shields.io/pypi/pyversions/owcli.svg)](https://pypi.org/project/owcli/)
[![Actions Status](https://github.com/tadashi-aikawa/owcli/workflows/Tests/badge.svg)](https://github.com/tadashi-aikawa/owcli/actions)
[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/tadashi-aikawa/owcli/blob/master/LICENSE)CLI framework which supports both command and subcommand based on [docopt].
[docopt]: http://docopt.org/
Install
-------```
$ pip install owcli
```Quick start
-----------Create owcli project.
```
$ owcli init --python
```Run
```
$ cd
$ pipenv install
$ pipenv run python /main.py --help
```### Concrete example
```bash
$ owcli init testapp --python 3.7
------------------------
| 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 [] [...]
testapp [] (-h | --help)
testapp (-h | --help)
testapp --versionCommands:
cmd1 Command1
cmd2 Command2$ python testapp/main.py cmd2 -h
Usage:
testapp cmd2 [] [...]
testapp cmd2 (-h | --help)Subcommands:
subcmd1 Subcommand1
subcmd2 Subcommand2$ python testapp/main.py cmd2 subcmd1 --help
Subcommand1Usage:
testapp cmd2 subcmd1 ... [-f|--flag]
testapp cmd2 subcmd1 (-h | --help)Options:
... 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
```For developer
-------------### Requirements
* poetry
* make
* bats### Commands
#### Integration test
```
$ make test-cli
```### Version up
```bash
make release version=x.y.z
```Licence
-------### MIT
This software is released under the MIT License, see LICENSE.txt.