{"id":49549459,"url":"https://github.com/reality2-roycdavies/clevetura-cli","last_synced_at":"2026-05-02T21:30:57.581Z","repository":{"id":354049317,"uuid":"1221931913","full_name":"reality2-roycdavies/clevetura-cli","owner":"reality2-roycdavies","description":"Headless CLI for the Clevetura CLVX-S keyboard (USB HID + BLE protobuf, JSON output)","archived":false,"fork":false,"pushed_at":"2026-04-26T21:36:00.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-26T23:24:21.940Z","etag":null,"topics":["bluetooth","clevetura","cli","hid","keyboard","protobuf","rust","touchpad"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reality2-roycdavies.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-26T21:30:18.000Z","updated_at":"2026-04-26T21:36:04.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/reality2-roycdavies/clevetura-cli","commit_stats":null,"previous_names":["reality2-roycdavies/clevetura-cli"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/reality2-roycdavies/clevetura-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reality2-roycdavies%2Fclevetura-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reality2-roycdavies%2Fclevetura-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reality2-roycdavies%2Fclevetura-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reality2-roycdavies%2Fclevetura-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reality2-roycdavies","download_url":"https://codeload.github.com/reality2-roycdavies/clevetura-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reality2-roycdavies%2Fclevetura-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32550787,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T19:18:06.202Z","status":"ssl_error","status_checked_at":"2026-05-02T19:16:21.335Z","response_time":132,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bluetooth","clevetura","cli","hid","keyboard","protobuf","rust","touchpad"],"created_at":"2026-05-02T21:30:54.306Z","updated_at":"2026-05-02T21:30:57.576Z","avatar_url":"https://github.com/reality2-roycdavies.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clevetura-cli\n\nHeadless command-line tool for the [Clevetura CLVX-S](https://clevetura.com/) \"TouchOnKeys\" keyboard. Talks to the keyboard over USB-HID and Bluetooth Low Energy using its native protobuf-based protocol, and exposes everything as JSON-on-stdout for integration with desktop applets.\n\nThis is the shared backend for:\n\n| Frontend | Desktop |\n|----------|---------|\n| **[cosmic-clevetura](https://github.com/reality2-roycdavies/cosmic-clevetura)** | COSMIC (Pop!_OS) |\n| **[kde-clevetura](https://github.com/reality2-roycdavies/kde-clevetura)** | KDE Plasma 6 |\n\nEach frontend is a thin UI that shells out to `clevetura-cli`. Hardware-comms code lives here, exactly once.\n\n## What it does\n\n- Detects connected Clevetura keyboards via USB-HID and Bluetooth LE\n- Reads/writes firmware settings (sensitivity, gestures, key behaviour, sliders) via protobuf\n- Persists user preferences in `~/.config/clevetura/config.json`\n- Prints structured JSON for every primary command\n\n## Installation\n\nRequires a Rust toolchain and the system libraries used by `hidapi`/`btleplug`:\n\n```bash\n# Debian/Ubuntu/Pop!_OS\nsudo apt install libudev-dev libdbus-1-dev pkg-config build-essential\n\n# Fedora\nsudo dnf install systemd-devel dbus-devel gcc\n\n# Arch\nsudo pacman -S systemd dbus base-devel\n```\n\nThen:\n\n```bash\ngit clone https://github.com/reality2-roycdavies/clevetura-cli.git\ncd clevetura-cli\n\n./install.sh install              # builds release, installs to ~/.local/bin\nsudo ./install.sh install-udev    # allows unprivileged HID access (recommended)\n```\n\nAfter the udev rule is installed, replug the keyboard.\n\n## Usage\n\n```bash\nclevetura-cli help                       # list all commands\nclevetura-cli status                     # JSON: connection, battery, FW, sensitivity\nclevetura-cli detect                     # JSON: enumerate USB-HID Clevetura devices\nclevetura-cli get-config                 # JSON: stored config\nclevetura-cli describe-config            # JSON: settings UI schema (used by hubs)\nclevetura-cli set-config \u003ckey\u003e \u003cjsonval\u003e # update one config field; saves to disk\nclevetura-cli reset-config               # reset config to defaults\nclevetura-cli apply-config               # send full config to firmware via protobuf\nclevetura-cli sync-from-firmware         # pull firmware settings into config\nclevetura-cli get-firmware-settings      # raw firmware settings as JSON\nclevetura-cli set-sensitivity \u003c1-9\u003e      # one-shot sensitivity change\nclevetura-cli ai-on | ai-off | ai-state  # control AI touch processing\nclevetura-cli factory-reset\nclevetura-cli set-os-mode \u003c0|1|2\u003e        # 0=Win, 1=mac, 2=Linux\nclevetura-cli ble-scan [--timeout=N]     # discover Clevetura BLE devices\nclevetura-cli ble-info \u003caddress\u003e         # device info via BLE\n```\n\nDebug commands print human-readable text instead of JSON:\n\n```bash\nclevetura-cli info     # detailed device dump\nclevetura-cli probe    # enumerate HID feature reports\nclevetura-cli watch    # watch report 0xDB for changes\n```\n\n## JSON conventions\n\nEach primary subcommand prints exactly one JSON object on stdout, on a single line:\n\n- **Success:** the relevant payload (e.g. `{\"connected\": true, \"battery\": 85, ...}`)\n- **`set-*`/`reset-*`/`apply-*`:** `{\"ok\": true, \"message\": \"...\"}`\n- **Failure:** `{\"ok\": false, \"error\": \"...\"}` with non-zero exit code\n\nThis makes the output trivially parseable from a shell, a Plasma plasmoid (`Plasma5Support.DataSource` + `JSON.parse`), or a libcosmic widget (`serde_json::from_str`).\n\n## Protocol summary\n\nClevetura keyboards speak two layers:\n\n- **Layer 1 (firmware commands):** request/response over HID report 0x21 / 0x22 — auth, battery, FW version, etc.\n- **Layer 2 (app protocol):** protobuf messages base64-encoded over HID report 0x23 / 0x24 (USB) or over a single GATT characteristic with CRC32 framing (BLE).\n\nSee [`src/proto.rs`](src/proto.rs) for the full protobuf message definitions, reverse-engineered from the official TouchOnKeys app.\n\n## Config file\n\n`~/.config/clevetura/config.json` — JSON, pretty-printed. On first run, contents migrate from the older `~/.config/cosmic-clevetura/config.json` if present.\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n\n## Acknowledgments\n\n- [Clevetura](https://clevetura.com/) for the keyboard hardware\n- The TouchOnKeys app for documenting the protocol on the wire (reverse-engineered)\n- [hidapi-rs](https://github.com/ruabmbua/hidapi-rs), [btleplug](https://github.com/deviceplug/btleplug), [prost](https://github.com/tokio-rs/prost) — Rust ecosystem dependencies\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freality2-roycdavies%2Fclevetura-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freality2-roycdavies%2Fclevetura-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freality2-roycdavies%2Fclevetura-cli/lists"}