This repo provides the fastest way to make a plugin for the aspect cli.
It contains a plugin written in Go, with a GitHub actions CI/CD pipeline to release it.
More details about aspect cli plugins is on the plugin documentation
Create a new repo with the green "Use this template" button above. Then in your repo...
- Find-and-replace
hello-world
with your plugin name. - Find-and-replace
github.com/aspect-build/aspect-cli-plugin-template
with the name of your Go module. See https://go.dev/doc/modules/developing - Start coding on your features!
- Delete everything above the SNIP line below, and replace it with info about your plugin.
- Once satisfied, create a tag
vX.Y.Z
and push it to trigger the GitHub Action that will create the release. - Navigate to the releases tab of your repository, you'll find a draft release based on your tag. Publish it to complete the release process.
- Want to share your plugin with other developers? Consider adding it to the plugin catalog, by sending a PR editing the
plugins.json
file located in the public Aspect CLI plugins registry.
- Run
bazel build :dev
to build your plugin - In an existing codebase using aspect-cli, add the plugin like following:
# .aspect/cli/config.yaml
plugins:
- name: <your-plugin-name>
from: <relative path to the plugin>/bazel-bin/plugin
- You're all set, just remember to build the
:dev
target whenever you change code in the plugin.
If you want to work with BEPEventCallback(event *buildeventstream.BuildEvent) error
but you're not very familiar with the event structures,
you can run the Bazel command you're looking to augment with the --build_event_json_file=bep.json
and inspect the resulting bep.json
to
get a rough understanding about where you should look into.
See also the Bazel user guide page about BEP.
---------- %< SNIP %< ------------
This is a plugin for the Aspect CLI.
TODO: Consider showing off your new plugin with a little animated demo of your terminal! We highly recommend asciinema.