Metadata-Version: 2.5
Name: simple_module_remote
Version: 0.0.51
Summary: Client-only engine for a per-project CLI over a simple_module app's REST API
Project-URL: Homepage, https://github.com/antosubash/simple_module_python
Project-URL: Repository, https://github.com/antosubash/simple_module_python
Project-URL: Issues, https://github.com/antosubash/simple_module_python/issues
Project-URL: Changelog, https://github.com/antosubash/simple_module_python/blob/main/CHANGELOG.md
Author-email: Anto Subash <antosubash@live.com>
License-Expression: MIT
License-File: LICENSE
Keywords: cli,openapi,rest,simple-module
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: click<9,>=8.1
Requires-Dist: httpx<1,>=0.27
Requires-Dist: keyring<26,>=25
Requires-Dist: pyyaml<7,>=6.0
Requires-Dist: rich<16,>=13
Requires-Dist: tomli-w<2,>=1.0
Description-Content-Type: text/markdown

# simple_module_remote

Client-only engine for a per-project command line over a simple_module app's
REST API. It reads the app's OpenAPI schema, generates one command per
operation, and handles environments, credentials, HTTP and output formatting.
It never imports the server framework: it talks to a running app over HTTP only.

## What it provides

- Named environments (`url`, optional `tenant`, `protected`) stored in a
  per-CLI user config file, merged over an optional defaults file shipped with
  the project.
- Environment selection by flag, `<CLI>_ENV` or the saved current environment.
- Request safety rules: only `/api/` paths, no credentials in URLs, plain
  `http://` refused except for loopback hosts.

- `build_cli(name, schema_path, defaults_path)`: a `click` group with `env`,
  `login`, `logout`, `whoami`, `doctor`, `schema`, `api`, `raw` and one group per
  OpenAPI tag, generated from operations marked `x-sm-token`.

See `docs/framework/remote-cli.md` and `docs/guide/project-cli.md`.

## Install

```bash
uv add simple_module_remote
```

## Usage

The package is an engine, not a command. A project wraps it in its own CLI
entry point, naming the CLI so that config lives in `~/.config/<cli>/` and
environment variables use the `<CLI>_` prefix.

```python
from pathlib import Path

from simple_module_remote import build_cli

main = build_cli("my-app", Path("openapi.json"), None, version="1.0")

if __name__ == "__main__":
    main()
```
