Configuration
Client() uses the active local Cmdop configuration. Set an explicit relay URL
and bearer token only for remote mode. Constructor values take precedence over
environment variables.
Defaults
| Setting | Python / Node | Environment | Default |
|---|---|---|---|
| Relay URL | base_url / baseUrl | CMDOP_BASE_URL | active local Cmdop setup |
| Bearer token | token | CMDOP_TOKEN | matching local credentials |
| Timeout | timeout_ms / timeoutMs | CMDOP_TIMEOUT_MS | 30000 ms |
| Development binary override | binary_path / binaryPath | CMDOP_CORE_BINARY | packaged host binary |
With no URL override, the core discovers the active relay and credentials from Cmdop. An explicit remote URL requires a bearer token. An explicit loopback URL can mint a local loopback token.
Leave the binary override unset in normal use — the packaged host binary is the one the client is tested against. It exists for local development against a core you built yourself.
Constructor options
from cmdop import Client
client = Client(
base_url="https://relay.example.com",
token="...",
timeout_ms=30_000,
)import { Client } from "@cmdop/sdk";
const client = new Client({
baseUrl: "https://relay.example.com",
token: "...",
timeoutMs: 30_000,
});Client.from_env() and Client.fromEnv() are aliases for constructing a
zero-argument client. The regular constructor is the shortest canonical form.
Precedence
- Explicit constructor value.
- Matching environment variable.
- Local discovery or the documented timeout default.
Always close the client after use. See Getting started for lifecycle examples.