onyx
Cross-platform Rust toolkit for building desktop applications without rewriting OS-specific glue every time. Sister crate to akira-io/onyx (Go), with a mirrored module surface so a team can split a desktop app between a Rust core and Go services and reach for the same primitives on both sides.
Full reference:
docs/00-index.md- one file per module, mirrored with the Go crate's documentation tree.
Why
// Without onyx
if cfg!
if cfg!
if cfg!
// With onyx
let config = for_app.config?;
Same behaviour on macOS, Linux, and Windows. No cfg!(target_os = ...) switches, no hand-rolled XDG logic, no per-OS shell invocations leaked into application code.
Install
[]
= "0.1"
Then in your code:
use ;
Requires Rust 1.75 or later.
Quickstart
use ;
Modules
| Module | Purpose |
|---|---|
| paths | Configuration, data, cache, and log directories per platform. |
| files | Open paths and URLs, reveal in file manager. |
| shell | Resolve CLI binaries via PATH lookup with explicit fallback paths. |
| clipboard | Read and write the system clipboard as plain text. |
| notify | Show desktop notifications. |
| keyring | Store, retrieve, and delete secrets in the system credential store. |
| osinfo | Typed runtime platform detection. |
Documentation
The full reference lives in docs/:
- docs/00-overview.md — what onyx is and is not.
- docs/01-conventions.md — naming, function design, documentation rules every module follows.
- docs/02-architecture.md — module layout and the SOLID/DRY/KISS principles that drive it.
- docs/modules/ — per-module reference.
Platforms
| OS | Status |
|---|---|
| macOS | Fully tested by the maintainer. Primary development target. |
| Linux | Compiled and unit-tested in CI. Not exercised against real desktop environments by the maintainer. |
| Windows | Compiled and unit-tested in CI. Not exercised against real desktop environments by the maintainer. |
CI runs on all three platforms, but a green pipeline only proves the code compiles and the platform-agnostic tests pass. The Linux and Windows backends (notification daemons, clipboard helpers, credential managers, file managers) are not verified end-to-end against live systems by the maintainer. Report issues with reproduction steps and we will work through them.
Testing
Run cargo fmt --all and cargo clippy --all-targets -- -D warnings before opening a PR. The full suite runs on macOS, Linux, and Windows in CI. Tests that exercise OS facilities (notifications, clipboard, keychain) bail out cleanly when no backend is reachable, so the suite stays green even on minimal CI images.
Contributing
Pull requests welcome. Before opening one:
- Read docs/01-conventions.md. PRs that break the conventions get rejected without further review.
- Read docs/02-architecture.md for the rules that govern where new code goes.
- Add tests for every public change. Touch CHANGELOG.md under
## [Unreleased]. - Use conventional commits (
feat:,fix:,refactor:,docs:,chore:). The changelog workflow groups bullets by prefix.
For Go consumers, see the sister module akira-io/onyx.
Prior art
onyx is a study project. These crates solve overlapping problems and have more battle-test. If you want a dependency you can lean on, reach for them first:
- Paths:
dirs,directories. - Clipboard:
arboard. - Notifications:
notify-rust. - Keyring:
keyring. - Binary resolution:
which.
License
MIT. See LICENSE.