srvc

command module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2022 License: MIT Imports: 2 Imported by: 0

README

srvc: A Simple CLI for Go Apps

go version go report license 

status

A simple CLI for operating an application in Go.

⚡ Get Started

First, download and install Go. Version 1.17 or higher is required.

Installation is done by using the go install command, installed at $GOPATH/bin:

go install github.com/chrisprijic/srvc@latest

🔔 If you cannot run srvc, make sure $GOPATH/bin is available in your $PATH.

Let's create a new application via the CLI in the current folder:

srvc init

The command will walk you through setting up the project, and results with a working project. You can start it by using the run command:

srvc run

Next open the directory in your editor of choice, and start building your application!

You can use srvc help to learn more about the available commands.

Why yet another Go application CLI?

2022-05 - I have 3 initial reasons for creating this project:

  • I have had to bootstrap multiple Go projects and wanted a common starting-point.
  • Most application CLIs that are generic don't cover database migrations, or don't easily combine configuration + schema management in a single tool.
  • I wanted more options than just an HTTP API for applications. Sometimes apps communicate solely via a CLI, or a messaging system, or a work queue.

This was designed based off of my runtime preferences for operating services with Go. This means using commands like srvc migration up and srvc run -e production over deploying using just an executable.

The CLI is baked into the application you make -- so if your app is called myApp you can also run myApp migration up instead of also installing the srvc command in production!

🛣️ Roadmap

  • the help text and root command
  • the version command
  • the printenv command
  • the init <name> command
  • the start command
  • the restart command
  • the stop command
  • the test command
  • the build command
  • the migrate up command
  • the migrate rollback command
  • the migrate version command
  • the migrate new <name> command
  • commands can tell if running your code or running CLI itself (ErrNotInitialized)

⚠️ Warning!

This is still in active development and is not feature-complete. Breaking changes might occur as this project matures. This note will remain here until the 1.0 release.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL