Metadata-Version: 2.4
Name: cmdop-server
Version: 0.0.5
Summary: CMDOP umbrella package — reusable server-side features (codegen, …) extracted from the relay.
Project-URL: Homepage, https://cmdop.com/server
Project-URL: Documentation, https://docs.cmdop.com
Project-URL: Repository, https://github.com/commandoperator/cmdop-server
Project-URL: Bug Tracker, https://github.com/commandoperator/cmdop-server/issues
License: Apache-2.0
Keywords: client-generator,cmdop,codegen,grpc,openapi,proto
Requires-Python: >=3.12
Requires-Dist: grpcio-tools>=1.80
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic>=2.8
Requires-Dist: typer>=0.12
Description-Content-Type: text/markdown

# cmdop-server

![CMDOP server — your own self-hostable relay](https://raw.githubusercontent.com/commandoperator/cmdop-server/main/assets/hero-cmdop-server.webp)

The **umbrella package** for reusable CMDOP server-side features — heavy,
self-contained pieces lifted out of the [relay repo](https://github.com/commandoperator/cmdop-server)
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.

```bash
pip install cmdop-server
```

📚 **[docs.cmdop.com](https://docs.cmdop.com)** ·
[Server](https://cmdop.com/server) · [Connect](https://cmdop.com/connect) ·
[Bots](https://cmdop.com/bots) · [SDK](https://cmdop.com/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).

```python
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`:

```bash
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.

## 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](https://github.com/commandoperator/cmdop-server)**.

Apache-2.0.
