CLI framework which supports both command and subcommand.
Project description
owcli
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.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
For developer
Requirements
- uv
- make
- bats
Commands
Integration test
$ make test-cli
๐ฆ Release
https://github.com/tadashi-aikawa/owcli/actions/workflows/release.yaml?query=workflow%3ARelease
Licence
MIT
This software is released under the MIT License, see LICENSE.txt.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
owcli-0.9.0.tar.gz
(17.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
owcli-0.9.0-py3-none-any.whl
(12.0 kB
view details)
File details
Details for the file owcli-0.9.0.tar.gz.
File metadata
- Download URL: owcli-0.9.0.tar.gz
- Upload date:
- Size: 17.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.5.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23d2e5fe6c297e85600ce4b074631a7979475cb93eb32a5b324b5617d6d44029
|
|
| MD5 |
a476d6161561033421700ceb713b64e0
|
|
| BLAKE2b-256 |
f97830cd3ff8c68aff24de2794ea0ed5e37635684f25056c278161da2339e541
|
File details
Details for the file owcli-0.9.0-py3-none-any.whl.
File metadata
- Download URL: owcli-0.9.0-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.5.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
019159742c37f1a657d287aadfff9a39fb5af7fafc934daec7b8023b7165cad6
|
|
| MD5 |
d4ea5ced2f3c0384dca9e95bd5325d2c
|
|
| BLAKE2b-256 |
6997f65a5160236fac8a96b39a65d81522fa63fc72b8c552b080db895f20246e
|