--- name: omada-controller description: Interact with TP-Link Omada SDN Controller Open API. Use when querying or managing Omada network devices, clients, sites, access points, switches, gateways, VLANs, firewall rules, VPNs, or any Omada controller configuration. Also use when the user mentions Omada, SDN controller, or needs to authenticate against the Omada API. license: MIT compatibility: Requires curl and network access to an Omada SDN Controller. The controller must have Open API enabled with client credentials configured. metadata: author: jakeasmith version: "1.9" --- # Omada SDN Controller API Manage TP-Link Omada SDN Controllers via the Open API (OpenAPI 3.0.1). ## Compatibility The Open API is available in **Omada SDN Controller v5.9 and later** (both the Software Controller and Cloud-Based Controller). Earlier versions only have an undocumented internal API that uses cookie-based session auth — this skill does not cover that legacy API. The Open API feature must be explicitly enabled by an administrator before use. ## Environment Setup Before making any API calls, you need three environment variables. If the user has not provided these or a `.env` file does not exist, walk them through the setup: 1. **Find the controller URL** — Ask the user for their Omada Controller address. This is typically `https://:8043` for the Software Controller. The port may differ if customized during installation. 2. **Create API credentials** — Guide the user to: - Log into the Omada Controller web UI - Navigate to **Global View > Settings > Platform Integration > Open API** - Click **Add New App** - Set the type to **Client** (not Gateway) - Copy the generated **Client ID** and **Client Secret** 3. **Create the `.env` file** — Have the user create a `.env` file in the project root: ``` OMADA_URL=https://omada.example.com:8043 OMADA_CLIENT=your-client-id OMADA_SECRET=your-client-secret ``` **Never commit `.env` to git.** Ensure `.gitignore` includes it. Load variables before making requests: ```bash export $(grep -v '^#' .env | xargs) ``` Do NOT use `source .env` — variables won't propagate to subshells or curl. If auth fails, common causes are: - The Open API feature is not enabled on the controller - The client app type is set to Gateway instead of Client - The controller URL is wrong or missing the port - The client secret was rotated in the UI but not updated in `.env` ## Locating the Wrapper Script The API wrapper script is at `scripts/omada-api.sh` relative to this skill's directory. On first use in a session, find the script path using Glob to search for `**/omada-controller/scripts/omada-api.sh`. Use the discovered absolute path for all subsequent calls. For example, if the skill is installed at `.claude/skills/omada-controller/`, the script path is `.claude/skills/omada-controller/scripts/omada-api.sh`. ## Making API Calls **Always use the wrapper script** for all Omada API calls. It handles env loading, authentication, and URL construction automatically. **Anti-patterns:** Any command beyond `bash