Skip to content
/ xcli Public

A package for building cli apps in Go. The cli app can be run as a service. Wraps urfave/cli and kardianos/service.

Notifications You must be signed in to change notification settings

taobig/xcli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

examples

examples contains examples of how to use the library.

Command line interface

./xcli -h # 查看帮助
./xcli install -h # 查看安装帮助
# install service
sudo ./xcli install -r "-f,prod-config.yaml"  -r "--logLevel,debug"
# use environment variables
XCLI_LOG_LEVEL=debug sudo ./xcli install -r "-f,prod-config.yaml"  -r "--logLevel,debug"

sudo ./xcli uninstall # uninstall service
sudo ./xcli start # start service
sudo ./xcli stop # stop service
sudo ./xcli restart # restart service

## linux-systemd only
./xcli log -h # Print a help message
./xcli log # (equal to `journalctl -u xxxx.service`)
./xcli log -f # (equal to `journalctl -f -u xxxx.service`)

./xcli status -h # Print a help message
./xcli status # (equal to `systemctl status xxxx.service`)
./xcli status --no-pager # (equal to `systemctl status -l --no-pager xxxx.service`)

About

A package for building cli apps in Go. The cli app can be run as a service. Wraps urfave/cli and kardianos/service.

Resources

Stars

Watchers

Forks

Languages