Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

API Reference

Complete API documentation for Fern Shell.

Rust API (fernctl)

The fernctl crate provides the Rust backend for configuration management and system integration.

Key Modules

ModuleDescription
domainPure business logic - themes, tokens, config
portsHexagonal architecture interfaces
adaptersConcrete implementations
commandsCLI command handlers
errorError 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

SingletonImportPurpose
Theme"../config" as ConfigDesign tokens
Hyprland"../services" as ServicesHyprland 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
CommandDescription
validateCheck config file for errors
convertConvert between formats
queryQuery config values
watchWatch for config changes

See fernctl <command> --help for detailed usage.