alfrednize is a so simple command to generate JSON for Alfred.
Use with standard input. alfrednize
converts multiline strings to JSON with Alfred Script Filter JSON Format.
$ echo -e 'foo\nbar\nbaz' | alfrednize | jq
{
"items": [
{
"uid": "foo",
"title": "foo",
"subtitle": "",
"arg": "foo",
"match": "foo",
"autocomplete": "foo"
},
{
"uid": "bar",
"title": "bar",
"subtitle": "",
"arg": "bar",
"match": "bar",
"autocomplete": "bar"
},
{
"uid": "baz",
"title": "baz",
"subtitle": "",
"arg": "baz",
"match": "baz",
"autocomplete": "baz"
}
]
}
Use with Script Filter in Alfred as follows.
$ brew install chroju/tap/alfrednize
Download the latest binary from here and place it in the some directory specified by $PATH
.
If you have set up Go environment, you can also install alfrednize
with go get
command.
$ go get github.com/chroju/alfrednize