Skip to main content

Auto-generated CLI for the wxc_sdk Webex SDK

Project description

PyPI version Python versions

wxc-cli

Auto-generated CLI for wxc_sdk — every API endpoint is a command, wired up at startup by introspecting WebexSimpleApi.

Install

pip install wxc-cli

The tool does not work with Python 3.14. To install in a venv with a different Python version:

pipx install wxc-cli --python python3.13

Or from source:

git clone ...
pip install -e .

Auth

export WEBEX_ACCESS_TOKEN="your-token-here"
# or pass it per-command:
wxc-cli --token YOUR_TOKEN people list

Usage

wxc-cli --help                          # list all command groups
wxc-cli people --help                   # list people commands
wxc-cli people list --display-name Bob  # filter by name
wxc-cli people list --output json       # JSON output
wxc-cli people details --person-id Y2l… # single person
wxc-cli telephony callqueue --help      # nested sub-APIs work too

The wxc_sdk supported endpoint list serves as a reference for the available commands.

If for example the wxc_sdk reference has an endpoint api.person_settings.forwarding.read then wxc-cli supports wxc-cli person-settings forwarding read and wxc-cli person-settings forwarding read --help gives you an overview of the supported parameters.

The endpoint names in the wxc_sdk supported endpoint list are links to the actual function definitions for the respective endpoint.

For example, this is the documentation for the api.person_settings.forwarding.read endpoint which helps to understand the CLI parameters.

Note: The SDK uses snake-case names for endpoints and the CLI kebab-case names for commands.

Output formats

Every command accepts --output table (default), --output json, --output csv, or --output raw.

wxc-cli rooms list --output json | jq '.[].title'

Pydantic model inputs

Methods that take a Pydantic model (e.g. create, update) accept a --<param>-json flag:

wxc-cli people create \
  --settings-json '{"emails":["alice@example.com"],"display_name":"Alice"}'

Raw output

-o raw is clean stdout with no Rich markup, headers, or decoration.

Situation Output
--fields person_id (single field) one bare value per line — directly pipeable
--fields person_id,display_name (multiple) tab-separated, one record per line
no --fields all non-None fields, tab-separated
list[scalar] or nested model in a field JSON-encoded inline
scalar return (bool, str, int) str(value)

Typical shell patterns:

# Feed IDs into a loop
for id in $(wxc-cli people list --display-name Alice -o raw --fields person_id); do
    wxc-cli people details --person-id "$id" --calling-data -o json
done

# Extract one field with cut/awk
wxc-cli rooms list -o raw --fields title,type | awk -F'\t' '$2=="direct" {print $1}'


# xargs
wxc-cli people list --display-name Alice -o raw --fields person_id \
  | xargs -I{} wxc-cli person-settings forwarding read --entity-id {} -o json \
  | jq '.call_forwarding.always'
  
# command substitution
wxc-cli people list --calling-data --fields display_name,emails \
  --location-id $(wxc-cli locations list --name Hartford --fields location_id -o raw)

How it works

cli.py introspects WebexSimpleApi at import time:

  1. Each sub-API attribute (.people, .telephony, .rooms, …) becomes a Typer command group.
  2. Each public method becomes a command inside that group.
  3. The method's type-annotated parameters become --option flags — scalars directly, Pydantic models via --<n>-json.
  4. Generator return types (list endpoints) are consumed fully and rendered as a Rich table or JSON array.
  5. Nested sub-APIs (e.g. telephony.calls, telephony.callqueue) recurse into sub-groups automatically.

New endpoints added to wxc_sdk appear in the CLI with zero maintenance.

Shell completion

wxc-cli --install-completion   # bash / zsh / fish

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wxc_cli-0.5.1.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wxc_cli-0.5.1-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file wxc_cli-0.5.1.tar.gz.

File metadata

  • Download URL: wxc_cli-0.5.1.tar.gz
  • Upload date:
  • Size: 20.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.2

File hashes

Hashes for wxc_cli-0.5.1.tar.gz
Algorithm Hash digest
SHA256 9530dcb39a4171fa176901110c0e4a9f7b501afd773d45825befd9ef527bacfd
MD5 571ddaef8e5884837b16cce3230192f2
BLAKE2b-256 0428f301117b81ed4a7910d73e42aa8ed4e5e1cce48790541f40f9499b3a6c51

See more details on using hashes here.

File details

Details for the file wxc_cli-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: wxc_cli-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.2

File hashes

Hashes for wxc_cli-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 35358c2dad1ded2ad190ff46651b90c061d36d7cca3a91d5f1e1a6d498735c98
MD5 0ac6c7a245dd5600a3e48650c1aedb8a
BLAKE2b-256 7453e0274a3a434a2e766be83a8fbd713be78e3cc530c22ea98d31d20aa2b5a2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page