Kourou
The CLI that helps you manage your Kuzzle application
Install / Use
/learn @kuzzleio/KourouREADME
kourou
The CLI that helps you manage your Kuzzle instances.
<!-- toc --> <!-- tocstop -->:warning: This project is currently in beta and breaking changes may occur until the 1.0.0
Usage
<!-- usage -->$ npm install -g kourou
$ kourou COMMAND
running command...
$ kourou (-v|--version|version)
kourou/1.2.0 linux-x64 node-v22.16.0
$ kourou --help [COMMAND]
USAGE
$ kourou COMMAND
...
<!-- usagestop -->
Connect and authenticate to Kuzzle API
Commands that needs to send requests to Kuzzle API can specify the Kuzzle server address and authentication informations.
By command line:
--host=host [default: localhost] Kuzzle server host
--port=port [default: 7512] Kuzzle server port
--username=username [default: anonymous] Kuzzle user
--password=password Kuzzle user password
--api-key=api-key Kuzzle user api-key
--ssl [default: true for port 443] Use SSL to connect to Kuzzle
--protocol [default: ws] Protocol used to connect to Kuzzle ( `http` or `ws` )
By environment variables:
KUZZLE_HOST [default: localhost] Kuzzle server host
KUZZLE_PORT [default: 7512] Kuzzle server port
KUZZLE_USERNAME [default: anonymous] Kuzzle user
KUZZLE_PASSWORD Kuzzle user password
KUZZLE_API_KEY Kuzzle user api-key
KUZZLE_SSL Use SSL to connect to Kuzzle
KUZZLE_PROTOCOL Protocol used to connect to Kuzzle ( `http` or `ws` )
User impersonation
You can impersonate a user before executing a command with the --as flag and a user kuid .
User impersonation require the following rights for the authenticated user: security:createApiKey , security:deleteApiKey
$ kourou sdk:query auth:getCurrentUser --as gordon --username admin --password admin
🚀 Kourou - Executes an API query.
[ℹ] Connecting to http://localhost:7512 ...
[ℹ] Impersonate user "gordon"
[...]
Automatic command infering for API actions
When no command is found, Kourou will try to execute the given command with the sdk:query command.
The first argument has to be the name of the controller and the action separated by a semicolon (eg document:create )
Kourou will try to infer common arguments like index , collection , _id or body .
It will automatically infer and accept the following lists of arguments:
<command> <index>- _eg:
kourou collection:list iot_
- _eg:
.
<command> <body>- _eg:
kourou security:createUser '{"content":{"profileIds":["default"]}}' --id yagmur_
- _eg:
.
<command> <index> <collection>- _eg:
kourou collection:truncate iot sensors_
- _eg:
.
<command> <index> <collection> <body>- _eg:
kourou bulk:import iot sensors '{bulkData: []}'_
- _eg:
.
<command> <index> <collection> <id>- _eg:
kourou document:delete iot sensors sigfox-123_
- _eg:
.
<command> <index> <collection> <id> <body>- _eg:
kourou document:create iot sensors sigfox-123 '{temperature: 42}'_
- _eg:
All other arguments and options will be passed as-is to the sdk:query method.
Note: you can pass arguments to the API actions with the
--argor-aoption in your command, e.g.kourou security:createFirstAdmin '{ ...credentials here... }' -a reset=true
Commands
<!-- commands -->kourou api-key:check TOKENkourou api-key:create USERkourou api-key:delete USER IDkourou api-key:search USERkourou app:debug-proxykourou app:doctorkourou app:scaffold DESTINATIONkourou app:start-serviceskourou autocomplete [SHELL]kourou collection:create INDEX COLLECTION [BODY]kourou collection:export INDEX COLLECTIONkourou collection:import PATHkourou collection:migrate SCRIPT PATHkourou config:diff FIRST SECONDkourou document:search INDEX COLLECTION [QUERY]kourou es:aliases:catkourou es:indices:catkourou es:indices:get INDEX IDkourou es:indices:insert INDEXkourou es:migratekourou es:snapshot:create REPOSITORY NAMEkourou es:snapshot:create-repository REPOSITORY LOCATIONkourou es:snapshot:list REPOSITORYkourou es:snapshot:restore REPOSITORY NAMEkourou file:decrypt FILEkourou file:encrypt FILEkourou file:test FILEkourou help [COMMAND]kourou import PATHkourou index:export INDEXkourou index:import PATHkourou instance:killkourou instance:listkourou instance:logskourou instance:spawnkourou paas:loginkourou profile:exportkourou profile:import PATHkourou realtime:subscribe INDEX COLLECTION [FILTERS]kourou redis:list-keys [MATCH]kourou role:exportkourou role:import PATHkourou sdk:execute [CODE]kourou sdk:query CONTROLLER:ACTIONkourou user:exportkourou user:export-mappingskourou user:import PATHkourou user:import-mappings PATHkourou vault:add SECRETS-FILE KEY VALUEkourou vault:decrypt FILEkourou vault:encrypt FILEkourou vault:show SECRETS-FILE [KEY]kourou vault:test SECRETS-FILE
kourou api-key:check TOKEN
Checks an API key validity
USAGE
$ kourou api-key:check TOKEN
ARGUMENTS
TOKEN API key token
OPTIONS
--api-key=api-key Kuzzle user api-key
--as=as Impersonate a user
--help show CLI help
--host=host [default: localhost] Kuzzle server host
--password=password Kuzzle user password
--port=port [default: 7512] Kuzzle server port
--protocol=protocol [default: ws] Kuzzle protocol (http or ws)
--ssl Use SSL to connect to Kuzzle
--username=username [default: anonymous] Kuzzle username (local strategy)
EXAMPLE
kourou api-key:check eyJhbG...QxfQrc
See code: lib/commands/api-key/check.js
kourou api-key:create USER
Creates a new API Key for a user
USAGE
$ kourou api-key:create USER
ARGUMENTS
USER User kuid
OPTIONS
-d, --description=description (required) API Key description
--api-key=api-key Kuzzle user api-key
--as=as Impersonate a user
--expire=expire [default: -1] API Key validity
--help show CLI help
--host=host [default: localhost] Kuzzle server host
--id=id API Key unique ID
--password=password Kuzzle user password
--port=port [default: 7512] Kuzzle server port
--protocol=protocol [default: ws] Kuzzle protocol (http or ws)
--ssl Use SSL to connect to Kuzzle
--username=username [default: anonymous] Kuzzle username (local strategy)
See code: lib/commands/api-key/create.js
kourou api-key:delete USER ID
Deletes an API key.
USAGE
$ kourou api-key:delete USER ID
ARGUMENTS
USER User kuid
ID API Key unique ID
OPTIONS
--api-key=api-key Kuzzle user api-key
--as=as Impersonate a user
--help show CLI help
--host=host [default: localhost] Kuzzle server host
--password=password Kuzzle user password
--port=port [default: 7512] Kuzzle server port
--protocol=protocol [default: ws] Kuzzle protocol (http or ws)
--ssl Use SSL to connect to Kuzzle
--username=username [default: anonymous] Kuzzle username (local strategy)
EXAMPLE
kourou vault:delete sigfox-gateway 1k-BF3EBjsXdvA2PR8x
_See code: [lib/commands/api-key/delete.js](lib/commands/api-key/delet
