# swx-cli > [!NOTE] > **WHAT TO EXPECT** > > `swx-cli` is the command-line tool for managing a cloudSwXtch deployment. With it, users can sign in to the deployment, list the cloudSwXtches and the clients connected to them, create clusters and High Availability (HA) configurations, manage adaptors, licenses, users and certificates, and collect support information. > > **In this article**, users will learn how to run swx-cli, how to sign in, and how to use each of its commands. ## Where swx-cli runs `swx-cli` is installed on every cloudSwXtch. It runs inside the `swx-swxtch` container, and the installer adds a `swx-cli` command to the VM that forwards the call to it, so it can be used directly from a terminal session on the cloudSwXtch VM: ```shell $ swx-cli version {"Version":"dev.320fce","Commit":"320fceeb6f25ffc05569529db385d9cc7cf4ced9","Date":"20261030.195416"} ``` This article uses swx-cli from a terminal on the cloudSwXtch VM. All the examples were run that way. > [!NOTE] > **PLEASE NOTE** > > swx-cli is not installed on swXtchBridge VMs. The Linux and Windows xNIC also install swx-cli, but in the current release it stops there with `failed to load any of the 1 trusted certificates provided`. Run swx-cli on the cloudSwXtch. > [!NOTE] > **RUNNING SWX-CLI FROM A SCRIPT** > > The `swx-cli` command on the cloudSwXtch VM works the same from a script, a cron job or a non-interactive `ssh` call: it asks for a terminal only when it runs in one. Use the `swx-cli` command rather than `docker exec` into the `swx-swxtch` container: the container's file system is read-only, and the command runs swx-cli in a folder where it can write its log. ### Working with files Several commands read a JSON file (`--input`) or write one (`--output`, `--output-prefix`). Because swx-cli runs inside the container, those paths are paths *inside the container*. The folder `/var/opt/swx/swxtch` is shared between the VM and the container with the same path, so the simplest way to exchange files is to keep them there: ```shell sudo cp cluster-conf.json /var/opt/swx/swxtch/ swx-cli cluster validate -i /var/opt/swx/swxtch/cluster-conf.json ``` Files written by swx-cli to `/var/opt/swx/swxtch` also appear in the same folder on the VM. The folder is owned by root, so use `sudo` to copy files into it. ## Signing in Most commands talk to OMNI, the management service of the cloudSwXtch (port 8443), and require a signed-in session. Sign in once with `auth login`; swx-cli saves the session in a profile and uses it for the following commands: ```shell swx-cli auth login --user --password --host https://:8443 ``` **Example:** Sign in to the cloudSwXtch and check the session ```shell $ swx-cli auth login --user admin --password ******** --host https://10.0.128.26:8443 Logged in as admin (admin) Profile: localhost:8443 $ swx-cli auth status Profile: localhost:8443 Host: https://10.0.128.26:8443 User: admin Role: Administrator Status: Logged in ``` The first time swx-cli reaches an OMNI it does not trust yet, `auth login` shows the key that OMNI serves and asks to confirm it: ```shell OMNI at 10.0.128.26:8443 is not trusted yet. It serves key sha256// (...). Check it against 'swx-cli cert pin' (OMNI) or 'swx-cli swxtch pin' (swXtch) on its host. Trust it? [y/N]: ``` Compare the key with `swx-cli cert pin` on the OMNI host, and answer `y`. swx-cli then saves OMNI's trust bundle in the profile and verifies OMNI by it from then on. In scripts, pass the pin with `--pin sha256//` to trust it without a prompt; a different key stops the login. On a cloudSwXtch host, the cloudSwXtch's own OMNI is already trusted. If `--user` is omitted, swx-cli asks for an API key instead of a password (see [auth](#auth) to create one). With `--store-api-key` (`-s`), the API key is kept in the profile, in clear text unless `--use-passkey` is given; use it only in a trusted environment. | Command | What it does | | --- | --- | | `swx-cli auth login` | Signs in and saves the session in a profile | | `swx-cli auth status` | Shows the active profile, host, user and role, and whether the session is still valid | | `swx-cli auth logout` | Removes the saved session | > [!NOTE] > **PLEASE NOTE** > > The session expires after a while. When a command answers `Not authenticated` or `No active session. Please login first.`, run `auth login` again. > > `auth login` and `auth status` print the session token on the screen. Treat it like a password. > [!WARNING] > **DEFAULT CREDENTIALS** > > The installer creates an administrator user. Change its password as soon as the deployment is up, or create personal users and block the installer one (see [auth](#auth)). ## Getting Help `swx-cli help` lists the commands. Running `swx-cli` alone prints the same list, after the line `Command line seems to be incomplete. 'swx-cli' holds child commands`: ```shell $ swx-cli help Usage: swx-cli help [command [subcommand ...]] swx-cli help list all commands swx-cli help show a command's flags and subcommands swx-cli help drill into a subcommand swx-cli: Swxtch CLI auth : Auth management tool (users and API keys) cert : Certificate management clients : Client management tool (authorization and state) cluster : Cluster management tool (create, destroy, update and print members & routes) flows : Swxtch flow management tool ha : High Availability cluster management tool (create, show, stream, policy and destroy the HA cluster) help : Print help for a command, or list all commands licenses : License bundle management monitoring : Monitoring tool (components state and metrics) registry : Private xNIC image registry helpers swxtch : Swxtch management tool swxtches : swXtch management tool (add, list, visibility) version : Version will output the current build information xnic : xNIC observation tool ``` Adding a command after `help` lists its subcommands, and adding a subcommand shows its options. Each help page starts with the same short usage reminder: ```shell $ swx-cli help cluster Usage: swx-cli help [command [subcommand ...]] swx-cli help list all commands swx-cli help show a command's flags and subcommands swx-cli help drill into a subcommand cluster: Cluster management tool (create, destroy, update and print members & routes) create : Create the cluster of swXtches using a config file destroy : Destroy a cluster state : Show clusters state information update : Update a cluster using a config file validate : Check a cluster config file against the same rules the server applies, without deploying it ``` ```shell $ swx-cli help cluster create Usage: swx-cli help [command [subcommand ...]] swx-cli help list all commands swx-cli help show a command's flags and subcommands swx-cli help drill into a subcommand create: Create the cluster of swXtches using a config file --client-cert (string) : Client certificate file to connect to the server --client-key (string) : Client certificate key file to connect to the server --default-pinning (bool) : Apply default pinning configuration when none provided --folder (string) : Data folder path -h, --host (string) : Service host address (omni) -i, --input (string, mandatory) : JSON input file --log-tags (string) : Log Tags - default: info,error -o, --output (string) : Result output file --pin (string) : Key pin (sha256//...) the OMNI must serve; auth login then trusts it without a prompt --profile (string) : Configuration profile name --server-certs (string) : Server certificate files to connect to the server (overrides standard certificate lookup) --use-passkey (bool) : Pass key for api key storage encryption. When provided, you will be prompted for the pass key interactively. ``` In the option list, `mandatory` marks the options that must be given. ## Common options Besides their own options, all commands accept these. They only have a long form: | Option | Type | Description | | --- | --- | --- | | `--client-cert` | string | Client certificate file to connect to the server | | `--client-key` | string | Client certificate key file to connect to the server | | `--default-pinning` | bool | Apply default pinning configuration when none provided | | `--folder` | string | Data folder path | | `--log-tags` | string | Log Tags - default: info,error | | `--pin` | string | Key pin (sha256//...) the OMNI must serve; auth login then trusts it without a prompt | | `--profile` | string | Configuration profile name | | `--server-certs` | string | Server certificate files to connect to the server (overrides standard certificate lookup) | | `--use-passkey` | bool | Pass key for api key storage encryption. When provided, you will be prompted for the pass key interactively. | Most commands also accept `--host` (`-h`), the OMNI address. It can be left out after signing in, because swx-cli uses the host of the session. The `licenses` commands take the OMNI address as `--omni` (`-a`) instead. A bool option takes `true` or `false` as the next argument, for example `swx-cli clients status -A false` (clients not authorized yet) or `-A true` (authorized ones). A command refuses arguments it does not take. > [!TIP] > **USE THE LONG FORM IN SCRIPTS** > > A command's own options have a long form and, most of them, a one-letter short form, for example `--input` and `-i`. The same letter can mean different things in different commands: `-p` is `--password` in `auth create-user`, `--pattern` in `clients status` and `--output-prefix` in `swxtch support`. In scripts, use the long form so the value goes to the intended option. ## List of commands | Command | Used to | | --- | --- | | [`swxtches`](#swxtches) | List the cloudSwXtches managed by OMNI; capture (add) or remove them; manage capture tokens | | [`clients`](#clients) | List the xNICs, bridges and Kubernetes clusters, authorize or unauthorize them; manage enrol tokens | | [`monitoring`](#monitoring) | Show the state and metrics of every component | | [`cluster`](#cluster) | Create, validate, update and destroy clusters | | [`ha`](#ha) | Create, validate and destroy High Availability configurations and their per-stream policies | | [`flows`](#flows) | Deploy and inspect flow configurations | | [`swxtch`](#swxtch) | Manage the adaptors of a cloudSwXtch, collect its support information; on the cloudSwXtch host, print its join code and key pin, and release it from its OMNI | | [`licenses`](#licenses) | Upload license bundles and manage the seats | | [`auth`](#auth) | Sign in; manage users and API keys | | [`cert`](#cert) | Check the certificates, install your own on OMNI, add a trusted CA, rotate OMNI's CA | | [`xnic`](#xnic) | Inspect how an xNIC rebuilds an HA stream | | [`registry`](#registry) | Helper for a private xNIC image registry | | [`version`](#version) | Show the swx-cli version | ### swxtches `swx-cli swxtches` lists the cloudSwXtches that OMNI manages, captures (adds) or removes them, and manages capture tokens. ```shell $ swx-cli help swxtches Usage: swx-cli help [command [subcommand ...]] swx-cli help list all commands swx-cli help show a command's flags and subcommands swx-cli help drill into a subcommand swxtches: swXtch management tool (add, list, visibility) add : Add and manage swXtches (push session + init omni) capture-token : Create a capture token: install swXtches with --capture-token , then add them with --capture-token list : List swXtch member info remove : Remove a swXtch: clear its security, then drop it from this OMNI ``` | Subcommand | What it does | Options | | --- | --- | --- | | `add` | Add and manage swXtches (push session + init omni) | `--addresses` (`-a`) *(required)* `--capture-token` (`-t`) `--collect-notifications` (`-n`) `--join-code` (`-j`) | | `capture-token` | Create, list or revoke capture tokens | `--list` (`-l`) `--revoke` (`-r`) `--valid-hours` (`-v`) | | `list` | List swXtch member info | `--output` (`-o`) | | `remove` | Remove a swXtch: clear its security, then drop it from this OMNI | `--addresses` (`-a`) *(required)* | Addresses given to `swxtches add` and `swxtches remove` use the control IP and port of the cloudSwXtch, for example `10.0.0.4:9443`. A cloudSwXtch that already belongs to another OMNI cannot be added; it has to be removed from that OMNI first, or released on its host with [`swxtch release`](#release). `swxtches add` captures a cloudSwXtch that no OMNI holds yet with the credential it was installed for: - `--join-code`: the join code its installer printed (`swx-cli swxtch join-code` on its host shows it again). For several cloudSwXtches, give the codes comma-separated, in the order of `--addresses`. - `--capture-token`: the capture token it was installed with (`--capture-token` of the installer). A cloudSwXtch that already trusts this OMNI needs neither. See [How identity and trust work](../cloudswxtch/quick-start-guide/how-identity-and-trust-work.md#capturing-a-cloudswxtch). **Example:** Capture a second cloudSwXtch with its join code ```shell $ swx-cli swxtches add --addresses 10.0.128.132:9443 --join-code swxj_. [ { "swxtchAddress": "10.0.128.132:9443" } ] ``` When a cloudSwXtch cannot be added, the answer carries an `error` field: ```shell $ swx-cli swxtches add --addresses 10.0.128.99:9443 [ { "swxtchAddress": "10.0.128.99:9443", "error": "No swXtch answered at 10.0.128.99:9443. Check the address, and that the swXtch is running and reachable from this OMNI." } ] ``` > [!NOTE] > **PLEASE NOTE** > > `swxtches add` ends without an error code even when the cloudSwXtch was not added. In scripts, check the `error` field, or confirm with `swxtches list`. `swxtches capture-token` creates a capture token, valid 24 hours unless `--valid-hours` says otherwise (at most 720). The token is printed once, on standard output, and its id and expiry on standard error. `--list` lists the ids and expiries, and `--revoke ` revokes one. They need the Admin role. ```shell $ swx-cli swxtches capture-token --valid-hours 48 swxj_. Capture token , valid until 2026-11-19T18:00:00Z. It is shown once. ``` `swxtches list` returns, for each cloudSwXtch, its addresses, version, license, entitlements, traffic counters, and whether it belongs to a cluster or an HA configuration (`isCluster`, `isHa`, and the `clusterConfig` and `haConfig` blocks). For a cloudSwXtch OMNI's CA certified, it also returns its key pin (`pin`) and the client install commands pinned to it (`installCommands`: `xnicLinux`, `xnicWindows`, `xnicWindows2016` for a Windows host without a curl.exe that pins a key, `bridge`, `kubernetesDs`, and the same with `Enrolled` for an enrol token). **Example:** List the cloudSwXtches managed by OMNI (trimmed: one of the two cloudSwXtches, without its cluster and HA blocks) ```shell $ swx-cli swxtches list [ { "address": "https://10.0.128.26:9443/propagate", "swxtchUserData": { "name": "fs-cs1", "hostName": "fs-cs1", "version": "dev.320fce", "cloudName": "OCI", "controlIp": "10.0.128.26", "controlPort": 9443, "nodeAddress": "https://10.0.128.26:9443/propagate", "dataIp": "10.0.138.141", "dataPort": 9999, "publicDataIp": null, "dataSubnet": "10.0.138.0/24", "maxInnerIpPacket": 9216, "outerIpMtu": 9000, ... "licensed": true, "licensingInfo": { "type": "License File", "name": null, "expiryDate": "2026-11-29T22:30:00Z", "offlineExpiryDate": null }, "fingerprint": "13c04aaf-2ee8-4a48-8035-4bad5aec56e8", "entitlements": { "maxClientCount": null, "maxBridgeCount": 4, "bandwidthMbps": null, "enableMesh": true, "enableUnicast": true, "enableHA": true, "enableClockSync": false, "enableBridge": true, "enableWxckedEye": true, "enableAllowsMajorVersionUpdate": true }, ... "omniServerAddress": "https://10.0.128.26:8443" }, "isHa": true, "isCluster": true, "omniServerAddress": "https://10.0.128.26:8443", "captured": true }, ... ] ``` ### clients `swx-cli clients` lists the clients (xNICs, swXtchBridges and Kubernetes clusters) that have contacted the cloudSwXtch, authorizes or unauthorizes them, and manages enrol tokens. ```shell $ swx-cli help clients Usage: swx-cli help [command [subcommand ...]] swx-cli help list all commands swx-cli help show a command's flags and subcommands swx-cli help drill into a subcommand clients: Client management tool (authorization and state) authorize : Authorize clients enroll-token : Enrol tokens: a client installed with one is approved without an admin status : Show clients authorization state unauthorize : Unauthorize clients ``` | Subcommand | What it does | Options | | --- | --- | --- | | `authorize` | Authorize clients | `--input` (`-i`) *(required)* | | `enroll-token create` | Create an enrol token; its secret is printed once | `--name` (`-n`) *(required)* `--expires` (`-e`) `--kind` (`-k`) | | `enroll-token list` | List enrol tokens | — | | `enroll-token revoke` | Revoke an enrol token | `--id` (`-i`) *(required)* | | `status` | Show clients authorization state | `--authorized` (`-A`) `--pattern` (`-p`) `--unseen` (`-U`) | | `unauthorize` | Unauthorize clients | `--input` (`-i`) *(required)* | `clients status` accepts `--pattern` to show only the clients whose address matches, for example `--pattern 10.0.1`, and `--unseen true` to show only the approved clients no cloudSwXtch heard from for 7 days (`--unseen false` shows the others). **Example:** Show the client whose address contains 10.0.128.190 ```shell $ swx-cli clients status --pattern 10.0.128.190 [ { "address": "10.0.128.190", "componentKind": { "code": "xnic", "displayName": "xNIC" }, "authorized": true, "swxtches": { "https://10.0.128.132:9443/propagate": true, "https://10.0.128.26:9443/propagate": true }, "hostname": null, "firstSeen": null, "name": null, "observedAddress": null, "identityFp": "sha256//", "enrollTokenId": null, "approvedIdentityFp": null, "lastSeen": null, "syncing": false, "unseen": false } ] ``` `swxtches` shows, for each cloudSwXtch the client talks to, whether that cloudSwXtch accepts it. `identityFp` is the fingerprint of the client's identity key: the one waiting for approval when there is one (a new client, or a new key at an approved address), otherwise the approved one. `enrollTokenId` names the enrol token a waiting identity presented. `approvedIdentityFp` is set when a new key waits at an address approved for another key of that kind: it is the approved one. `lastSeen` is the last signed request any cloudSwXtch saw from the approved client, and `unseen` is `true` when that was more than 7 days ago. The file for `authorize` and `unauthorize` lists the clients by address and kind. The kind (`componentKindCode`) is required: `xnic` for an xNIC, `bridge` for a swXtchBridge, `k8s-cluster` for a Kubernetes cluster. `identityFp` names the identity to approve, as `clients status` shows it; without it, `authorize` approves the identity waiting for that address and kind: ```json { "items": [ { "address": "10.0.1.21", "componentKindCode": "xnic", "identityFp": "sha256//" }, { "address": "10.0.1.30", "componentKindCode": "bridge" } ] } ``` ```shell swx-cli clients authorize -i /var/opt/swx/swxtch/clients.json ``` Authorizing a client that is already approved, with no new identity waiting, changes nothing. An unauthorized client can be authorized again without reinstalling it, once it has presented its identity again and shows as pending. Authorizing it before that, right after the unauthorize, is refused with "has no identity awaiting approval": wait until it shows as pending, then authorize it. `clients enroll-token` manages enrol tokens: a client installed with one (`SWX_ENROLL_TOKEN`) is approved without an administrator. `create` prints the token once; `--kind` limits it to `xnic`, `bridge` or `k8s-cluster` clients (default: any), and `--expires` ends it at an RFC 3339 time (default: never). Revoking a token leaves the clients it already approved approved. A token never replaces an approval of another identity or kind at the same address: a client reinstalled without `--persist` waits for `clients authorize`. See [Enrol tokens](../cloudswxtch/using-wxcked-eye/system-management/authorizations.md#enrol-tokens). ```shell $ swx-cli clients enroll-token create --name "render farm" --kind xnic --expires 2027-01-31T00:00:00Z Enrol token created. It is shown once; keep it like a password: swxe_. Install a client with it in SWX_ENROLL_TOKEN (never in a URL), e.g.: ... | SWX_ENROLL_TOKEN='' bash -s -- ``` ### monitoring `swx-cli monitoring components` returns the state index that OMNI keeps for every running component — the cloudSwXtch, each xNIC and each bridge: host, cloud, region and instance type, network interfaces, CPU layout, and traffic counters and rates. ```shell $ swx-cli help monitoring Usage: swx-cli help [command [subcommand ...]] swx-cli help list all commands swx-cli help show a command's flags and subcommands swx-cli help drill into a subcommand monitoring: Monitoring tool (components state and metrics) components : Show the components state index (static data and metrics) ``` The output is a single JSON document keyed by component. To read it, pipe it through a JSON formatter, for example `python3 -m json.tool`. `--input` (`-i`) takes an optional JSON file with a `swxtchAddresses` filter. **Example:** Show the state of the components (trimmed) ```shell $ swx-cli monitoring components | python3 -m json.tool { "10.0.128.26": { "state": { "id": "10.0.128.26", "name": "fs-cs1", "componentKindCode": "swxtch", "environment": { "hostname": "fs-cs1", "cloudName": "OCI", "osDistribution": "Ubuntu 24.04", "regionName": "us-ashburn-1", "instanceTypeName": "VM.Standard.E5.Flex", ... }, ... }, ... } ``` ### cluster `swx-cli cluster` manages [clusters](../cloudswxtch/using-wxcked-eye/topology-graph/fleet/side-panel/clusters-and-ha.md). ```shell $ swx-cli help cluster Usage: swx-cli help [command [subcommand ...]] swx-cli help list all commands swx-cli help show a command's flags and subcommands swx-cli help drill into a subcommand cluster: Cluster management tool (create, destroy, update and print members & routes) create : Create the cluster of swXtches using a config file destroy : Destroy a cluster state : Show clusters state information update : Update a cluster using a config file validate : Check a cluster config file against the same rules the server applies, without deploying it ``` | Subcommand | What it does | Options | | --- | --- | --- | | `create` | Create the cluster of swXtches using a config file | `--input` (`-i`) *(required)* `--output` (`-o`) | | `destroy` | Destroy a cluster | `--id` (`-i`) *(required)* `--force` (`-F`) | | `state` | Show clusters state information | `--ids` (`-i`) `--output` (`-o`) | | `update` | Update a cluster using a config file | `--input` (`-i`) *(required)* `--force` (`-F`) `--output` (`-o`) | | `validate` | Check a cluster config file against the same rules the server applies, without deploying it | `--input` (`-i`) *(required)* | The file used for `create`, `update` and `validate` is a JSON file that names the cluster and lists its segments. Each segment lists the control addresses of its cloudSwXtches (IP and port 9443) and says whether it uses the swXtch Lossless Protocol (`enableSlp`, required): ```json { "name": "cluster-red", "segments": [ { "name": "cluster-red", "enableSlp": false, "swxtchAddresses": [":9443"] } ] } ``` To split the traffic among several segments, set `segmentation` to `true` and give each segment its `groupRanges`, as in the large-cluster example below. A cluster with a single segment forwards every stream, so it does not take group ranges. > [!TIP] > **VALIDATE BEFORE DEPLOYING** > > `cluster validate` checks a file against the same rules OMNI applies, without deploying anything. It answers `The configuration is valid.` followed by the configuration, or the reason the file is rejected, for example `Required value missing for Segments[0].EnableSlp`. **Example:** Create, check and destroy a single-segment cluster 1. Create the file `cluster-red.json` in the shared folder, with the content shown above and the control IP of the cloudSwXtch: ```shell sudo nano /var/opt/swx/swxtch/cluster-red.json ``` 2. Validate it: ```shell $ swx-cli cluster validate --input /var/opt/swx/swxtch/cluster-red.json The configuration is valid. { "clusterId": null, "name": "cluster-red", "spaceName": null, "tagName": null, "segments": [ { "segmentId": null, "name": "cluster-red", "swxtchAddresses": [ "10.0.128.26:9443" ], "topology": null, "spaceName": null, "groupRanges": null, "enableSlp": false, "slpParams": null } ] } ``` 3. Create the cluster. swx-cli reports the answer of each cloudSwXtch and prints the configuration with the IDs it assigned: ```shell $ swx-cli cluster create --input /var/opt/swx/swxtch/cluster-red.json https://10.0.128.26:9443/propagate - OK. Created configuration: { "clusterId": "3404425a-7607-d9a4-3e42-6e50c73ed518", "name": "cluster-red", "spaceName": "cluster.3404425a-7607-d9a4-3e42-6e50c73ed518", "tagName": null, "segments": [ { "segmentId": "1bfd5f89-b23d-e01b-71ff-ea62a167fd54", "name": "cluster-red", "swxtchAddresses": [ "10.0.128.26:9443" ], "topology": null, "spaceName": "segment.3404425a-7607-d9a4-3e42-6e50c73ed518", "groupRanges": null, "enableSlp": false, "slpParams": null } ], "clientEndpoints": { "10.0.128.26:9443": { "controlAddress": "129.158.46.21:9443", "dataAddress": null } } } ``` 4. Check it with `cluster state`. `--ids` limits the output to the given clusters: ```shell $ swx-cli cluster state --ids 3404425a-7607-d9a4-3e42-6e50c73ed518 [ { "clusterConfig": { "clusterId": "3404425a-7607-d9a4-3e42-6e50c73ed518", "name": "cluster-red", "spaceName": "cluster.3404425a-7607-d9a4-3e42-6e50c73ed518", "tagName": null, "segments": [ { "segmentId": "1bfd5f89-b23d-e01b-71ff-ea62a167fd54", "name": "cluster-red", "swxtchAddresses": [ "10.0.128.26:9443" ], "topology": null, "spaceName": "segment.3404425a-7607-d9a4-3e42-6e50c73ed518", "groupRanges": null, "enableSlp": false, "slpParams": null } ], "clientEndpoints": { "10.0.128.26:9443": { "controlAddress": "129.158.46.21:9443", "dataAddress": null } } }, "segmentStates": [ { "segmentConfig": { "segmentId": "1bfd5f89-b23d-e01b-71ff-ea62a167fd54", "name": "cluster-red", "swxtchAddresses": [ "10.0.128.26:9443" ], "topology": null, "spaceName": "segment.3404425a-7607-d9a4-3e42-6e50c73ed518", "groupRanges": null, "enableSlp": false, "slpParams": null }, "members": { "https://10.0.128.26:9443/propagate": { "memberInfo": { "destinations": {}, "swxtchSubscriptions": {}, "tree": { "address": "https://10.0.128.26:9443/propagate", "children": null }, "visibleSwxtches": { "https://10.0.128.26:9443/propagate": [] }, "fullyConnected": true, "config": { "segmentId": "1bfd5f89-b23d-e01b-71ff-ea62a167fd54", "name": "cluster-red", "swxtchAddresses": [ "10.0.128.26:9443" ], "topology": null, "spaceName": "segment.3404425a-7607-d9a4-3e42-6e50c73ed518", "groupRanges": null, "enableSlp": false, "slpParams": null } }, "joinStatusErrorMessage": null } }, "resolutionErrorMessage": null } ] } ] ``` 5. Destroy a cluster with its ID (here, a cluster created earlier on the same cloudSwXtch): ```shell $ swx-cli cluster destroy --id a1730796-a40a-2a4f-2060-2c717ad37d6e https://10.0.128.26:9443/propagate - OK. Deleted cluster configuration: { "resultItems": [ { "swxtchAddress": "https://10.0.128.26:9443/propagate", "result": null, "error": null } ], "error": null, "hasItemErrors": false, "itemErrorCount": 0 } ``` **Example:** Create a large cluster with segmentation For large clusters, write the configuration in a file first. This file defines a cluster of 5 segments, one cloudSwXtch each, and splits 117 group ranges among them (the list is trimmed; the ellipses stand for the missing values): ```json { "name": "A", "segmentation": true, "dynamicSegmentAssignment": true, "segments": [ { "name": "As1", "enableSlp": false, "swxtchAddresses": [ "10.128.0.80:9443" ], "groupRanges": [ "239.1.1.1-239.1.1.12", "239.1.2.1-239.1.2.12", "239.1.3.1-239.1.3.12", ... "239.1.115.1-239.1.115.12", "239.1.116.1-239.1.116.12", "239.1.117.1-239.1.117.12" ] }, { "name": "As2", "enableSlp": false, "swxtchAddresses": [ "10.128.0.82:9443" ], "groupRanges": [ "239.1.1.13-239.1.1.24", "239.1.2.13-239.1.2.24", "239.1.3.13-239.1.3.24", ... "239.1.115.13-239.1.115.24", "239.1.116.13-239.1.116.24", "239.1.117.13-239.1.117.24" ] }, { "name": "As3", "enableSlp": false, "swxtchAddresses": [ "10.128.0.83:9443" ], "groupRanges": [ "239.1.1.25-239.1.1.36", "239.1.2.25-239.1.2.36", "239.1.3.25-239.1.3.36", ... "239.1.115.25-239.1.115.36", "239.1.116.25-239.1.116.36", "239.1.117.25-239.1.117.36" ] }, { "name": "As4", "enableSlp": false, "swxtchAddresses": [ "10.128.0.84:9443" ], "groupRanges": [ "239.1.1.37-239.1.1.48", "239.1.2.37-239.1.2.48", "239.1.3.37-239.1.3.48", ... "239.1.115.37-239.1.115.48", "239.1.116.37-239.1.116.48", "239.1.117.37-239.1.117.48" ] }, { "name": "As5", "enableSlp": false, "swxtchAddresses": [ "10.128.0.85:9443" ], "groupRanges": [ "239.1.1.49-239.1.1.60", "239.1.2.49-239.1.2.60", "239.1.3.49-239.1.3.60", ... "239.1.115.49-239.1.115.60", "239.1.116.49-239.1.116.60", "239.1.117.49-239.1.117.60" ] } ] } ``` Validate it, then create it: ```shell $ swx-cli cluster validate -i /var/opt/swx/swxtch/cluster-conf.json The configuration is valid. { "clusterId": null, "name": "A", "spaceName": null, "tagName": null, "segments": [ { "segmentId": null, "name": "As1", "swxtchAddresses": [ "10.128.0.80:9443" ], "topology": null, "spaceName": null, "groupRanges": [ "239.1.1.1-239.1.1.12", "239.1.2.1-239.1.2.12", ... ``` ```shell swx-cli cluster create -i /var/opt/swx/swxtch/cluster-conf.json ``` Every cloudSwXtch in the file must be running and managed by OMNI (see `swxtches list`); `create` reports `OK.` for each one that accepted the configuration. `update` replaces the configuration of an existing cluster with the one in the file. `update` and `destroy` accept `--force`: `update --force` accepts an update even when a removed cloudSwXtch could not be reached and keeps the previous configuration, and `destroy --force` forgets the cluster even when a member did not confirm it left. ### ha `swx-cli ha` manages [High Availability configurations](../cloudswxtch/quick-start-guide/cloudswxtch-features/high-availability.md). An HA configuration joins two or more clusters as paths, and the xNICs rebuild each stream from the copies that arrive on every path. ```shell $ swx-cli help ha Usage: swx-cli help [command [subcommand ...]] swx-cli help list all commands swx-cli help show a command's flags and subcommands swx-cli help drill into a subcommand ha: High Availability cluster management tool (create, show, stream, policy and destroy the HA cluster) config : Retrieve a given HA config contents create : Create and deploy an HA configuration. destroy : Destroy a HA cluster list : List all HA configurations in the network policy : Per-destination sequence/dedup policies of an HA deployment (show, set, remove); destinations without one are AUTO stream : Update the HA Stream config of swxtches using a config file validate : Check an HA config file against the same rules the server applies, without deploying it ``` | Subcommand | What it does | Options | | --- | --- | --- | | `config` | Retrieve a given HA config contents | `--id` (`-i`) *(required)* `--output` (`-o`) | | `create` | Create and deploy an HA configuration. | `--input` (`-i`) *(required)* `--output` (`-o`) | | `destroy` | Destroy a HA cluster | `--id` (`-i`) *(required)* | | `list` | List all HA configurations in the network | `--output` (`-o`) | | `stream` | Update the HA Stream config of swxtches using a config file | `--id` (`-d`) *(required)* `--input` (`-i`) *(required)* | | `validate` | Check an HA config file against the same rules the server applies, without deploying it | `--input` (`-i`) *(required)* | The file used for `create` and `validate` names the configuration and lists its paths. Each path takes the ID of a cluster (from `cluster create` or `cluster state`), a name and, optionally, the color used for the path in wXcked Eye: ```json { "configName": "ha-array", "paths": [ { "clusterId": "", "name": "RedPath", "color": "#fc0303" }, { "clusterId": "", "name": "BluePath", "color": "#033dfc" } ] } ``` > [!NOTE] > **PLEASE NOTE** > > Do not add `pairNodes` to the file. OMNI sets it; `ha validate` shows it as `null`. **Example:** Create an HA configuration with two paths Each path is a single-segment cluster with one cloudSwXtch (see the [cluster](#cluster) example). Both cloudSwXtches must be licensed and managed by OMNI. 1. Create one cluster per cloudSwXtch and note the `clusterId` of each: ```shell swx-cli cluster create --input /var/opt/swx/swxtch/cluster-red.json swx-cli cluster create --input /var/opt/swx/swxtch/cluster-blue.json ``` 2. Write the two IDs in `/var/opt/swx/swxtch/ha.json`, as in the file above, and validate it: ```shell $ swx-cli ha validate --input /var/opt/swx/swxtch/ha.json The configuration is valid. { "configName": "ha-array", "paths": [ { "clusterId": "3404425a-7607-d9a4-3e42-6e50c73ed518", "name": "RedPath", "color": "#fc0303" }, { "clusterId": "b50a8afd-ee79-6099-3711-dfe004b0d7b2", "name": "BluePath", "color": "#033dfc" } ], "pairNodes": null } ``` 3. Create the HA configuration. swx-cli reports the answer of each cloudSwXtch and prints the configuration with its `configId` (trimmed): ```shell $ swx-cli ha create --input /var/opt/swx/swxtch/ha.json https://10.0.128.132:9443/propagate - OK. https://10.0.128.26:9443/propagate - OK. Created configuration: { "configId": "5efa2adf-66c3-0161-2a7b-2bf865414ec0", "configName": "ha-array", "paths": [ { "index": 0, "name": "RedPath", "color": "#fc0303", "clusterConfig": { ... } }, ... ] } ``` `ha list` shows the HA configurations in the network, and `ha config --id ` shows one of them. `ha destroy --id ` removes the HA configuration; the clusters stay, and are removed with `cluster destroy`. #### Per-stream policies By default, each multicast destination of an HA configuration is handled in **AUTO** mode. `ha policy` sets an explicit policy for a single destination: ```shell $ swx-cli help ha policy Usage: swx-cli help [command [subcommand ...]] swx-cli help list all commands swx-cli help show a command's flags and subcommands swx-cli help drill into a subcommand policy: Per-destination sequence/dedup policies of an HA deployment (show, set, remove); destinations without one are AUTO remove : Remove the policy of one multicast destination, returning it to AUTO set : Set the policy of one multicast destination (swxtch, rtp or passthrough; auto removes the explicit rule) show : List the explicit destination policies of an HA deployment ``` The mode is `swxtch`, `rtp` or `passthrough`. Setting `auto`, or running `ha policy remove`, removes the explicit policy and returns the destination to AUTO. The destination is given as `ip:port`. **Example:** Set, check and remove a policy for one destination ```shell $ swx-cli ha policy set --id 5efa2adf-66c3-0161-2a7b-2bf865414ec0 --stream 239.60.1.1:5000 --mode rtp https://10.0.128.132:9443/propagate - OK. https://10.0.128.26:9443/propagate - OK. $ swx-cli ha policy show --id 5efa2adf-66c3-0161-2a7b-2bf865414ec0 { "configId": "5efa2adf-66c3-0161-2a7b-2bf865414ec0", "policies": [ { "stream": "239.60.1.1:5000", "policy": "rtp", "remapped": false } ] } $ swx-cli ha policy remove --id 5efa2adf-66c3-0161-2a7b-2bf865414ec0 --stream 239.60.1.1:5000 https://10.0.128.26:9443/propagate - OK. https://10.0.128.132:9443/propagate - OK. ``` ### flows `swx-cli flows` deploys and inspects flow configurations. Each subcommand that changes a flow takes its definition from a JSON file. ```shell $ swx-cli help flows Usage: swx-cli help [command [subcommand ...]] swx-cli help list all commands swx-cli help show a command's flags and subcommands swx-cli help drill into a subcommand flows: Swxtch flow management tool deploy : Deploy a Swxtch flow configuration destroy : Destroy a Swxtch flow configuration list : List all Swxtch flow configurations state : Get the state of a Swxtch flow configuration ``` | Subcommand | What it does | Options | | --- | --- | --- | | `deploy` | Deploy a Swxtch flow configuration | `--input` (`-i`) *(required)* `--output` (`-o`) | | `destroy` | Destroy a Swxtch flow configuration | `--input` (`-i`) *(required)* | | `list` | List all Swxtch flow configurations | `--output` (`-o`) | | `state` | Get the state of a Swxtch flow configuration | `--input` (`-i`) *(required)* | ```shell $ swx-cli flows list [] ``` ### swxtch `swx-cli swxtch` works on one cloudSwXtch. It has two groups of subcommands, `adaptors` and `support`, which name the cloudSwXtch with `--swxtch` (`-s`) and its control IP and port, for example `--swxtch 10.0.0.4:9443`. The `join-code`, `pin` and `release` subcommands run on the cloudSwXtch host and act on that cloudSwXtch only. ```shell $ swx-cli help swxtch Usage: swx-cli help [command [subcommand ...]] swx-cli help list all commands swx-cli help show a command's flags and subcommands swx-cli help drill into a subcommand swxtch: Swxtch management tool adaptors : Swxtch adaptors management tool join-code : Run on the swXtch host: print the join code an OMNI captures it with pin : Run on the swXtch host: print its key pin and the pinned client install commands release : Run on the swXtch host: drop the OMNI it trusts, keeping everything else, so another OMNI can capture it support : Swxtch support tool ``` > [!NOTE] > **PLEASE NOTE** > > The help lists `--swxtch` as optional, but the `adaptors` and `support` subcommands need it: without it, swx-cli stops with `Mandatory flag named 'swxtch' not provided`. `join-code`, `pin` and `release` refuse it. #### adaptors `swx-cli swxtch adaptors` manages the [adaptors](../cloudswxtch/using-wxcked-eye/topology-graph/components/adaptors.md) of a cloudSwXtch. ```shell $ swx-cli help swxtch adaptors Usage: swx-cli help [command [subcommand ...]] swx-cli help list all commands swx-cli help show a command's flags and subcommands swx-cli help drill into a subcommand adaptors: Swxtch adaptors management tool add : Add a new adaptor remove : Remove an adaptor show : Show adaptor ``` | Subcommand | What it does | Options | | --- | --- | --- | | `add` | Add a new adaptor | `--input` (`-i`) *(required)* `--swxtch` (`-s`) *(required)* | | `remove` | Remove an adaptor | `--ids` (`-i`) *(required)* `--swxtch` (`-s`) *(required)* | | `show` | Show adaptor | `--swxtch` (`-s`) *(required)* | ```shell $ swx-cli swxtch adaptors show --swxtch 10.0.128.26:9443 { "adaptors": {} } ``` #### support `swx-cli swxtch support` collects support information about the cloudSwXtch, its xNICs and its swXtchBridges. ```shell $ swx-cli help swxtch support Usage: swx-cli help [command [subcommand ...]] swx-cli help list all commands swx-cli help show a command's flags and subcommands swx-cli help drill into a subcommand support: Swxtch support tool bridges-log : Download bridges log logs : Download swxtch logs report : Generate a support report swxtch-info : Swxtch Info xnics-logs : Download xNICs logs ``` | Subcommand | What it does | Options | | --- | --- | --- | | `bridges-log` | Download bridges log | `--bridges` (`-b`) *(required)* `--output-prefix` (`-p`) *(required)* `--date-from` (`-f`) `--date-to` (`-t`) `--since` `--swxtch` (`-s`) | | `logs` | Download swxtch logs | `--output-prefix` (`-p`) *(required)* `--date-from` (`-f`) `--date-to` (`-t`) `--since` `--swxtch` (`-s`) | | `report` | Generate a support report | `--output-prefix` (`-p`) *(required)* `--bridges` (`-b`) `--date-from` (`-f`) `--date-to` (`-t`) `--dump` (`-d`) `--since` `--swxtch` (`-s`) `--xnics` (`-x`) | | `swxtch-info` | Swxtch Info | `--output` (`-o`) *(required)* `--output-prefix` (`-p`) *(required)* `--swxtch` (`-s`) | | `xnics-logs` | Download xNICs logs | `--xnics` (`-x`) *(required)* `--output-prefix` (`-p`) *(required)* `--date-from` (`-f`) `--date-to` (`-t`) `--since` `--swxtch` (`-s`) | `--bridges` and `--xnics` take a comma-separated list of IDs. `report` needs a session with the **Admin** role: it carries the license and, with `--dump`, the core dump files. `logs`, `xnics-logs` and `bridges-log` need the **Writer** or **Admin** role: they collect the logs of the fleet. With a **Reader** session they are refused; `swxtch-info` works with any role. `--output-prefix` is the folder and first part of the file name; swx-cli adds the extension (and, for `swxtch-info`, the date and time). The time window can be given with `--since`, a duration back from now such as `30m`, `6h` or `2d`, or with `--date-from` and `--date-to` (`YYYY-MM-DD` or RFC 3339). Other forms are rejected, for example `--since "1 hour ago"` answers `Error parsing time into hours`. **Example:** Generate a support report 1. Generate the report in the shared folder. The command prints nothing when it succeeds: ```shell $ swx-cli swxtch support report --swxtch 10.0.128.26:9443 --output-prefix /var/opt/swx/swxtch/support ``` 2. The report is a `.tar.gz` file with the cloudSwXtch log, the kernel log, the configuration, the license, the entitlements and the streams: ```shell $ sudo tar tzvf /var/opt/swx/swxtch/support.tar.gz -rwxrwxrwx 0/0 11107826 2026-11-02 16:20 swx-swxtch.log -rwxrwxrwx 0/0 8496 2026-11-02 16:20 swxtch-info.json -rwxrwxrwx 0/0 54 2026-11-02 16:20 streams.json -rwxrwxrwx 0/0 664 2026-11-02 16:20 license.json -rwxrwxrwx 0/0 2139 2026-11-02 16:20 swx-swxtch-config.json -rwxrwxrwx 0/0 123058 2026-11-02 16:20 kern.log -rwxrwxrwx 0/0 286 2026-11-02 16:20 entitlements.json ``` `swxtch-info` writes the information of the cloudSwXtch (cloud, fingerprint, licensing, entitlements, configuration) as `--output json` or `--output txt`: ```shell $ swx-cli swxtch support swxtch-info --swxtch 10.0.128.26:9443 --output txt --output-prefix /var/opt/swx/swxtch/infotxt $ sudo ls /var/opt/swx/swxtch/ | grep infotxt infotxt_2026-11-02_16-20-23.txt ``` #### join-code `swx-cli swxtch join-code` runs on the cloudSwXtch host and prints the join code an OMNI captures this cloudSwXtch with (`swxtches add --join-code`, or **Fleet → + Add a swXtch** in wXcked Eye). A captured cloudSwXtch has none: the command then names the OMNI that holds it. ```shell $ swx-cli swxtch join-code swxj_. ``` The join code lets one OMNI take this cloudSwXtch over: treat it like a password. It is used once, and a new one is made when the cloudSwXtch is released. #### pin `swx-cli swxtch pin` runs on the cloudSwXtch host and prints its key pin and the client install commands pinned to it (xNIC for Linux and Windows, swXtchBridge, Kubernetes DaemonSet, each also with an enrol token). The address in the commands is the control IP in the cloudSwXtch's certificate; `--address host:port` (`-a`) gives another one, for example the address clients reach the cloudSwXtch at. See [How identity and trust work](../cloudswxtch/quick-start-guide/how-identity-and-trust-work.md#installing-clients). ```shell $ swx-cli swxtch pin swXtch https://10.0.128.26:9443 key pin: sha256// xNIC (Linux): curl -fsS -k --pinnedpubkey sha256// https://10.0.128.26:9443/swx/services/install/swx-xnic-install.sh | bash -s -- -t 3 ... ``` #### release `swx-cli swxtch release` runs on the cloudSwXtch host and makes the cloudSwXtch drop the OMNI it trusts, keeping the rest of its configuration, so that another OMNI can capture it. Use it when the OMNI that holds the cloudSwXtch is gone; otherwise remove it from that OMNI. The released cloudSwXtch keeps its key and pin, serves a self-signed certificate again, refuses every signed request until an OMNI captures it, and makes a new join code (`swx-cli swxtch join-code`). ### licenses `swx-cli licenses` manages the license bundles that OMNI hands out to the cloudSwXtches. A bundle is a `.dat` file issued by swXtch.io for one OMNI, with a number of seats and an expiry date. It is uploaded to OMNI, and each cloudSwXtch that uses it holds a seat. The `licenses` commands take the OMNI address as `--omni` (`-a`); after signing in it can be left out. ```shell $ swx-cli help licenses Usage: swx-cli help [command [subcommand ...]] swx-cli help list all commands swx-cli help show a command's flags and subcommands swx-cli help drill into a subcommand licenses: License bundle management authorize : Give a swXtch a seat in a license bundle history : Show the licensing audit trail release : Release the seat a swXtch holds in a license bundle remove : Withdraw a license bundle and revoke the swXtches holding its seats reseed : Reseed the licensing sequence above the floor the fleet reports show : Show license bundles and which swXtches hold their seats upload : Upload a license bundle to OMNI ``` | Subcommand | What it does | Options | | --- | --- | --- | | `authorize` | Give a swXtch a seat in a license bundle | `--fingerprint` (`-f`) *(required)* `--license-name` (`-l`) *(required)* | | `history` | Show the licensing audit trail | `--since` (`-s`) | | `release` | Release the seat a swXtch holds in a license bundle | `--fingerprint` (`-f`) *(required)* `--license-name` (`-l`) *(required)* | | `remove` | Withdraw a license bundle and revoke the swXtches holding its seats | `--license-name` (`-l`) *(required)* | | `reseed` | Reseed the licensing sequence above the floor the fleet reports | `--floor` (`-f`) *(required)* | | `show` | Show license bundles and which swXtches hold their seats | — | | `upload` | Upload a license bundle to OMNI | `--file` (`-i`) *(required)* | #### License Bundle Show Two fingerprints are involved: - The **OMNI fingerprint**, shown in the first line of `licenses show`. The bundle is issued for it. It is the ID of the VM that runs OMNI, for example the instance OCID on OCI. - The **cloudSwXtch fingerprint**, shown by `swxtches list` (`fingerprint`). `licenses authorize` and `licenses release` take it. **Example:** Show the license bundles before any bundle is uploaded ```shell $ swx-cli licenses show OMNI fingerprint: ocid1.instance.oc1.iad.anuwcljrmbktktqcajocxcj2zzzflytiaiitsevncxxkyg3rndozj65q5s4q Highest sequence reported by the fleet: 0 Licensing is in bootstrap: No license bundle has been uploaded yet. ``` #### License Bundle Upload Copy the `.dat` file to the shared folder `/var/opt/swx/swxtch` and upload it to OMNI. swx-cli answers with the bundle: its name, seats, expiry date and survival time. **Example:** Upload a license bundle ```shell $ sudo cp fs-swxcli-doc-320fce-1.dat /var/opt/swx/swxtch/ $ swx-cli licenses upload --file /var/opt/swx/swxtch/fs-swxcli-doc-320fce-1.dat Upload: uploaded OMNI fingerprint: ocid1.instance.oc1.iad.anuwcljrmbktktqcajocxcj2zzzflytiaiitsevncxxkyg3rndozj65q5s4q Highest sequence reported by the fleet: 0 fs-swxcli-doc-320fce (ordinal 1, active) seats: 0 of 2 expires: 2026-11-29T23:00:00Z survival: 24h0m0s uploaded: 2026-11-02T15:59:29Z by admin ``` #### License Bundle Authorize `licenses authorize` gives a cloudSwXtch a seat in a bundle. The cloudSwXtch is named by its fingerprint and the bundle by its name. `licenses release` frees the seat. **Example:** Give a cloudSwXtch a seat, then check the bundle and the audit trail ```shell $ swx-cli licenses authorize --fingerprint 13c04aaf-2ee8-4a48-8035-4bad5aec56e8 --license-name fs-swxcli-doc-320fce OMNI fingerprint: ocid1.instance.oc1.iad.anuwcljrmbktktqcajocxcj2zzzflytiaiitsevncxxkyg3rndozj65q5s4q Highest sequence reported by the fleet: 0 fs-swxcli-doc-320fce (ordinal 1, active) seats: 1 of 2 expires: 2026-11-29T23:00:00Z survival: 24h0m0s uploaded: 2026-11-02T15:59:29Z by admin 13c04aaf-2ee8-4a48-8035-4bad5aec56e8 authorized (no report yet) $ swx-cli licenses show OMNI fingerprint: ocid1.instance.oc1.iad.anuwcljrmbktktqcajocxcj2zzzflytiaiitsevncxxkyg3rndozj65q5s4q Highest sequence reported by the fleet: 1 fs-swxcli-doc-320fce (ordinal 1, active) seats: 1 of 2 expires: 2026-11-29T23:00:00Z survival: 24h0m0s uploaded: 2026-11-02T15:59:29Z by admin 13c04aaf-2ee8-4a48-8035-4bad5aec56e8 authorized lease held, renewed at sequence 1 $ swx-cli licenses history --since 1h 2026-11-02T15:59:29Z bundle-uploaded fs-swxcli-doc-320fce by admin — ordinal 1, 2 seats 2026-11-02T15:59:43Z swxtch-authorized fs-swxcli-doc-320fce / 13c04aaf-2ee8-4a48-8035-4bad5aec56e8 by admin ``` > [!NOTE] > **PLEASE NOTE** > > A cloudSwXtch that also has a license file (`/var/opt/swx/swxtch/license.json`) keeps reporting `"type": "License File"` in `swxtches list` after it gets a seat. > > Use `licenses reseed` only when swXtch.io support asks for it. ### auth Besides signing in (see [Signing in](#signing-in)), `swx-cli auth` manages the users and the API keys of the deployment. ```shell $ swx-cli help auth Usage: swx-cli help [command [subcommand ...]] swx-cli help list all commands swx-cli help show a command's flags and subcommands swx-cli help drill into a subcommand auth: Auth management tool (users and API keys) block-user : Block a user change-password : Change user password create-key : Create a new API key create-user : Create a new user delete-key : Delete an API key by storage ID (from list-keys output) delete-user : Delete a user init : Initialize security (create initial admin user) list-key : List all API keys list-user : List all users login : Save credentials for a host (prompts for API key) logout : Remove saved credentials for a profile status : Show current auth status (profile, host, user) unblock-user : Unblock a user ``` | Subcommand | What it does | Options | | --- | --- | --- | | `block-user` | Block a user | `--username` (`-u`) *(required)* | | `change-password` | Change user password | `--password` (`-p`) *(required)* `--username` (`-u`) *(required)* `--old-password` | | `create-key` | Create a new API key | `--display-name` (`-d`) *(required)* `--role` (`-r`) *(required)* `--username` (`-u`) *(required)* `--expires-at` (`-e`) | | `create-user` | Create a new user | `--display-name` (`-d`) *(required)* `--password` (`-p`) *(required)* `--role` (`-r`) *(required)* `--username` (`-u`) *(required)* | | `delete-key` | Delete an API key by storage ID (from list-keys output) | `--id` (`-i`) *(required)* | | `delete-user` | Delete a user | `--username` (`-u`) *(required)* | | `init` | Initialize security (create initial admin user) | `--username` (`-u`) *(required)* `--password` (`-p`) | | `list-key` | List all API keys | — | | `list-user` | List all users | — | | `unblock-user` | Unblock a user | `--username` (`-u`) *(required)* | The roles are `reader`, `writer` and `admin`. An API key belongs to a user, has its own role and can have an expiry date (`--expires-at`, RFC 3339). `auth init` creates the first administrator of a deployment and is only needed when the installer did not create one (for example, after an install with `--no-bootstrap`). OMNI accepts it only from its own host: run it on the OMNI host against `localhost` or `127.0.0.1`, for example `swx-cli auth init -h localhost:8443 -u admin`. swx-cli runs inside the `swx-swxtch` container, so on a host that runs only OMNI use curl instead: `curl -sk -X POST -H 'Content-Type: application/json' -d '{"username":"admin","roleCode":"admin","clearTextPassword":""}' https://localhost:8443/swx/auth/initAuth` (the answer holds the admin API key). From any other address it answers *Security can only be initialized from the OMNI host*. An administrator can change any user's password with `change-password`. Any other user can change only their own, and must give the current one with `--old-password`. Changing a password ends the user's other password sessions and refresh tokens. Failed password logins never lock a user out: a wrong password reads `Invalid credentials`, however many times it is tried. Only an administrator blocks a user (`unblock-user` lifts it). **Example:** List the users ```shell $ swx-cli auth list-user [ { "username": "admin", "displayName": "Installer created administrator", "role": { "code": "admin", "displayName": "Administrator" }, "blocked": false } ] ``` For example, to create a read-only user and an API key for it that expires at the end of the year: ```shell swx-cli auth create-user --username monitor --display-name "Monitoring" --role reader --password swx-cli auth create-key --username monitor --display-name "Monitoring key" --role reader --expires-at 2026-12-31T23:59:59Z ``` ### cert `swx-cli cert` shows the TLS certificates used by OMNI and the cloudSwXtches, installs a certificate of your own on OMNI, adds trusted CAs, and rotates OMNI's CA. The certificates of the cloudSwXtches are issued and renewed by OMNI's CA on their own; see [Certificates](../cloudswxtch/using-wxcked-eye/system-management/certificates.md). ```shell $ swx-cli help cert Usage: swx-cli help [command [subcommand ...]] swx-cli help list all commands swx-cli help show a command's flags and subcommands swx-cli help drill into a subcommand cert: Certificate management ca-rotation : Rotate OMNI's CA one step at a time: start (the new CA joins every swXtch's trust), reissue (it issues every certificate again), finish (the old CA is dropped); status shows where it stands certificates : List current certificates state across all nodes generate-server : Generate a server certificate signed by a CA pin : Print the key pin (sha256//...) of a certificate; default: the OMNI installed here push-trusted-cert : Add a CA certificate to the trust bundle of OMNI and every swXtch it manages rotate : Replace the certificate OMNI serves on its own port (the one browsers use); its CA first joins the trust bundle of every managed swXtch ``` | Subcommand | What it does | Options | | --- | --- | --- | | `ca-rotation` | Rotate OMNI's CA one step at a time | `--action` (`-a`): `status` (default), `start`, `reissue` or `finish`; `--force` (`-f`) | | `certificates` | List current certificates state across all nodes | — | | `generate-server` | Generate a server certificate signed by a CA | `--output` (`-o`) *(required)* `--sans` (`-s`) *(required)* `--ca-cert` (`-c`) `--ca-key` (`-k`) `--validity-days` (`-v`) | | `pin` | Print the key pin of a certificate; default: the OMNI installed here | `--cert` (`-c`) | | `push-trusted-cert` | Add a CA certificate to the trust bundle of OMNI and every swXtch it manages | `--cert` (`-c`) *(required)* | | `rotate` | Replace the certificate OMNI serves on its own port (the one browsers use) | `--cert` (`-c`) *(required)* `--key` (`-k`) *(required)* `--selected` (`-s`) *(required)* | What each one does: - `rotate` installs a certificate of your own on **OMNI** (port 8443), the one browsers use. `--selected` must name OMNI only, as `cert certificates` lists it (for example `https://10.0.0.4:8443`); any other address is refused, since a cloudSwXtch's port 9443 always serves the certificate OMNI's CA issued. Before OMNI serves the new certificate, the last certificate of the `--cert` file (its CA, or the certificate itself when it is self-signed) joins the trust bundle of every cloudSwXtch; if a cloudSwXtch does not take it, nothing is rotated. - `push-trusted-cert` adds each certificate of the file, a CA, to the trust bundle that OMNI and every cloudSwXtch trust, and that clients fetch. The bundle is the same for the whole fleet, so there is nothing to select. A cloudSwXtch that does not take it now gets it on a later hourly retry. - `pin` prints the pin `auth login` asks to confirm. Run it on the OMNI host. - `ca-rotation` replaces OMNI's CA in three steps; see [Rotate OMNI's CA](../cloudswxtch/using-wxcked-eye/system-management/certificates.md#rotate-omnis-ca). Each step is refused until the fleet caught up with the one before, and `status` lists what it waits for. `--force` makes `reissue` go ahead although some recently seen clients have not reported the new CA yet. `cert certificates` lists, for OMNI and for each cloudSwXtch, the certificate it serves (`serverCertificate`: common name, fingerprint, DNS names and IP addresses, validity) and the certificates it trusts (`trustedCertificates`). A captured cloudSwXtch serves a certificate issued by OMNI's CA, and trusts OMNI's CA plus any CA added with `push-trusted-cert` or `rotate`. > [!WARNING] > **PLEASE NOTE** > > `cert rotate` changes the certificate browsers and swx-cli see on OMNI: a swx-cli or swx-top that trusted OMNI by its key asks to confirm the new key at the next `auth login`. `cert push-trusted-cert` and `cert rotate` add a CA that every cloudSwXtch and client then trusts. Plan the change and keep the previous certificate and key at hand. ### xnic `swx-cli xnic ha inspect` shows how one xNIC rebuilds one HA destination: the state of each source and its delay histogram. | Option | Type | Description | | --- | --- | --- | | `--destination` (`-d`) | string | **Required.** Multicast destination, ip:port | | `--swxtch` (`-s`) | string | **Required.** Control address and port of the cloudSwXtch, for example `10.0.0.4:9443` | | `--xnic` (`-x`) | string | **Required.** xNIC component id, as the topology reports it | ```shell swx-cli xnic ha inspect --swxtch 10.0.0.4:9443 --xnic --destination 239.1.1.1:10000 ``` In this subcommand the OMNI address is `-H` (`--host`). ### registry `swx-cli registry htpasswd ` prints an htpasswd entry (bcrypt) for a private xNIC image registry. It reads the password from the standard input: ```shell echo -n '' | swx-cli registry htpasswd ``` ### version `swx-cli version` shows the version of swx-cli, which is the version of the cloudSwXtch it is installed on. **Example:** Get the current version ```shell $ swx-cli version {"Version":"dev.320fce","Commit":"320fceeb6f25ffc05569529db385d9cc7cf4ced9","Date":"20261030.195416"} ```