Genesis simplifies the process of starting and managing projects through an intuitive scaffolding and task runner interface. With support for multiple tech stacks, customizable templates, and a focus on convention over configuration, Genesis is designed for developers looking for efficiency and flexibility in their workflow.
Genesis is a robust project scaffolding and task runner tool designed to simplify the initiation and management of projects across various technology stacks with a consistent and unified interface.
Key Features
- Project Scaffolding: Effortlessly initialize new projects using predefined or custom templates, streamlining project setup.
- Task Runner: Execute essential development tasks defined in a project-local configuration file, enhancing workflow efficiency.
- Convention over Configuration: Provides sensible defaults allowing for full customization options, making it suitable for both beginners and advanced users.
- Language Agnostic: Compatible with any programming language or framework, ensuring versatility in project development.
- Extensible: Facilitates the creation and sharing of custom templates, promoting collaboration and reusability.
- Fast & Portable: A single binary with no external runtime dependencies, offering convenience and ease of deployment.
Getting Started
Quick Commands
- Create a New Project: Use the following command to create a new project using a specified template:
genesis new my-project --template https://github.com/example/template-go-cli - Skip Prompts: To use defaults without prompts, execute:
genesis new my-project -t https://github.com/example/template-go-cli -y - Run Tasks: To run tasks in a project, use:
genesis run test genesis run build
Configuration Files
Template Definition: Define project variables and hooks using the template.toml file. An example structure is shown below:
version = "1.0"
[vars]
description = { prompt = "Enter a short project description:" }
author = { prompt = "Enter the author's name:" }
[hooks]
post = [
"go mod tidy",
"git init",
"git add .",
"git commit -m 'Initial commit from Genesis'"
]
Task Definition: Set up project-specific tasks in the genesis.toml file. Here’s an example:
version = "1.0"
[project]
template_url = "https://github.com/user/go-cli-template"
template_version = "v1.0.2"
[tasks]
test = { description = "Run all unit tests.", cmd = "go test ./..." }
build = { description = "Build the application binary.", cmd = "go build -o myapp main.go" }
lint = { description = "Lint the source code.", cmd = "golangci-lint run" }
Template Creation
To create a custom template, establish a Git repository containing:
- A
template.tomlfile defining variables and hooks. - Project files and directories.
- Template files ending in
.tmplthat will be processed using the defined variables.
Example template structure:
my-template/
├── .gitignore.tmpl
├── main.go.tmpl
├── README.md.tmpl
└── template.toml
Genesis serves as a valuable tool for developers seeking to enhance their productivity while managing various project types succinctly.
No comments yet.
Sign in to be the first to comment.