About
Accio is a scaffolding tool for generating boilerplate code, written in Golang. You can use it to create templates for repetitive code patterns and generate them interactively whenever you need them. The best part about it is that Accio allows you to customize most aspects of code generation with custom scripts.
Features
- Interactive data prompts - configure prompts and use data in templates;
- Scripting - write custom scripts to process input data;
- Remote generators - execute generators directly from Git repositories;
- No external dependencies - no need to install external applications, dependency managers, or other tools - everything works out of the box with a single binary;
- Cross-platform - builds for Linux, OS X, Windows, and others.
Installation
Pre-compiled binaries
Homebrew:
brew install g1ntas/tap/accio
Shell script:
curl -sfL https://raw.githubusercontent.com/g1ntas/accio/master/install.sh | sh
Manually:
Download the pre-compiled binaries from releases page.
Building from source
To build a binary from the source code, you need to have Go installed first.
Steps:
- Clone repository:
git clone https://github.com/g1ntas/accio
- Build:
go run mage.go build
- Run
./accio
to verify if it works
Quickstart
Running generator
You can run a generator from a local directory with run
command:
accio run ./generator-directory
Or directly from Git repository:
accio run github.com/user/accio-generator-repo
Subdirectories are supported as well:
accio run github.com/g1ntas/accio/examples/open-source-license
Creating first generator
-
Create an empty config file ~/example/.accio.toml
-
Create a template file ~/example/file.txt
with any content:
Hello, world
And that's all it takes to create a simple generator - now you can run it:
> accio run ~/example
$ Running...
$ Done.
> cat ~/example/TEST.TXT
$ Hello, world
To learn about more advanced features needed to write more complex generators,
read the introduction tutorial.
Examples
Documentation
Contributing
Contributions are more than welcome, if you are interested please take a look to our Contributing Guidelines.
Copyright
Accio is released under the MIT license. See LICENSE.