Metadata-Version: 2.1
Name: reploncli
Version: 0.9.2
Summary: REPL extension to CLI apps
Home-page: https://github.com/silkyanteater/reploncli
License: MIT
Keywords: repl,cli,command line
Author: silkyanteater
Author-email: cyclopesrufus@gmail.com
Requires-Python: >=3.6,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Project-URL: Repository, https://github.com/silkyanteater/reploncli
Description-Content-Type: text/markdown

# REPL on CLI

REPL extension to CLI apps

### Example

```python
import sys
from reploncli import reploncli

import my_cli_function, show_help

# turn on REPL mode if the first command line argument is 'repl'
lets_start_in_repl_mode = (sys.argv[1:] or [''])[0] == "repl"

reploncli(my_cli_function, lets_start_in_repl_mode, show_help, ">>> ")
```

### reploncli()

Signature:
```python
def reploncli(cli_function, repl_mode=None, help=None, prompt=""):
    ...
```

If `repl_mode is True` then REPL mode starts.

### Wrap your CLI entry point

Create `cli_function` by wrapping your CLI entry point that accepts one optional argument with `args` to use as a replacement for `sys.argv` if given.  
Otherwise process `sys.argv` as normal.

### Shell commands

If an input in REPL mode starts with `.` then it's run by `os.system()` after removing that dot.

