cmdop-server
The umbrella package for reusable CMDOP server-side features — heavy, self-contained pieces lifted out of the relay repo so the repo stays light. This is not the whole relay (run that from the repo); it's an installable home for features other projects can reuse.
pip install cmdop-server
📚 docs.cmdop.com · Server · Connect · Bots · SDK
Features
cmdop_server.codegen — multi-language client generator
A monorepo-agnostic code-generation engine: declarative targets (proto / OpenAPI /
WebSocket) → typed clients in Go, TypeScript, Python, Swift. You supply a
Config describing your sources + outputs; the engine drives the toolchains
(grpc_tools, ogen, @hey-api, openapi-python-client, swift-openapi, a
built-in WS emitter).
from cmdop_server.codegen.schema import Config, ProtoSpec, ProtoTarget, Lang, Tool
from cmdop_server.codegen.core.runner import run
cfg = Config(proto=ProtoSpec(targets=[ProtoTarget(
name="proto-python", lang=Lang.PY, tool=Tool.GRPC_PYTHON,
path=my_out_dir, proto_dirs=[my_proto_dir],
)]))
run(cfg, kinds=("proto",))
Or the CLI, pointing at a module that exposes config: Config:
python -m cmdop_server.codegen --config myproject.codegen_config gen all
External toolchains (ogen, buf, swift-openapi, @hey-api) are subprocess prerequisites — install the ones your targets use.
cmdop_server.llm — universal LLM transport
One module for every model call — chat, structured extraction (Pydantic
response_format with parse-and-repair), vision, image generation/edit,
embeddings, translation. It owns HTTP, auth, cost-per-response, retries, a
live OpenRouter model registry (pricing + capabilities), and a cascade
LLMRouter with role presets. Provider-agnostic (OpenAI / OpenRouter).
from cmdop_server.llm import LLMClient
client = LLMClient(api_key="sk-...") # or omit → reads OPENROUTER_API_KEY / OPENAI_API_KEY
resp = client.chat("Summarize this.", model="alias:balanced")
print(resp.content, resp.cost_usd)
Config is hybrid (the openai/stripe-SDK pattern): pass keys explicitly, or let
them fall back to env (OPENROUTER_API_KEY, OPENAI_API_KEY, or the
CMDOP_DEV_LLM_KEYS__* form). No global Django config — explicit always wins.
cmdop_server.telegram — Telegram notification service
A small, framework-neutral Telegram sender (queue + formatters + parse-mode
handling) used for alerts/notifications. Reads CMDOP_TELEGRAM_BOT_TOKEN /
CMDOP_TELEGRAM_CHAT_ID from env, or take them per-call.
All three features are framework-neutral — no Django.
cmdop_server.llmandcmdop_server.telegramwere ported fromdjango_cfg; the single host seam iscmdop_server._compat(env-driven config + a tiny TTL cache).
Run the relay itself
This package is server-side features, not the server. To run a CMDOP relay, clone and run the repo: github.com/commandoperator/cmdop-server.
Apache-2.0.
Metadata
Release files for cmdop-server 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cmdop_server-0.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Release files / cmdop_server-0.0.6-py3-none-any.whl
| Download URL | cmdop_server-0.0.6-py3-none-any.whl |
|---|---|
| Size | 350.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
92ea8b45292559c8f4d0e3deef52660346b0aee88170684f1bf625db7a7db1a2
|
|
BLAKE2b-256 checksum How to use checksums |
d50c714c22581f226fe1502bfe4f016629baaf8501301fcb286f3d87126bd638
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.3
|