srvc
: A Simple CLI for Go Apps
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.