https://github.com/bronzdoc/orbi
:robot: Project structure generator
https://github.com/bronzdoc/orbi
bootstrap generator golang scaffolding
Last synced: 3 months ago
JSON representation
:robot: Project structure generator
- Host: GitHub
- URL: https://github.com/bronzdoc/orbi
- Owner: bronzdoc
- License: mit
- Created: 2017-05-05T02:42:57.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-07T23:47:26.000Z (about 9 years ago)
- Last Synced: 2025-04-04T15:06:13.473Z (about 1 year ago)
- Topics: bootstrap, generator, golang, scaffolding
- Language: Go
- Homepage:
- Size: 116 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README

[](https://travis-ci.org/bronzdoc/orbi)
> Project structure generator.
Generate project structures using yaml and golang templating.
# Install
> NOTE: orbi just works with \*nix operating systems, windows is not supported for now.
### Binaries
- **linux** [386](https://github.com/bronzdoc/orbi/releases/download/v0.1.1/orbi-linux-386) / [amd64](https://github.com/bronzdoc/orbi/releases/download/v0.1.1/orbi-linux-amd64) / [arm](https://github.com/bronzdoc/orbi/releases/download/v0.1.1/orbi-linux-arm) / [arm64](https://github.com/bronzdoc/orbi/releases/download/v0.1.1/orbi-linux-arm64)
- **darwin** [386](https://github.com/bronzdoc/orbi/releases/download/v0.1.1/orbi-darwin-386) / [amd64](https://github.com/bronzdoc/orbi/releases/download/v0.1.1/orbi-darwin-amd64)
- **freebsd** [386](https://github.com/bronzdoc/orbi/releases/download/v0.1.1/orbi-freebsd-386) / [amd64](https://github.com/bronzdoc/orbi/releases/download/v0.1.1/orbi-freebsd-amd64)
### Via Go
```shell
$ go get github/bronzdoc/orbi
```
# Usage
Orbi defines project structures using a `definition.yml`.
```yaml
---
context: .
resources:
- dir:
name: dir_1
files:
- file_a
- dir:
name: dir_2
files:
- file_b
dir:
name: dir_3
files:
- file_c
- file_d
- files:
- file_e
- file_f
```
A `context` is where your `resources` structure will be created.
The way orbi organize definitions is with something called a `plan`, you can create a new plan by doing:
```shell
$ orbi plan new my_plan
```
This command will generate the following:
```shell
$ tree ~/.orbi/plans/my_plan
my_plan
├── definition.yml
└── templates
```
You can notice a `templates` directory, this is where your templates should be.
In order to template a file all you need to do is create a file named the same as a file resource.
```yaml
context: .
resources:
files:
- file_a
```
```shell
├── definition.yml
└── templates
└── file_a
```
Ok, we have a plan with a definition.yml and templates, so... how we create all that stuff we defined?
All you need to do is tell orbi to execute a `plan`:
```shell
$ orbi exec my_plan
```
this command will generate the file structure defined in your plan definition.yml.
If your plan templates happen to have variables, you can pass values to those variables with the `--vars` flag.
in `.orbi/plans/my_plan/templates/file_a`
```
{{.name}} is awesome
```
```shell
$ orbi exec my_plan --vars="name=Tarantino"
```
that command will generate the file named `file_a` with content `Tarantino is awesome`.
> NOTE: you can also pass a KEY=VALUE variables file with `--vars-file`
### Sharing plans
orbi let you download a plan from a repository with the `orbi plan get` command
**ssh:**
```shell
$ orbi plan get my_plan git@github.com:user/plan_name.git
```
**https:**
```shell
$ orbi plan get my_plan https://user@github.com/user/plan_name.git
```
## Contributing
Contributions are greatly appreciated and encouraged, see [CONTRIBUTING](https://github.com/bronzdoc/orbi/blob/master/CONTRIBUTING.md)