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.
-
Named environments (
url, optionaltenant,protected) stored in a per-CLI user config file, merged over an optional defaults file shipped with the project. -
Environment selection by flag,
<CLI>_ENVor the saved current environment. -
Request safety rules: only
/api/paths, no credentials in URLs, plainhttp://refused except for loopback hosts. -
build_cli(name, schema_path, defaults_path): aclickgroup withenv,login,logout,whoami,doctor,schema,api,rawand one group per OpenAPI tag, generated from operations markedx-sm-token.
See docs/framework/remote-cli.md and docs/guide/project-cli.md.
uv add simple_module_remoteThe 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.
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()