Skip to content
CLI framework which supports both command and subcommand.
Python Shell Makefile
Branch: master
Clone or download
Latest commit 1945274 Nov 14, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows 🔨 Fix GA failure Nov 14, 2019
owcli 📦 Version 7.0.0 Sep 8, 2019
tests 🔨 Update GA Sep 11, 2019
.editorconfig Add tests all Apr 21, 2019
.gitignore A sense of unity May 9, 2019
LICENSE Initial commit Apr 18, 2019
Makefile 🔨 Use poetry instead of pipenv Nov 13, 2019
Pipfile 🔨 Use poetry instead of pipenv Nov 13, 2019
README.md Update README.md Nov 14, 2019
poetry.lock 🔨 Use poetry instead of pipenv Nov 13, 2019
pyproject.toml 📦 Version 0.7.0 Nov 14, 2019

README.md

owcli

pypi versions Actions Status license

CLI framework which supports both command and subcommand based on docopt.

Install

$ pip install owcli

Quick start

Create owcli project.

$ owcli init <app_name> --python <python_version>

Run

$ cd <app_name>
$ pipenv install
$ pipenv run python <app_name>/main.py --help

Concrete example

$ 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 <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

For developer

Requirements

  • poetry
  • make
  • bats

Flow

  1. Create version branch like as 6.0.0
  2. Create Issue and development! (Feature branch is optional)
  3. Commit with prefix emoji like "📝", and suffix issue number like "#120"

Commands

Integration test

$ make test-cli

Version up

Confirm that your branch name equals release version

$ make release

Finally, create pull request and merge to master!!

Licence

MIT

This software is released under the MIT License, see LICENSE.txt.

You can’t perform that action at this time.