Metadata-Version: 2.1
Name: cmdcomp
Version: 2.0.1
Summary: cmdcomp is a cli tool completion generator for shell.
Home-page: https://github.com/yassun4dev/cmdcomp
License: BSD-3-Clause
Author: Yasutanium
Author-email: yassun4dev@outlook.com
Requires-Python: >=3.11,<4.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development
Classifier: Typing :: Typed
Requires-Dist: argcomplete (>=3.1.1,<4.0.0)
Requires-Dist: jinja2 (>=3.1.2,<4.0.0)
Requires-Dist: mergedeep (>=1.3.4,<2.0.0)
Requires-Dist: pydantic (>=2.0,<3.0)
Requires-Dist: pyyaml (>=6.0,<7.0)
Requires-Dist: rich (>=13.4.2,<14.0.0)
Project-URL: Repository, https://github.com/yassun4dev/cmdcomp
Description-Content-Type: text/markdown

# Command Completion Generator Tool

<p align="center">
    <a href="https://github.com/yassun4dev/cmdcomp/actions">
        <img src="https://github.com/yassun4dev/cmdcomp/actions/workflows/test-suite.yml/badge.svg" alt="Test Suite">
    </a>
    <a href="https://pypi.org/project/cmdcomp">
        <img src="https://badge.fury.io/py/cmdcomp.svg" alt="PIP Version">
    </a>
    <a href="https://hub.docker.com/r/yassun4dev/cmdcomp">
        <img src="https://img.shields.io/docker/v/yassun4dev/cmdcomp/latest?label=docker%20version" alt="Docker Version">
    </a>
</p>

`cmdcomp` generate shell completion file (`bash` or `zsh`) from config `json`/`yaml`/`toml` file.

## Install

```shell
pip install cmdcomp
```

## Usage

### Local
```shell
cmdcomp --file ${YOUR_CONFIG_FILE} --shell-type bash
```

### Docker

```shell
docker run --rm -itv $(pwd):/app/cmdcomp yassun4dev/cmdcomp --file ${YOUR_CONFIG_FILE} --shell-type bash
```

## Config

Configuration can be written in `JSON`, `YAML`, and `TOML` file formats.

### Sample

```yaml
cmdcomp:
  version: "2"
app:
  name: "mycli"
  alias: "my-cli"
root:
  arguments:
    --verbose:
      type: flag
      description: "verbose output."
    --no-verbose:
      type: flag
      description: "no verbose output."
    --version:
      type: flag
      alias: "-V"
      description: "print version."
    --config:
      type: file
      description: "config file."
    --help:
      type: flag
      description: "print help."
  subcommands:
    list:
      alias: "ls"
      description: "list project files."
      arguments:
        --all:
          type: flag
          alias: "-a"
          description: "list all files."
        "*":
          type: file
          description: "list files."
    cd:
      description: "cd project directory."
      arguments:
        -P:
          type: flag
          description: "physical directory."
        1:
          type: file
          base_path: $HOME
          description: "change project directory."
    test:
      description: "test command."
      subcommands:
        rubocop:
          description: "run rubocop."
          arguments:
            --auto-correct:
              type: flag
              alias: "-A"
              description: "auto correct."
        pytest:
          description: "run pytest."
```

### JSON Schema

https://raw.githubusercontent.com/yassun4dev/cmdcomp/main/docs/config.schema.json

