Logo converted to ASCII via https://asciiart.club/
The CLI to control StewardX
This is the official CLI to control StewardX. Made with #clap.
If you're a linux x64 user, then you're in luck! Just download the precompiled binary or use the following utility:
$ curl https://raw.githubusercontent.com/gokayokyay/stewardx-cli/master/install.sh --output install.sh
$ chmod +x install.sh
$ ./install.shIt'll handle everything for you, note: it's new and I'm pretty sure it won't work out for everyone.
If you're not, it's okay. Clone the repository and build it:
$ git clone https://github.com/gokayokyay/stewardx-cli
$ cd stewardx-cli
$ cargo build --releaseWhen the build is completed, there'll be a file named stewardx-cli located in target/release/ directory. For ease of use rename the file, create a directory to use the binary and append it to your profile, like:
$ mkdir -p $HOME/.stewardx
$ mv target/release/stewardx-cli $HOME/.stewardx/stxctl
$ echo "export PATH=\"\$PATH:/\$HOME/.stewardx\"" >> $HOME/.bashrc
$ source $HOME/.bashrcNow you're ready! Run:
$ stxctl -hto see the help message.
To install StewardX, just run the install command, like so:
$ stxctl installTo start the StewardX (daemonized) issue the run or start command.
$ stxctl run
# or
$ stxctl startI guess you got it but here it is:
$ stxctl stopOkay here's the fun part. To create a task you need to run:
$ stxctl tasks create <task_type> [ARGS]It looks complicated but it's not, let's create a hello world printer command task:
$ stxctl tasks create cmd -n "My first task" -c "echo Hello world!" -f HookWhere
- -n is name of the task
- -c is the command to execute
- -f is the frequency of the task
After executing the command above you'll get an output like:
Task ID | Name | Type | Frequency
---------------------------------------------------------------------------------
0558b548-d118-4c46-9309-e040b486a92b | first task | CmdTask | Hook Voila! You've created your first task.
To list tasks
$ stxctl tasks listTo list active tasks
$ stxctl tasks active To execute
$ stxctl tasks execute <id>To abort
$ stxctl tasks abort <id>and replace with the id of the task.
To list last 10 reports:
$ stxctl reports latestTo list a specific task's reports
$ stxctl reports -t <id>and replace with your task's id.
To list a single report:
$ stxctl reports list <id>where id is your report's id.