Categorygithub.com/vision-cli/vision
repositorypackage
0.0.0-20240124173658-84a4305e0f48
Repository: https://github.com/vision-cli/vision.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

Vision

Roadmap

TODO:

  • Brew install

Install

From source:

Requires go to be installed

go install github.com/vision-cli/vision@latest

Build from source:

git clone github.com/vision-cli/vision
go build
# add binary to path

Purpose

Vision is a developer productivity tool which uses plugins to scaffold code templates. It is intended to make the developer experience better by automating a lot of repetitive boilerplate.

Usage

1. Initialise a Vision project.

init can accept a project name with the -p flag, where it creates a vision.json in the current working directory, and/or it can accept an optional argument that creates a new directory. Not including the -p flag assigns the name of the directory as the project name in vision.json.

tonystark:~ vision init [DIR] [-p/--project PROJECTNAME]
tonystark:~ vision init avengers

vision init avengers-assemble \
  -p=avengers \
  -m="github.com/stark-industries/avengers-assemble"

This creates a directory called avengers and creates a vision.json file within avengers. It also assigns the project_name as avengers.

{
  "project_name": "avengers"
}

2. Initialise plugins to use inside project.

We'll initialise a new Go REST server inside the avengers directory.

tonystark:~/avengers vision gorest init

This adds a template configuration to the vision.json file which needs to be changed to your specific data.

3. Generate the template files from the plugin

To create a

tonystark:~/avengers vision plugin init
- myproject
|__ services
  |__ user_service
    |__  cmd
    |__ internal
|__ vision.json

Visual tutorial/demo

To see an example of how to successfully use a vision plugin, you can watch this video.

Design

The vision cli is really a wrapper around vision plugins. The cli's purpose is to provide helper functions around managing plugins. The plugins will do the code generation.

Ideally projects are created using vision and services are added using vision. This allows vision to manage a project lifecycle and upgrades via its plugins.

Plugins can be made with vision, and should adhere to the vision plugin API.

Best practises