This is the hello world plugin for Semo, it is just for fun, and is the showcase of what Semo plugin looks like.
npm install -g @semo/cli
semo run hello-world
You don't need to download the plugin by using npm install
, but semo run
helps you to do that.
OK, you can download the plugin by using npm install
npm install -g semo-plugin-hello-world
semo hello-world
Or magically just:
npx @semo/cli run hello-world
-
--lang: For now, it only support
en_US
andzh_CN
. -
--inspiration-type: For now, it only support
en
,cn
,it
,poison
, andrule
. - --clean: No box and no color
- --simple: Just output inspiration
Change the default behavior of the command by using semo config -g
semo config set '$plugin.hello-world.lang' zh_CN -g
semo config set '$plugin.hello-world.inpirationType' it -g
You can use hooks to change the command output. The template is:
{{ hi }}
{{ greeting }}
{{ inspiration }}
You can change then using these hooks in your global Semo plugins.
exports.hook_hello_world_hi = async () => {}
exports.hook_hello_world_greeting = async () => {}
exports.hook_hello_world_inspirations = async () => {}
The last inspirations hook need to return an Array of sentences, and than output randomly by the command core.
In core, we use yml to define inspriation and there are 2 format supported:
- who: somebody
said: something
or
- something --somebody
The first format may provide more formated output, but now, the last format is easy to use, so if you hook inspirations, you can just return sentences array.
There must be typos need to be fixed, and we need more inspiration types and more good inspirations.
If you have any ideas about this plugin, please create issues or push PR to us.
MIT