Shard Detail

alfred v0.1.0

🎩 Create Alfred workflows in Crystal with ease
alfred-workflow alfred

Install & Use

Add the following code to your project's shard.yml under:

dependencies to use in production
- OR -
development_dependencies to use in development


alfred:
  github: kiliankoe/alfred.cr

Readme

🎩 alfred.cr

Create Alfred Workflows in Crystal with ease.

Installation

Add this to your application's shard.yml:

dependencies:
  alfred:
    github: kiliankoe/alfred.cr

Prerequisites

You need Alfred 3 with the paid Powerpack upgrade.

Usage

Here's a quick and dirty example, more documentation will be added soon 😛

require "alfred"

item = Alfred::Item.new do |i|
  i.title = "An awesome title"
  i.subtitle = "An awesome subtitle"
  i.arg = "argument"

  mod = Alfred::Mod.new do |m|
    m.arg = "mod arg cmd"
    m.subtitle = "some other subtitle"
  end

  i.add_mod Alfred::ModKey::CMD.to_s, mod
end

Alfred.output item

# => {"items":[{"title":"An awesome title","subtitle":"An awesome subtitle","arg":"argument","mods":{"cmd":{"valid":true,"arg":"mod arg cmd","subtitle":"some other subtitle"}}}]}

Contributing

  1. Fork it ( https://github.com/kiliankoe/alfred.cr/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Users

Alfred workflows using alfred.cr

  • yours, maybe? 🙃

Contributors

  • kiliankoe Kilian Koeltzsch - creator, maintainer

Thanks

Shoutout goes to BenchR267 with whom I explored much of Alfred's quirks (goalfred came out of that 😊) and alfy, from which I shamelessly stole (as in imitation is the sincerest form of flattery) the basic API.