Lurkle is a CLI for managing the development environment of micro-services. It coordinates running scripts and starting services across multiple directories.
npm install -g lurkleyarn global add lurkle
The lurkle CLI can be used to coordinate the running of tasks in multiple directories.
Lurkles are groups of tasks that lurk in sub-folders. You can configure them either directly in a
lurkle-config.yml file from your project root or you can create
lurkle.yml files that are imported into your config.
lurkle-config.yml a root folder above your services. This contains a list of the locations to where your lurkles reside as well as a list of possible tasks that each can run. This doubles as both configuration and documentation.
lurkles:- ./app-a- ./app-b- name: app-ccwd: './app-c'tasks:test: echo "running test from $(pwd)"- name: app-dcwd: './app-d'tasks:test: echo "running test from $(pwd)"tasks:test: run the test suitesbuild: build the application
Then create a
lurkle.yml file in each sub-folder. Each lurkle can then provide a command for as many tasks as they need.
# example/app-a/lurkle.ymlname: app-atasks:test: echo 'test from app-a'# example/app-b/lurkle.ymlname: app-btasks:test: echo 'test from app-b'build: echo 'build from app-b'
We can now run our commands from the
lurkle --help will list each command.
lurkle [tasks] [-l optional list of lurkle locations]
||Run all commands in all lurkles|
||run the build command in all lurkles|
||run the build and test command in all lurkles|
||run the build command in micro-service-b lurkle|
Lurkle provides a
start command that serves as a wrapper around pm2. This allows you to coordinate ENV vars and choose which services you would like to start.
Each key on
sites creates a new service to start. The value object is passed directly to pm2 so any [valid pm2 attribute] is allowed.
To minimise re-declaring environment variables the root
env object will be used as defaults for each service.
services:env:CLIENT_HOST: 'localhost'CLIENT_PORT: 3000SERVER_HOST: 'localhost'SERVER_PORT: 3001server:env:SERVER_ONLY_ENV: 12345cwd: serverscript: 'index.js'client:server:cwd: clientscript: 'index.js'
lurkle start [sites]
||Start all sites|
||Start only the client|
||Start the client and server|