A generator for golang Alfred workflow that helps you create boilerplate code.
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
- Add Github Action release to project.
-senable code sign and notarize - Add license to project
- Add Makefile to project
- Add Github Action release to project.
- 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{ "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": "", "name": "" }, "gon": { "application_identity": "Developer ID Application: KAI CHU CHUNG" } } -
Create one of three different workflow patterns
ak new cmdcreate cobra based workflow
-
Add additional components to the workflow
ak add githubActionadd Github Action release to project-sto enable code sign and notarize
ak add licenseadd license to projectak add makefileadd Makefile to project
-
Workflow development
make buildto build the workflow executable and output it into the.workflowsubdirectorymake infoto display information about the workflowmake linkto link the.workflowsubdirectory into Alfred's preferences directory, installing it.make packageto package the workflow for distribution locallymake unlinkto unlink the.workflowsubdirectory from Alfred's preferences directory, uninstalling it.
This project is licensed under the MIT License. See LICENSE for details.