Metadata-Version: 2.4
Name: wxc-cli
Version: 0.5.1
Summary: Auto-generated CLI for the wxc_sdk Webex SDK
Project-URL: Homepage, https://github.com/jeokrohn/wxc-cli
Project-URL: Repository, https://github.com/jeokrohn/wxc-cli
Project-URL: Bug Tracker, https://github.com/jeokrohn/wxc-cli/issues
Project-URL: Changelog, https://github.com/jeokrohn/wxc-cli/blob/main/CHANGELOG.md
Author-email: Johannes Krohn <jkrohn@cisco.com>
License: MIT License
        
        Copyright (c) 2026 Johannes Krohn
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: api,cisco,cli,webex,webex-calling,wxc_sdk
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Telecommunications Industry
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Communications
Classifier: Topic :: Utilities
Requires-Python: <3.14,>=3.11
Requires-Dist: keyring>=25.7.0
Requires-Dist: python-dotenv>=1.2.2
Requires-Dist: rich>=14.3.3
Requires-Dist: typer>=0.24.1
Requires-Dist: wxc-sdk>=1.30.0
Description-Content-Type: text/markdown

[![PyPI version](https://img.shields.io/pypi/v/wxc-cli.svg)](https://pypi.org/project/wxc-cli/)
[![Python versions](https://img.shields.io/pypi/pyversions/wxc-cli.svg)](https://pypi.org/project/wxc-cli/)

# wxc-cli

Auto-generated CLI for [`wxc_sdk`](https://pypi.org/project/wxc_sdk/) — every API endpoint is
a command, wired up at startup by introspecting `WebexSimpleApi`.

## Install

```bash
pip install wxc-cli
```

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

```bash
pipx install wxc-cli --python python3.13
```

Or from source:

```bash
git clone ...
pip install -e .
```

## Auth

```bash
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](https://wxc-sdk.readthedocs.io/en/latest/user/method_ref.html) 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](https://wxc-sdk.readthedocs.io/en/latest/user/method_ref.html) are 
links to the actual function definitions for the respective endpoint. 

For example, 
[this](https://wxc-sdk.readthedocs.io/en/latest/apidoc/wxc_sdk.person_settings.forwarding.html#wxc_sdk.person_settings.forwarding.PersonForwardingApi.read) 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`.

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

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

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

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

