{"id":17540027,"url":"https://github.com/benchr267/goalfred","last_synced_at":"2025-10-04T07:20:25.430Z","repository":{"id":57600007,"uuid":"67724859","full_name":"BenchR267/goalfred","owner":"BenchR267","description":"Go package to simplify writing Alfred workflows","archived":false,"fork":false,"pushed_at":"2017-02-16T08:48:43.000Z","size":76,"stargazers_count":8,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-23T22:28:31.067Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BenchR267.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-08T17:24:18.000Z","updated_at":"2025-02-23T12:32:29.000Z","dependencies_parsed_at":"2022-09-16T19:00:37.712Z","dependency_job_id":null,"html_url":"https://github.com/BenchR267/goalfred","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/BenchR267/goalfred","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenchR267%2Fgoalfred","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenchR267%2Fgoalfred/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenchR267%2Fgoalfred/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenchR267%2Fgoalfred/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BenchR267","download_url":"https://codeload.github.com/BenchR267/goalfred/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenchR267%2Fgoalfred/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266296812,"owners_count":23907014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-20T22:07:41.274Z","updated_at":"2025-10-04T07:20:20.382Z","avatar_url":"https://github.com/BenchR267.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# goalfred #\n\ngoalfred is a helper package to create workflows for Alfredapp.\n\n[![GoDoc](https://godoc.org/github.com/BenchR267/goalfred?status.svg)](https://godoc.org/github.com/BenchR267/goalfred)  [![Build Status](https://travis-ci.org/BenchR267/goalfred.svg?branch=master)](https://travis-ci.org/BenchR267/goalfred) [![Coverage Status](https://coveralls.io/repos/github/BenchR267/goalfred/badge.svg?branch=master)](https://coveralls.io/github/BenchR267/goalfred?branch=master)\n\n## Get ##\n\n```bash\ngo get -u github.com/BenchR267/goalfred/...\n```\n\n## Usage ##\n\n```go\nimport \"github.com/BenchR267/goalfred\"\n```\n\nConstruct your data like you want it to appear in the script filter output.\nYou can then either use the given Item struct to add elements to the output or provide your custom types:\n\nUsing Item:\n```go\nfunc main() {\n\n\tdefer goalfred.Print()\n\n\titem := goalfred.Item {\n\t\t\tTitle: \"aTitle\",\n\t\t\tSubtitle: \"aSubtitle\",\n\t\t\tArg: \"https://www.example.com\",\n\t}\n\titem.Mod.Alt = \u0026goalfred.ModContent {\n\t\t\tArg: \"https://www.google.de\",\n\t\t\tSubtitle: \"Open Google!\",\n  }\n\n\tgoalfred.Add(item)\n}\n```\n\nUsing a custom type like Link:\n```go\ntype Link struct {\n\tName  string\n\tLink1 string\n\tLink2 string\n}\n\nfunc (l Link) Item() goalfred.Item {\n\titem := goalfred.Item {\n\t\t\tTitle: l.Name,\n\t\t\tArg: l.Link1,\n\t}\n\n\titem.Mod.Cmd = \u0026goalfred.ModContent {\n\t\t\tArg: l.Link2,\n\t\t\tSubtitle: \"Something special!\",\n  }\n\treturn item\n}\n\nfunc main() {\n\n\tdefer goalfred.Print()\n\n\tlink := Link{\n\t\tName: \"Google\",\n\t\tLink1: \"https://www.google.com\",\n\t\tLink2: \"https://www.google.de/search?q=hello+world\",\n\t}\n\n\tgoalfred.Add(link)\n}\n```\n\n# Customization\n\nEach Item has many properties, most of them are optional. To get more information about them, take a look at the [official documentation](https://www.alfredapp.com/help/workflows/inputs/script-filter/json/) at Alfred.\n\n# Complex Arguments\n\nSometimes it's necessary to output more than one parameter by the workflow. For example if you want to schedule a notification like [alfred_dvb](https://github.com/kiliankoe/alfred_dvb) does. If an entry was selected there are multiple informations that should be outhanded. The first one is the time after which the notification should be triggered and the second one is the text for the notification. You could add a script that splits a given string into pieces, but with goalfred you can also add complex arguments that contain a query AND parameters.\nYou can achieve this by doing the following:\n\n```Go\nitem := goalfred.Item{\n\tTitle: \"a title\",\n\tSubtitle: \"a subtitle\",\n}\nitem.SetComplexArg(goalfred.ComplexArg{\n\tArg: \"A nice query that can be used as {query} in Alfred actions\",\n\tVariables: map[string]interface{}{\n\t\t\"time\": 5,\n\t\t\"output\": \"this text will replace {var:output} in Alfred actions!\",\n\t},\n})\n```\n\nAs you can already see in the code, you can specify variables as well. You can use then the variables value by writing {var:VARIABLENAME} in an Alfred action. Very handy!\n\n# Workflow variables\n\nAlfred added a new functionality in 3.2 which makes it possible to add variables to your script filter. To do this just set the variables via your Go script filter:\n\n```Go\nSetVariable(\"aKey1\", 5)\nSetVariable(\"aKey2\", \"aValue\")\n```\n\nThe variables are then exposed as environment variables to your following scripts.\n\n# Rerun\n\nSometimes you want to rerun your workflow after a given amount of time. Set this value with \n\n```Go\nRerun(2)\n```\n\nbefore printing your output to Alfred. This will then rerun the workflow after the given amount of seconds.\n\n## CLI Tool ##\n\nWARNING: Still in Alpha status!\n\ngoalfred also comes with a great cli tool to automate releases of your workflow. To install the tool, type in your terminal\n\n```Bash\ngo get github.com/BenchR267/goalfred/...\n```\n\nand run it by calling\n\n```Bash\n$GOPATH/bin/goalfred release -v 1.0.0 DIRECTORY_PATH\n```\n\nwith DIRECTORY_PATH replaced by the directory your files are located. Possible options are also `-i` and `-g`. \n\n`-i` or `--infoplist` stands for bumping the version to the argument you specify at the `-v` option.\n`-g` or `--git` creates also a git tag and pushes that to your origin git remote.\n\n## License ##\n\nThis library is distributed under the MIT-style license found in the [LICENSE](./LICENSE)\nfile.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenchr267%2Fgoalfred","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenchr267%2Fgoalfred","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenchr267%2Fgoalfred/lists"}