A generator for Go-based Alfred workflows (compatible with Alfred 6 and Alfred UI / .alfredui) that helps you create boilerplate code, CI/CD pipelines, and development Makefiles.
As a Gopher, i want to create a Golang base workflow quickly than sketching it out by hand. I also want to be able to share my way of doing things with others.
- Create a new workflow with three type of patterns:
- Simple workflow with Alfred variables and arguments
- leverage deanishe/awgo with Alfred items feedback
- leverage deanishe/awgo and spf13/cobra with Alfred items feedback
- Workflow development
- Build the workflow executable and output it into the
.workflowsubdirectory - Display information about the workflow
- Link the
.workflowsubdirectory into Alfred's preferences directory, installing it. - Package the workflow for distribution locally
- Unlink the
.workflowsubdirectory from Alfred's preferences directory, uninstalling it.
- Build the workflow executable and output it into the
- Additional patterns (Alfred 6 &
.alfreduicompatible)- Add GitHub Actions (
ci.yml&release.yml) to project — auto-detects Go / Python stack, lintsinfo.plistand*.alfredui/ui.json, packagesarm64&amd64.alfredworkflowarchives with SHA-256 checksums and release notes (-sto enable macOS code sign and notarize) - Add license to project
- Add Alfred 6 compatible
Makefileto project (lint,test,build-local,dev,pack-local,reload,release,push, etc.)
- Add GitHub Actions (
- Compatible with Alfred 6 & Alfred UI (
*.alfreduivalidation, script permissions, and workflow reload) - Support
arm64&amd64
With Go 1.20 or higher:
go install github.com/cage1016/ak@latestA generator for awgo that helps you create boilerplate code
Usage:
ak [flags]
ak [command]
Available Commands:
add Used to add additional component to project
alfred Used to manage Go-based Alfred workflows
completion Generate the autocompletion script for the specified shell
help Help about any command
init Initiates a workflow
new Used to create workflow package
Flags:
-d, --debug If you want to se the debug logs.
--folder string If you want to specify the base folder of the workflow.
-f, --force Force overwrite existing files without asking.
-h, --help help for ak
--testing If testing the generator.
-v, --version version for ak
Use "ak [command] --help" for more information about a command.-
ak initto create a new workflow -
revise
ak.jsonas your workflow's information (license.yeardefaults to the current year){ "go_mod_package": "github.com/xxx/ak-test", "workflow": { "folder": ".workflow", "name": "Ak Test", "description": "", "category_comment": "category: Tools, Internet, Productivity, Uncategorised", "category": "", "bundle_id": "com.xxx.aktest", "created_by": "", "web_address": "https://github.com/xxx/ak-test", "version": "0.1.0" }, "update": { "github_repo": "https://github.com/xxx/ak-test" }, "license": { "type_comment": "support license https://github.com/nishanths/license", "type": "mit", "year": "2026", "name": "" }, "gon": { "application_identity": "Developer ID Application: KAI CHU CHUNG" } } -
Create a workflow pattern
ak new cmdcreate cobra based workflow
-
Add additional components to the workflow
ak add githubAction(aliasga) add GitHub Actions (ci.yml&release.yml) to project-sto enable macOS code sign and notarize
ak add license(aliasl) add license to projectak add makefile(aliasmf) add Alfred 6 compatibleMakefileto project
-
Workflow development (via generated
Makefile)make lintto lint Go code,info.plist, and Alfred 6 UI bundle (*.alfredui)make testto run Go unit testsmake build-localto build a lean Apple Silicon (arm64) binary into.workflow/exemake buildto build a universal binary viaak alfred buildmake devto rebuild the localarm64binary and reload the workflow in Alfred 6make reloadto reload the workflow in Alfred 6make pack-localto lint, buildarm64binary, and pack a clean.alfredworkflowarchivemake infoto display information about the workflowmake link/make unlinkto link or unlink.workflowin Alfred's preferences directorymake release TAG=0.2.0/make push [TAG=0.2.0]to lint, test, tag, and push a release to trigger GitHub Actions
This project is licensed under the MIT License. See LICENSE for details.