API Reference
Complete API documentation for Fern Shell.
Rust API (fernctl)
The fernctl crate provides the Rust backend for configuration management and system integration.
Quick Links
- Full API Reference - Complete rustdoc
Key Modules
| Module | Description |
|---|---|
| domain | Pure business logic - themes, tokens, config |
| ports | Hexagonal architecture interfaces |
| adapters | Concrete implementations |
| commands | CLI command handlers |
| error | Error types with diagnostics |
Domain Types
#![allow(unused)] fn main() { // Theme composition use fernctl::domain::Theme; // Design tokens use fernctl::domain::tokens::{ColorToken, SpacingToken, RadiusToken}; // User configuration use fernctl::domain::UserConfig; }
Port Traits
#![allow(unused)] fn main() { // Inbound (what the domain accepts) use fernctl::ports::inbound::{ConfigPort, QueryPort, ValidatePort}; // Outbound (what the domain needs) use fernctl::ports::outbound::{PersistPort, NotifyPort, IpcPort}; }
Adapter Implementations
#![allow(unused)] fn main() { // TOML configuration use fernctl::adapters::TomlConfigAdapter; // JSON serialization use fernctl::adapters::JsonThemeAdapter; // File system use fernctl::adapters::FileSystemPersist; }
QML API
QML components don't have generated documentation. See the QML Components section for manual documentation.
Key Singletons
| Singleton | Import | Purpose |
|---|---|---|
Theme | "../config" as Config | Design tokens |
Hyprland | "../services" as Services | Hyprland IPC |
Common Patterns
// Access theme tokens
Config.Theme.accent
Config.Theme.barWidth
Config.Theme.spacing.md
// Access Hyprland state
Services.Hyprland.activeWsId
Services.Hyprland.workspaces
CLI Reference
fernctl --help
| Command | Description |
|---|---|
validate | Check config file for errors |
convert | Convert between formats |
query | Query config values |
watch | Watch for config changes |
See fernctl <command> --help for detailed usage.