/alfred-json-rust

Helpers for writing script filters and JSON configs of Alfred>=5.

Primary LanguageRust

alfred-json

Introduction

Heavily inspired by lilyball/alfred-rs, this crate defines helpers for writing script filters and JSON configs of Alfred(>=5).

Optional features

  • fzf: enable fuzzy item filtering by calling locally installed fzf.

Example usage

use alfred_json::{ItemBuilder, ScriptFilterOutputBuilder, IntoJson};
fn main() {
    let output = ScriptFilterOutputBuilder::from_items([
        ItemBuilder::new("Item 1").subtitle("subtitle").into_item(),
        ItemBuilder::new("Item 2").valid(false).into_item(),
    ]).into_output();
    print!("{}", output.into_json());
}