Create your first tool
The easiest way to create a plis tool is to use a plis tool π
Create a new tool
Install the plis-tool tool so you can start building your own.
plis get -g https://github.com/kujtimiihoxha/plis-tool
To see what options plis-tool provides just run
plis tool -h
Now create a new tool by running:
plis tool new mytool
This will create a new tool with the default settings.
βββ plis-mytool/
βββ .gitignore
βββ .plis-tool.json
βββ config.json
βββ run.lua
βββ test-project/
To test out your new tool cd into the tool and run it.
cd plis-mytool
plis mytool
#Output
INFO[0000] Validating tool `mytool`...
INFO[0000] Validation Ok
INFO[0000] Validating flags...
INFO[0000] Validating args...
Hello form 'mytool' generator
Usage:
plis mytool [flags]
Global Flags:
-d, --debug Is plis debugging
--debug_folder string Root folder of the debug mode
Congratulation!! you have created your first plis tool.
By defualt plis-tool creates a tool that uses
jsbut you can change that by providing the type e.xplis tool new mytool --type lua
Using plis-tool subcommands.
Now you can modify and change your tool, plis-tool also has some useful other subcommands to make it easy to add flags, arguments, subcommands to your tool.
-
Add a flag:
plis tool add flag {name}
For more info on this command useplist tool add flag -h -
Add a argument:
plis tool add arg {name}
For more info on this command useplist tool add arg -h -
Add a subcommand:
plis tool new {name} -s
For more info on this command useplist tool new -h
To see a more advanced tool and how you can use plis API you can look at
plis-toolgenerator at https://github.com/kujtimiihoxha/plis-tool
Updated over 8 years ago
