Metadata-Version: 2.1
Name: typer-cmd
Version: 0.0.1
Summary: An extension to typer that easily turns your typer app into a shell utility
Author-Email: tanglh <tlhk2@163.com>
License: MIT
Requires-Python: >=3.9
Requires-Dist: typer>=0.9.0
Requires-Dist: pyreadline3>=3.4.1
Requires-Dist: rich>=13.6.0
Description-Content-Type: text/markdown

# typer-shell

typer-shell is an extension to typer that easily turns your typer app into a shell utility. It is built on top of the built in python cmd module, with modifications to make it work with typer.


## Usage

Simply create a Typer instance and add it into the TyperCmd instance:

```python
import typer
from typer_shell.shell import TyperCmd


app = typer.Typer()

job_app = typer.Typer()
app.add_typer(job_app, name="job")


@app.command()
def hello(name: str):
    print("hello", name)


@job_app.command()
def run(name: str):
    print(f'run job {name}')


@job_app.command()
def list():
    print('list jobs')


if __name__ == "__main__":
    cmd = TyperCmd(typer=app)
    cmd.cmdloop()

```

or u can make a new subclass from TyperCmd and add your own necessary initializing code