Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A generator for golang alfred workflow that helps you create boilerplate code.

License

NotificationsYou must be signed in to change notification settings

cage1016/ak

Repository files navigation

GitHub

A generator for golang Alfred workflow that helps you create boilerplate code.

Why ?

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.

Features

  1. Create a new workflow with three type of patterns:
    1. Simple workflow with Alfred variables and arguments
    2. leveragedeanishe/awgo with Alfred items feedback
    3. leveragedeanishe/awgo andspf13/cobra with Alfred items feedback
  2. Workflow development
    1. Build the workflow executable and output it into the.workflow subdirectory
    2. Display information about the workflow
    3. Link the.workflow subdirectory into Alfred's preferences directory, installing it.
    4. Package the workflow for distribution locally
    5. Unlink the.workflow subdirectory from Alfred's preferences directory, uninstalling it.
  3. Additional patterns
    1. Add Github Action release to project.-s enable code sign and notarize
    2. Add license to project
    3. Add Makefile to project
  4. Supportarm64 &amd64

Installation

With Go 1.20 or higher:

go install github.com/cage1016/ak@latest

Running the generator

A generatorfor awgo that helps you create boilerplate codeUsage:  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 scriptfor the specified shellhelp        Help about anycommand  init        Initiates a workflow  new         Used to create workflow packageFlags:  -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, --helphelpfor ak      --testing         If testing the generator.  -v, --version         versionfor akUse"ak [command] --help"for more information about a command.
  1. ak init to create a new workflow

  2. reviseak.json as 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"    }}
  3. Create one of three different workflow patterns

    1. ak new cmd create cobra based workflow
  4. Add additional components to the workflow

    1. ak add githubAction add Github Action release to project
      1. -s to enable code sign and notarize
    2. ak add license add license to project
    3. ak add makefile add Makefile to project
  5. Workflow development

    1. make build to build the workflow executable and output it into the.workflow subdirectory
    2. make info to display information about the workflow
    3. make link to link the.workflow subdirectory into Alfred's preferences directory, installing it.
    4. make package to package the workflow for distribution locally
    5. make unlink to unlink the.workflow subdirectory from Alfred's preferences directory, uninstalling it.

Examples

  1. ak/_example

License

This project is licensed under the MIT License. SeeLICENSE for details.


[8]ページ先頭

©2009-2025 Movatter.jp