Socket
Socket
Sign inDemoInstall

kourou

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kourou - npm Package Compare versions

Comparing version 0.13.1 to 0.14.0

lib/commands/instance/kill.d.ts

9

lib/commands/collection/create.d.ts

@@ -14,11 +14,14 @@ import { flags } from '@oclif/command';

help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
body: flags.IOptionFlag<string>;
};
static args: {
static args: ({
name: string;
description: string;
required: boolean;
}[];
} | {
name: string;
description: string;
required?: undefined;
})[];
static readStdin: boolean;
runSafe(): Promise<void>;
}

@@ -9,3 +9,3 @@ "use strict";

var _a, _b, _c;
const body = this.stdin ? this.parseJs(this.stdin) : this.parseJs(this.flags.body);
const body = this.stdin ? this.stdin : this.args.body || '{}';
if (!await ((_a = this.sdk) === null || _a === void 0 ? void 0 : _a.index.exists(this.args.index))) {

@@ -15,3 +15,3 @@ await ((_b = this.sdk) === null || _b === void 0 ? void 0 : _b.index.create(this.args.index));

}
await ((_c = this.sdk) === null || _c === void 0 ? void 0 : _c.collection.create(this.args.index, this.args.collection, body));
await ((_c = this.sdk) === null || _c === void 0 ? void 0 : _c.collection.create(this.args.index, this.args.collection, this.parseJs(body)));
this.logOk(`Collection "${this.args.index}":"${this.args.collection}" created`);

@@ -22,10 +22,8 @@ }

CollectionCreate.description = 'Creates a collection';
CollectionCreate.flags = Object.assign({ help: command_1.flags.help(), body: command_1.flags.string({
description: 'Collection mappings and settings in JS or JSON format. Will be read from STDIN if available',
default: '{}'
}) }, kuzzle_1.kuzzleFlags);
CollectionCreate.flags = Object.assign({ help: command_1.flags.help() }, kuzzle_1.kuzzleFlags);
CollectionCreate.args = [
{ name: 'index', description: 'Index name', required: true },
{ name: 'collection', description: 'Collection name', required: true }
{ name: 'collection', description: 'Collection name', required: true },
{ name: 'body', description: 'Collection mappings and settings in JS or JSON format. Will be read from STDIN if available' },
];
CollectionCreate.readStdin = true;

@@ -13,2 +13,3 @@ "use strict";

async runSafe() {
var _a;
const files = await this.walkDirectories(this.args.path);

@@ -58,2 +59,14 @@ for (const file of files.mappings) {

}
for (const file of files.usersMappings) {
try {
this.logInfo(`[users] Start importing users collection mappings in ${file}`);
const dump = JSON.parse(fs_1.default.readFileSync(file, 'utf8'));
const mapping = dump.content.mapping;
await ((_a = this.sdk) === null || _a === void 0 ? void 0 : _a.security.updateUserMapping({ properties: mapping }));
this.logOk('[users] collection mappings imported');
}
catch (error) {
this.logKo(`Error during import of ${file}: ${error.message}. Skipped.`);
}
}
for (const file of files.users) {

@@ -83,5 +96,5 @@ try {

return memo;
}, { documents: [], mappings: [], roles: [], profiles: [], users: [] });
}, { documents: [], mappings: [], roles: [], profiles: [], usersMappings: [], users: [] });
for (const dir of directories) {
const { documents, mappings, roles, profiles, users } = await this.walkDirectories(dir);
const { documents, mappings, roles, profiles, usersMappings, users } = await this.walkDirectories(dir);
files.documents = files.documents.concat(documents);

@@ -91,2 +104,3 @@ files.mappings = files.mappings.concat(mappings);

files.profiles = files.profiles.concat(profiles);
files.usersMappings = files.usersMappings.concat(usersMappings);
files.users = files.users.concat(users);

@@ -93,0 +107,0 @@ }

@@ -15,2 +15,5 @@ "use strict";

const instancesList = await this.getInstancesList();
if (instancesList.length === 0) {
throw new Error('There are no Kuzzle running instances');
}
const responses = await inquirer_1.default.prompt([{

@@ -17,0 +20,0 @@ name: 'instance',

@@ -19,2 +19,3 @@ import { flags } from '@oclif/command';

collection: flags.IOptionFlag<string | undefined>;
id: flags.IOptionFlag<string | undefined>;
display: flags.IOptionFlag<string>;

@@ -21,0 +22,0 @@ };

@@ -18,2 +18,3 @@ "use strict";

requestArgs.collection = this.flags.collection;
requestArgs._id = this.flags.id;
for (const keyValue of this.flags.arg || []) {

@@ -43,12 +44,13 @@ const [key, ...value] = keyValue.split('=');

arguments can be passed and repeated using the --arg or -a flag.
index and collection names can be passed with --index (-i) and --collection (-c) flags
Arguments can be passed and repeated using the --arg or -a flag.
Index and collection names can be passed with --index (-i) and --collection (-c) flags
ID can be passed with the --id flag.
Examples:
- kourou sdk:query document:get -i iot -c sensors -a _id=sigfox-42
- kourou sdk:query document:delete -i iot -c sensors -a refresh=wait_for
Query body
body can be passed with the --body flag with either a JSON or JS string.
body will be read from STDIN if available
Body can be passed with the --body flag with either a JSON or JS string.
Body will be read from STDIN if available

@@ -62,4 +64,4 @@ Examples:

use the --editor flag to modify the query before sending it to Kuzzle
use the --display flag to display a specific property of the response
Use the --editor flag to modify the query before sending it to Kuzzle
Use the --display flag to display a specific property of the response

@@ -69,2 +71,22 @@ Examples:

- kourou sdk:query server:now --display 'result.now'
Default fallback to API method
It's possible to use this command by only specifying the corresponding controller
and action as first argument.
Kourou will try to infer the first arguments to one the following pattern:
- <command> <index>
- <command> <index> <collection>
- <command> <index> <collection> <id>
- <command> <index> <collection> <body>
- <command> <index> <collection> <id> <body>
If a flag is given (-i, -c, --body or --id), then the flag value has prior to
argument infering.
Examples:
- kourou collection:list iot
- kourou collection:delete iot sensors
- kourou document:createOrReplace iot sensors sigfox-1 '{}'
- kourou bulk:import iot sensors '{bulkData: [...]}'
- kourou admin:loadMappings < mappings.json
`;

@@ -86,2 +108,4 @@ SdkQuery.flags = Object.assign({ help: command_1.flags.help(), arg: command_1.flags.string({

description: 'Collection argument'
}), id: command_1.flags.string({
description: 'ID argument (_id)'
}), display: command_1.flags.string({

@@ -88,0 +112,0 @@ description: 'Path of the property to display from the response (empty string to display everything)',

@@ -1,1 +0,1 @@

{"version":"0.13.1","commands":{"import":{"id":"import","description":"Recursively imports dump files from a root directory","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"preserve-anonymous":{"name":"preserve-anonymous","type":"boolean","description":"Preserve anonymous rights","allowNo":false},"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsWriteCount config)","default":"200"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"path","description":"Root directory containing dumps","required":true}]},"subscribe":{"id":"subscribe","description":"Subscribes to realtime notifications","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou subscribe iot-data sensors","kourou subscribe iot-data sensors --filters '{ range: { temperature: { gt: 0 } } }'","kourou subscribe iot-data sensors --filters '{ exists: \"position\" }' --scope out","kourou subscribe iot-data sensors --users all --volatile '{ clientId: \"citizen-kane\" }'","kourou subscribe iot-data sensors --display result._source.temperature"],"flags":{"filters":{"name":"filters","type":"option","description":"Set of Koncorde filters","default":"{}"},"scope":{"name":"scope","type":"option","description":"Subscribe to document entering or leaving the scope (all, in, out, none)","default":"all"},"users":{"name":"users","type":"option","description":"Subscribe to users entering or leaving the room (all, in, out, none)","default":"all"},"volatile":{"name":"volatile","type":"option","description":"Additional subscription information used in user join/leave notifications","default":"{}"},"display":{"name":"display","type":"option","description":"Path of the property to display from the notification (empty string to display everything)","default":"result"},"editor":{"name":"editor","type":"boolean","description":"Open an editor (EDITOR env variable) to edit the filters before subscribing.","allowNo":false},"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (only websocket for realtime)","default":"websocket"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"index","description":"Index name","required":true},{"name":"collection","description":"Collection name","required":true}]},"api-key:check":{"id":"api-key:check","description":"Checks an API key validity","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou api-key:check eyJhbG...QxfQrc"],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"token","description":"API key token","required":true}]},"api-key:create":{"id":"api-key:create","description":"Creates a new API Key for a user","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"description":{"name":"description","type":"option","char":"d","description":"API Key description","required":true},"id":{"name":"id","type":"option","description":"API Key unique ID"},"expire":{"name":"expire","type":"option","description":"API Key validity","default":"-1"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"user","description":"User kuid","required":true}]},"api-key:delete":{"id":"api-key:delete","description":"Deletes an API key.","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou vault:delete sigfox-gateway 1k-BF3EBjsXdvA2PR8x"],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"user","description":"User kuid","required":true},{"name":"id","description":"API Key unique ID","required":true}]},"api-key:search":{"id":"api-key:search","description":"Lists a user's API Keys.","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"filter":{"name":"filter","type":"option","description":"Filter to match the API Key descriptions"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"user","description":"User kuid","required":true}]},"collection:create":{"id":"collection:create","description":"Creates a collection","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"body":{"name":"body","type":"option","description":"Collection mappings and settings in JS or JSON format. Will be read from STDIN if available","default":"{}"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"index","description":"Index name","required":true},{"name":"collection","description":"Collection name","required":true}]},"collection:export":{"id":"collection:export","description":"Exports a collection (JSONL format)","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou collection:export nyc-open-data yellow-taxi","kourou collection:export nyc-open-data yellow-taxi --query '{ term: { city: \"Saigon\" } }'"],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"path":{"name":"path","type":"option","description":"Dump root directory"},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsFetchCount config)","default":"2000"},"query":{"name":"query","type":"option","description":"Only dump documents matching the query (JS or JSON format)","default":"{}"},"editor":{"name":"editor","type":"boolean","description":"Open an editor (EDITOR env variable) to edit the query before sending","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"index","description":"Index name","required":true},{"name":"collection","description":"Collection name","required":true}]},"collection:import":{"id":"collection:import","description":"Imports a collection","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsWriteCount config)","default":"200"},"index":{"name":"index","type":"option","description":"If set, override the index destination name"},"collection":{"name":"collection","type":"option","description":"If set, override the collection destination name"},"no-mappings":{"name":"no-mappings","type":"boolean","description":"Skip collection mappings","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"path","description":"Dump directory path","required":true}]},"config:diff":{"id":"config:diff","description":"Returns differences between two Kuzzle configuration files (kuzzlerc)","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou config:diff config/local/kuzzlerc config/production/kuzzlerc"],"flags":{"strict":{"name":"strict","type":"boolean","description":"Exit with an error if differences are found","allowNo":false},"values":{"name":"values","type":"boolean","description":"Also displays value changes","allowNo":false}},"args":[{"name":"first","description":"First configuration file","required":true},{"name":"second","description":"Second configuration file","required":true}]},"document:create":{"id":"document:create","description":"Creates a document","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou document:create iot sensors --body '{network: \"sigfox\"}'","kourou document:create iot sensors < document.json"],"flags":{"body":{"name":"body","type":"option","description":"Document body in JS or JSON format. Will be read from STDIN if available","default":"{}"},"id":{"name":"id","type":"option","description":"Optional document ID"},"replace":{"name":"replace","type":"boolean","description":"Replaces the document if it already exists","allowNo":false},"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"index","description":"Index name","required":true},{"name":"collection","description":"Collection name","required":true}]},"document:get":{"id":"document:get","description":"Gets a document","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"index","description":"Index name","required":true},{"name":"collection","description":"Collection name","required":true},{"name":"id","description":"Document ID","required":true}]},"document:search":{"id":"document:search","description":"Searches for documents","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou document:search iot sensors --query '{ term: { name: \"corona\" } }'","kourou document:search iot sensors --editor"],"flags":{"query":{"name":"query","type":"option","description":"Query in JS or JSON format.","default":"{}"},"sort":{"name":"sort","type":"option","description":"Sort in JS or JSON format.","default":"{}"},"from":{"name":"from","type":"option","description":"Optional offset"},"size":{"name":"size","type":"option","description":"Optional page size"},"scroll":{"name":"scroll","type":"option","description":"Optional scroll TTL"},"editor":{"name":"editor","type":"boolean","description":"Open an editor (EDITOR env variable) to edit the request before sending","allowNo":false},"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"index","description":"Index name","required":true},{"name":"collection","description":"Collection name","required":true}]},"es:get":{"id":"es:get","description":"Gets a document from ES","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","char":"h","description":"Elasticsearch server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","description":"Elasticsearch server port","default":"9200"}},"args":[{"name":"index","description":"ES Index name","required":true},{"name":"id","description":"Document ID","required":true}]},"es:insert":{"id":"es:insert","description":"Inserts a document directly into ES (will replace if exists)","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"body":{"name":"body","type":"option","description":"Document body in JSON","default":"{}"},"id":{"name":"id","type":"option","description":"Document ID"},"host":{"name":"host","type":"option","char":"h","description":"Elasticsearch server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","description":"Elasticsearch server port","default":"9200"},"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false}},"args":[{"name":"index","description":"ES Index name","required":true}]},"es:list-index":{"id":"es:list-index","description":"Lists available ES indexes","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","char":"h","description":"Elasticsearch server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","description":"Elasticsearch server port","default":"9200"},"grep":{"name":"grep","type":"option","char":"g","description":"Match output with pattern"}},"args":[]},"file:decrypt":{"id":"file:decrypt","description":"Decrypts an encrypted file.","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou file:decrypt books/cryptonomicon.txt.enc --vault-key <vault-key>","kourou file:decrypt books/cryptonomicon.txt.enc -o books/cryptonomicon.txt --vault-key <vault-key>"],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"Overwrite the output file if it already exists","allowNo":false},"output-file":{"name":"output-file","type":"option","char":"o","description":"Output file (default: remove \".enc\")"},"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"file","description":"Encrypted file","required":true}]},"file:encrypt":{"id":"file:encrypt","description":"Encrypts an entire file.","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou file:encrypt books/cryptonomicon.txt --vault-key <vault-key>","kourou file:encrypt books/cryptonomicon.txt -o books/cryptonomicon.txt.enc --vault-key <vault-key>"],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"Overwrite the output file if it already exists","allowNo":false},"output-file":{"name":"output-file","type":"option","char":"o","description":"Output file (default: <filename>.enc)"},"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"file","description":"Filename","required":true}]},"file:test":{"id":"file:test","description":"Tests if an encrypted file can be decrypted.","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou file:test books/cryptonomicon.txt.enc --vault-key <vault-key>"],"flags":{"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"file","description":"Encrypted file","required":true}]},"index:export":{"id":"index:export","description":"Exports an index (JSONL format)","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"path":{"name":"path","type":"option","description":"Dump root directory"},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsFetchCount config)","default":"2000"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"index","description":"Index name","required":true}]},"index:import":{"id":"index:import","description":"Imports an index (JSONL format)","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou index:import ./dump/iot-data","kourou index:import ./dump/iot-data --index iot-data-production --no-mappings"],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsWriteCount config)","default":"200"},"index":{"name":"index","type":"option","description":"If set, override the index destination name"},"no-mappings":{"name":"no-mappings","type":"boolean","description":"Skip collections mappings","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"path","description":"Dump directory or file","required":true}]},"instance:logs":{"id":"instance:logs","description":"Displays the logs of a running Kuzzle","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"instance":{"name":"instance","type":"option","char":"i","description":"Kuzzle instance name"},"follow":{"name":"follow","type":"boolean","char":"f","description":"Follow log output","allowNo":false}},"args":[]},"instance:spawn":{"id":"instance:spawn","description":"Spawn a new Kuzzle instance","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"check":{"name":"check","type":"boolean","description":"Check prerequisite before running Kuzzle","allowNo":false},"version":{"name":"version","type":"option","char":"v","description":"Core-version of the instance to spawn","default":"2"}},"args":[]},"profile:export":{"id":"profile:export","description":"Exports profiles","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"path":{"name":"path","type":"option","description":"Dump directory","default":"profiles"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[]},"profile:import":{"id":"profile:import","description":"Imports profiles","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"path","description":"Dump file","required":true}]},"role:export":{"id":"role:export","description":"Exports roles","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"path":{"name":"path","type":"option","description":"Dump directory","default":"roles"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[]},"role:import":{"id":"role:import","description":"Import roles","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"preserve-anonymous":{"name":"preserve-anonymous","type":"boolean","description":"Preserve anonymous rights","allowNo":false},"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"path","description":"Dump file","required":true}]},"sdk:execute":{"id":"sdk:execute","description":"\nExecutes arbitrary code.\n\nCode Execution\n\n Provided code will be executed in an async method.\n You can access a connected and authenticated SDK with the \"sdk\" variable.\n Templated variable passed as the command arguments are also accessible within the same name.\n Returned value will be printed on the standard output (e.g. 'return await sdk.server.now();').\n Errors will be caught and printed on the error output (e.g. 'throw new Error(\"failure\");').\n\nProvide code\n\n code can be passed with the --code flag\n code will be read from STDIN if available\n\n Examples:\n - kourou sdk:execute --code 'return await sdk.server.now()'\n - kourou sdk:execute --code 'return await sdk.index.exists(index)' --var 'index=\"iot-data\"'\n - kourou sdk:execute < snippet.js\n - echo 'return await sdk.server.now()' | kourou sdk:execute\n\nOther\n\n use the --editor flag to modify the code before executing it\n\n Examples:\n - kourou sdk:execute --code 'return await sdk.server.now()' --editor\n","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"code":{"name":"code","type":"option","description":"Code to execute. Will be read from STDIN if available."},"var":{"name":"var","type":"option","char":"v","description":"Additional arguments injected into the code. (eg: --var 'index=\"iot-data\"'"},"editor":{"name":"editor","type":"boolean","description":"Open an editor (EDITOR env variable) to edit the code before executing it.","allowNo":false},"keep-alive":{"name":"keep-alive","type":"boolean","description":"Keep the connection running (websocket only)","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[]},"sdk:query":{"id":"sdk:query","description":"\nExecutes an API query.\n\nQuery arguments\n\n arguments can be passed and repeated using the --arg or -a flag.\n index and collection names can be passed with --index (-i) and --collection (-c) flags\n\n Examples:\n - kourou sdk:query document:get -i iot -c sensors -a _id=sigfox-42\n\nQuery body\n\n body can be passed with the --body flag with either a JSON or JS string.\n body will be read from STDIN if available\n\n Examples:\n - kourou sdk:query document:create -i iot -c sensors --body '{creation: Date.now())}'\n - kourou sdk:query admin:loadMappings < mappings.json\n - echo '{dynamic: \"strict\"}' | kourou sdk:query collection:create -i iot -c sensors\n\nOther\n\n use the --editor flag to modify the query before sending it to Kuzzle\n use the --display flag to display a specific property of the response\n\n Examples:\n - kourou sdk:query document:create -i iot -c sensors --editor\n - kourou sdk:query server:now --display 'result.now'\n","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"arg":{"name":"arg","type":"option","char":"a","description":"Additional argument. Repeatable. (e.g. \"-a refresh=wait_for\")"},"body":{"name":"body","type":"option","description":"Request body in JS or JSON format. Will be read from STDIN if available.","default":"{}"},"editor":{"name":"editor","type":"boolean","description":"Open an editor (EDITOR env variable) to edit the request before sending.","allowNo":false},"index":{"name":"index","type":"option","char":"i","description":"Index argument"},"collection":{"name":"collection","type":"option","char":"c","description":"Collection argument"},"display":{"name":"display","type":"option","description":"Path of the property to display from the response (empty string to display everything)","default":"result"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"controller:action","description":"Controller and action (eg: \"server:now\")","required":true}]},"user:export":{"id":"user:export","description":"\nExports users to JSON.\n\nThe users will be exported WITHOUT their credentials since Kuzzzle can't access them.\n\nYou can either:\n - Manually re-create credentials for your users\n - Use the \"mustChangePasswordIfSetByAdmin\" option Kuzzle password policies (see https://github.com/kuzzleio/kuzzle-plugin-auth-passport-local/#optional-properties)\n - Use the \"--generate-credentials\" flag to auto-generate credentials for your users\n\nAuto-generation of credentials\n\n With the \"--generate-credentials\" flag, Kourou will add credentials for the \"local\" strategy.\n By default, the username will be the user ID.\n Use the \"generated-username\" flag to use an other property than the user ID for the generated username\n The password will be a strong random 40 characters string\n\nExamples:\n\n - kourou user:export\n - kourou user:export --exclude '.*admin.*' --exclude 'supervisor.*'\n - kourou user:export --generate-credentials\n - kourou user:export --generate-credentials --generated-username content.email\n","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"path":{"name":"path","type":"option","description":"Dump directory","default":"users"},"exclude":{"name":"exclude","type":"option","description":"Exclude users by matching their IDs with a regexp"},"generate-credentials":{"name":"generate-credentials","type":"boolean","description":"Generate credentials with a random password for users","allowNo":false},"generated-username":{"name":"generated-username","type":"option","description":"User content property used as a username for local credentials","default":"_id"},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsFetchCount config)","default":"2000"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[]},"user:import":{"id":"user:import","description":"Imports users","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"path","description":"Dump file","required":true}]},"vault:add":{"id":"vault:add","description":"\nAdds an encrypted key to an encrypted secrets file.\n\nA new secrets file is created if it does not yet exist.\n\nEncrypted secrets are meant to be loaded inside an application with Kuzzle Vault.\n\nSee https://github.com/kuzzleio/kuzzle-vault/ for more information.\n","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou vault:add config/secrets.enc.json aws.s3.keyId b61e267676660c314b006b06 --vault-key <vault-key>"],"flags":{"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"secrets-file","description":"Encrypted secrets file","required":true},{"name":"key","description":"Path to the key (lodash style)","required":true},{"name":"value","description":"Value to encrypt","required":true}]},"vault:decrypt":{"id":"vault:decrypt","description":"\nDecrypts an entire secrets file.\n\nDecrypted secrets file must NEVER be committed into the repository.\n\nSee https://github.com/kuzzleio/kuzzle-vault/ for more information.\n","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou vault:decrypt config/secrets.enc.json --vault-key <vault-key>","kourou vault:decrypt config/secrets.enc.json -o config/secrets.json --vault-key <vault-key>"],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"Overwrite the output file if it already exists","allowNo":false},"output-file":{"name":"output-file","type":"option","char":"o","description":"Output file (default: remove \".enc\")"},"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"file","description":"File containing encrypted secrets","required":true}]},"vault:encrypt":{"id":"vault:encrypt","description":"\nEncrypts an entire secrets file.\n\nThe secrets file must be in JSON format and it must contain only strings or objects.\n\nExample:\n{\n aws: {\n s3: {\n keyId: 'b61e267676660c314b006b06'\n }\n }\n}\n\nEncrypted secrets are meant to be loaded inside an application with Kuzzle Vault.\n\nSee https://github.com/kuzzleio/kuzzle-vault/ for more information.\n","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou vault:encrypt config/secrets.json --vault-key <vault-key>","kourou vault:encrypt config/secrets.json -o config/secrets_prod.enc.json --vault-key <vault-key>"],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"Overwrite the output file if it already exists","allowNo":false},"output-file":{"name":"output-file","type":"option","char":"o","description":"Output file (default: <file>.enc.json)"},"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"file","description":"File containing unencrypted secrets","required":true}]},"vault:show":{"id":"vault:show","description":"\nPrints an encrypted secrets file content.\n\nThis method can display either:\n - the entire content of the secrets file\n - a single key value\n\nSee https://github.com/kuzzleio/kuzzle-vault/ for more information.\n","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou vault:show config/secrets.enc.json --vault-key <vault-key>","kourou vault:show config/secrets.enc.json aws.s3.secretKey --vault-key <vault-key>"],"flags":{"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"secrets-file","description":"Encrypted secrets file","required":true},{"name":"key","description":"Path to a key (lodash style)"}]},"vault:test":{"id":"vault:test","description":"\nTests if an encrypted secrets file can be decrypted.\n\nSee https://github.com/kuzzleio/kuzzle-vault/ for more information.\n","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou vault:test config/secrets.enc.json --vault-key <vault-key>"],"flags":{"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"secrets-file","description":"Encrypted secrets file","required":true}]}}}
{"version":"0.14.0","commands":{"import":{"id":"import","description":"Recursively imports dump files from a root directory","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"preserve-anonymous":{"name":"preserve-anonymous","type":"boolean","description":"Preserve anonymous rights","allowNo":false},"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsWriteCount config)","default":"200"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"path","description":"Root directory containing dumps","required":true}]},"subscribe":{"id":"subscribe","description":"Subscribes to realtime notifications","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou subscribe iot-data sensors","kourou subscribe iot-data sensors --filters '{ range: { temperature: { gt: 0 } } }'","kourou subscribe iot-data sensors --filters '{ exists: \"position\" }' --scope out","kourou subscribe iot-data sensors --users all --volatile '{ clientId: \"citizen-kane\" }'","kourou subscribe iot-data sensors --display result._source.temperature"],"flags":{"filters":{"name":"filters","type":"option","description":"Set of Koncorde filters","default":"{}"},"scope":{"name":"scope","type":"option","description":"Subscribe to document entering or leaving the scope (all, in, out, none)","default":"all"},"users":{"name":"users","type":"option","description":"Subscribe to users entering or leaving the room (all, in, out, none)","default":"all"},"volatile":{"name":"volatile","type":"option","description":"Additional subscription information used in user join/leave notifications","default":"{}"},"display":{"name":"display","type":"option","description":"Path of the property to display from the notification (empty string to display everything)","default":"result"},"editor":{"name":"editor","type":"boolean","description":"Open an editor (EDITOR env variable) to edit the filters before subscribing.","allowNo":false},"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (only websocket for realtime)","default":"websocket"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"index","description":"Index name","required":true},{"name":"collection","description":"Collection name","required":true}]},"api-key:check":{"id":"api-key:check","description":"Checks an API key validity","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou api-key:check eyJhbG...QxfQrc"],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"token","description":"API key token","required":true}]},"api-key:create":{"id":"api-key:create","description":"Creates a new API Key for a user","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"description":{"name":"description","type":"option","char":"d","description":"API Key description","required":true},"id":{"name":"id","type":"option","description":"API Key unique ID"},"expire":{"name":"expire","type":"option","description":"API Key validity","default":"-1"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"user","description":"User kuid","required":true}]},"api-key:delete":{"id":"api-key:delete","description":"Deletes an API key.","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou vault:delete sigfox-gateway 1k-BF3EBjsXdvA2PR8x"],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"user","description":"User kuid","required":true},{"name":"id","description":"API Key unique ID","required":true}]},"api-key:search":{"id":"api-key:search","description":"Lists a user's API Keys.","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"filter":{"name":"filter","type":"option","description":"Filter to match the API Key descriptions"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"user","description":"User kuid","required":true}]},"collection:create":{"id":"collection:create","description":"Creates a collection","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"index","description":"Index name","required":true},{"name":"collection","description":"Collection name","required":true},{"name":"body","description":"Collection mappings and settings in JS or JSON format. Will be read from STDIN if available"}]},"collection:export":{"id":"collection:export","description":"Exports a collection (JSONL format)","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou collection:export nyc-open-data yellow-taxi","kourou collection:export nyc-open-data yellow-taxi --query '{ term: { city: \"Saigon\" } }'"],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"path":{"name":"path","type":"option","description":"Dump root directory"},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsFetchCount config)","default":"2000"},"query":{"name":"query","type":"option","description":"Only dump documents matching the query (JS or JSON format)","default":"{}"},"editor":{"name":"editor","type":"boolean","description":"Open an editor (EDITOR env variable) to edit the query before sending","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"index","description":"Index name","required":true},{"name":"collection","description":"Collection name","required":true}]},"collection:import":{"id":"collection:import","description":"Imports a collection","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsWriteCount config)","default":"200"},"index":{"name":"index","type":"option","description":"If set, override the index destination name"},"collection":{"name":"collection","type":"option","description":"If set, override the collection destination name"},"no-mappings":{"name":"no-mappings","type":"boolean","description":"Skip collection mappings","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"path","description":"Dump directory path","required":true}]},"config:diff":{"id":"config:diff","description":"Returns differences between two Kuzzle configuration files (kuzzlerc)","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou config:diff config/local/kuzzlerc config/production/kuzzlerc"],"flags":{"strict":{"name":"strict","type":"boolean","description":"Exit with an error if differences are found","allowNo":false},"values":{"name":"values","type":"boolean","description":"Also displays value changes","allowNo":false}},"args":[{"name":"first","description":"First configuration file","required":true},{"name":"second","description":"Second configuration file","required":true}]},"document:search":{"id":"document:search","description":"Searches for documents","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou document:search iot sensors --query '{ term: { name: \"corona\" } }'","kourou document:search iot sensors --editor"],"flags":{"query":{"name":"query","type":"option","description":"Query in JS or JSON format.","default":"{}"},"sort":{"name":"sort","type":"option","description":"Sort in JS or JSON format.","default":"{}"},"from":{"name":"from","type":"option","description":"Optional offset"},"size":{"name":"size","type":"option","description":"Optional page size"},"scroll":{"name":"scroll","type":"option","description":"Optional scroll TTL"},"editor":{"name":"editor","type":"boolean","description":"Open an editor (EDITOR env variable) to edit the request before sending","allowNo":false},"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"index","description":"Index name","required":true},{"name":"collection","description":"Collection name","required":true}]},"es:get":{"id":"es:get","description":"Gets a document from ES","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","char":"h","description":"Elasticsearch server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","description":"Elasticsearch server port","default":"9200"}},"args":[{"name":"index","description":"ES Index name","required":true},{"name":"id","description":"Document ID","required":true}]},"es:insert":{"id":"es:insert","description":"Inserts a document directly into ES (will replace if exists)","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"body":{"name":"body","type":"option","description":"Document body in JSON","default":"{}"},"id":{"name":"id","type":"option","description":"Document ID"},"host":{"name":"host","type":"option","char":"h","description":"Elasticsearch server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","description":"Elasticsearch server port","default":"9200"},"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false}},"args":[{"name":"index","description":"ES Index name","required":true}]},"es:list-index":{"id":"es:list-index","description":"Lists available ES indexes","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","char":"h","description":"Elasticsearch server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","description":"Elasticsearch server port","default":"9200"},"grep":{"name":"grep","type":"option","char":"g","description":"Match output with pattern"}},"args":[]},"file:decrypt":{"id":"file:decrypt","description":"Decrypts an encrypted file.","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou file:decrypt books/cryptonomicon.txt.enc --vault-key <vault-key>","kourou file:decrypt books/cryptonomicon.txt.enc -o books/cryptonomicon.txt --vault-key <vault-key>"],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"Overwrite the output file if it already exists","allowNo":false},"output-file":{"name":"output-file","type":"option","char":"o","description":"Output file (default: remove \".enc\")"},"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"file","description":"Encrypted file","required":true}]},"file:encrypt":{"id":"file:encrypt","description":"Encrypts an entire file.","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou file:encrypt books/cryptonomicon.txt --vault-key <vault-key>","kourou file:encrypt books/cryptonomicon.txt -o books/cryptonomicon.txt.enc --vault-key <vault-key>"],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"Overwrite the output file if it already exists","allowNo":false},"output-file":{"name":"output-file","type":"option","char":"o","description":"Output file (default: <filename>.enc)"},"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"file","description":"Filename","required":true}]},"file:test":{"id":"file:test","description":"Tests if an encrypted file can be decrypted.","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou file:test books/cryptonomicon.txt.enc --vault-key <vault-key>"],"flags":{"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"file","description":"Encrypted file","required":true}]},"index:export":{"id":"index:export","description":"Exports an index (JSONL format)","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"path":{"name":"path","type":"option","description":"Dump root directory"},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsFetchCount config)","default":"2000"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"index","description":"Index name","required":true}]},"index:import":{"id":"index:import","description":"Imports an index (JSONL format)","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou index:import ./dump/iot-data","kourou index:import ./dump/iot-data --index iot-data-production --no-mappings"],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsWriteCount config)","default":"200"},"index":{"name":"index","type":"option","description":"If set, override the index destination name"},"no-mappings":{"name":"no-mappings","type":"boolean","description":"Skip collections mappings","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"path","description":"Dump directory or file","required":true}]},"instance:kill":{"id":"instance:kill","description":"Stop and remove all the containers of a running kuzzle instance","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"instance":{"name":"instance","type":"option","char":"i","description":"Kuzzle instance name [ex: stack-0]"},"all":{"name":"all","type":"boolean","char":"a","description":"Kill all instances","allowNo":false}},"args":[]},"instance:list":{"id":"instance:list","description":"Lists the Kuzzle running instances","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{},"args":[]},"instance:logs":{"id":"instance:logs","description":"Displays the logs of a running Kuzzle","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"instance":{"name":"instance","type":"option","char":"i","description":"Kuzzle instance name"},"follow":{"name":"follow","type":"boolean","char":"f","description":"Follow log output","allowNo":false}},"args":[]},"instance:spawn":{"id":"instance:spawn","description":"Spawn a new Kuzzle instance","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"check":{"name":"check","type":"boolean","description":"Check prerequisite before running Kuzzle","allowNo":false},"version":{"name":"version","type":"option","char":"v","description":"Core-version of the instance to spawn","default":"2"}},"args":[]},"profile:export":{"id":"profile:export","description":"Exports profiles","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"path":{"name":"path","type":"option","description":"Dump directory","default":"profiles"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[]},"profile:import":{"id":"profile:import","description":"Imports profiles","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"path","description":"Dump file","required":true}]},"role:export":{"id":"role:export","description":"Exports roles","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"path":{"name":"path","type":"option","description":"Dump directory","default":"roles"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[]},"role:import":{"id":"role:import","description":"Import roles","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"preserve-anonymous":{"name":"preserve-anonymous","type":"boolean","description":"Preserve anonymous rights","allowNo":false},"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"path","description":"Dump file","required":true}]},"sdk:execute":{"id":"sdk:execute","description":"\nExecutes arbitrary code.\n\nCode Execution\n\n Provided code will be executed in an async method.\n You can access a connected and authenticated SDK with the \"sdk\" variable.\n Templated variable passed as the command arguments are also accessible within the same name.\n Returned value will be printed on the standard output (e.g. 'return await sdk.server.now();').\n Errors will be caught and printed on the error output (e.g. 'throw new Error(\"failure\");').\n\nProvide code\n\n code can be passed with the --code flag\n code will be read from STDIN if available\n\n Examples:\n - kourou sdk:execute --code 'return await sdk.server.now()'\n - kourou sdk:execute --code 'return await sdk.index.exists(index)' --var 'index=\"iot-data\"'\n - kourou sdk:execute < snippet.js\n - echo 'return await sdk.server.now()' | kourou sdk:execute\n\nOther\n\n use the --editor flag to modify the code before executing it\n\n Examples:\n - kourou sdk:execute --code 'return await sdk.server.now()' --editor\n","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"code":{"name":"code","type":"option","description":"Code to execute. Will be read from STDIN if available."},"var":{"name":"var","type":"option","char":"v","description":"Additional arguments injected into the code. (eg: --var 'index=\"iot-data\"'"},"editor":{"name":"editor","type":"boolean","description":"Open an editor (EDITOR env variable) to edit the code before executing it.","allowNo":false},"keep-alive":{"name":"keep-alive","type":"boolean","description":"Keep the connection running (websocket only)","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[]},"sdk:query":{"id":"sdk:query","description":"\nExecutes an API query.\n\nQuery arguments\n\n Arguments can be passed and repeated using the --arg or -a flag.\n Index and collection names can be passed with --index (-i) and --collection (-c) flags\n ID can be passed with the --id flag.\n\n Examples:\n - kourou sdk:query document:delete -i iot -c sensors -a refresh=wait_for\n\nQuery body\n\n Body can be passed with the --body flag with either a JSON or JS string.\n Body will be read from STDIN if available\n\n Examples:\n - kourou sdk:query document:create -i iot -c sensors --body '{creation: Date.now())}'\n - kourou sdk:query admin:loadMappings < mappings.json\n - echo '{dynamic: \"strict\"}' | kourou sdk:query collection:create -i iot -c sensors\n\nOther\n\n Use the --editor flag to modify the query before sending it to Kuzzle\n Use the --display flag to display a specific property of the response\n\n Examples:\n - kourou sdk:query document:create -i iot -c sensors --editor\n - kourou sdk:query server:now --display 'result.now'\n\nDefault fallback to API method\n\n It's possible to use this command by only specifying the corresponding controller\n and action as first argument.\n Kourou will try to infer the first arguments to one the following pattern:\n - <command> <index>\n - <command> <index> <collection>\n - <command> <index> <collection> <id>\n - <command> <index> <collection> <body>\n - <command> <index> <collection> <id> <body>\n If a flag is given (-i, -c, --body or --id), then the flag value has prior to\n argument infering.\n\n Examples:\n - kourou collection:list iot\n - kourou collection:delete iot sensors\n - kourou document:createOrReplace iot sensors sigfox-1 '{}'\n - kourou bulk:import iot sensors '{bulkData: [...]}'\n - kourou admin:loadMappings < mappings.json\n","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"arg":{"name":"arg","type":"option","char":"a","description":"Additional argument. Repeatable. (e.g. \"-a refresh=wait_for\")"},"body":{"name":"body","type":"option","description":"Request body in JS or JSON format. Will be read from STDIN if available.","default":"{}"},"editor":{"name":"editor","type":"boolean","description":"Open an editor (EDITOR env variable) to edit the request before sending.","allowNo":false},"index":{"name":"index","type":"option","char":"i","description":"Index argument"},"collection":{"name":"collection","type":"option","char":"c","description":"Collection argument"},"id":{"name":"id","type":"option","description":"ID argument (_id)"},"display":{"name":"display","type":"option","description":"Path of the property to display from the response (empty string to display everything)","default":"result"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"controller:action","description":"Controller and action (eg: \"server:now\")","required":true}]},"user:export-mappings":{"id":"user:export-mappings","description":"Exports users collection mappings to JSON.","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"path":{"name":"path","type":"option","description":"Dump directory","default":"users"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[]},"user:export":{"id":"user:export","description":"\nExports users to JSON.\n\nThe users will be exported WITHOUT their credentials since Kuzzzle can't access them.\n\nYou can either:\n - Manually re-create credentials for your users\n - Use the \"mustChangePasswordIfSetByAdmin\" option Kuzzle password policies (see https://github.com/kuzzleio/kuzzle-plugin-auth-passport-local/#optional-properties)\n - Use the \"--generate-credentials\" flag to auto-generate credentials for your users\n\nAuto-generation of credentials\n\n With the \"--generate-credentials\" flag, Kourou will add credentials for the \"local\" strategy.\n By default, the username will be the user ID.\n Use the \"generated-username\" flag to use an other property than the user ID for the generated username\n The password will be a strong random 40 characters string\n\nExamples:\n\n - kourou user:export\n - kourou user:export --exclude '.*admin.*' --exclude 'supervisor.*'\n - kourou user:export --generate-credentials\n - kourou user:export --generate-credentials --generated-username content.email\n","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"path":{"name":"path","type":"option","description":"Dump directory","default":"users"},"exclude":{"name":"exclude","type":"option","description":"Exclude users by matching their IDs with a regexp"},"generate-credentials":{"name":"generate-credentials","type":"boolean","description":"Generate credentials with a random password for users","allowNo":false},"generated-username":{"name":"generated-username","type":"option","description":"User content property used as a username for local credentials","default":"_id"},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsFetchCount config)","default":"2000"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[]},"user:import-mappings":{"id":"user:import-mappings","description":"Imports users collection mappings","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"path","description":"Dump file","required":true}]},"user:import":{"id":"user:import","description":"Imports users","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"path","description":"Dump file","required":true}]},"vault:add":{"id":"vault:add","description":"\nAdds an encrypted key to an encrypted secrets file.\n\nA new secrets file is created if it does not yet exist.\n\nEncrypted secrets are meant to be loaded inside an application with Kuzzle Vault.\n\nSee https://github.com/kuzzleio/kuzzle-vault/ for more information.\n","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou vault:add config/secrets.enc.json aws.s3.keyId b61e267676660c314b006b06 --vault-key <vault-key>"],"flags":{"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"secrets-file","description":"Encrypted secrets file","required":true},{"name":"key","description":"Path to the key (lodash style)","required":true},{"name":"value","description":"Value to encrypt","required":true}]},"vault:decrypt":{"id":"vault:decrypt","description":"\nDecrypts an entire secrets file.\n\nDecrypted secrets file must NEVER be committed into the repository.\n\nSee https://github.com/kuzzleio/kuzzle-vault/ for more information.\n","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou vault:decrypt config/secrets.enc.json --vault-key <vault-key>","kourou vault:decrypt config/secrets.enc.json -o config/secrets.json --vault-key <vault-key>"],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"Overwrite the output file if it already exists","allowNo":false},"output-file":{"name":"output-file","type":"option","char":"o","description":"Output file (default: remove \".enc\")"},"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"file","description":"File containing encrypted secrets","required":true}]},"vault:encrypt":{"id":"vault:encrypt","description":"\nEncrypts an entire secrets file.\n\nThe secrets file must be in JSON format and it must contain only strings or objects.\n\nExample:\n{\n aws: {\n s3: {\n keyId: 'b61e267676660c314b006b06'\n }\n }\n}\n\nEncrypted secrets are meant to be loaded inside an application with Kuzzle Vault.\n\nSee https://github.com/kuzzleio/kuzzle-vault/ for more information.\n","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou vault:encrypt config/secrets.json --vault-key <vault-key>","kourou vault:encrypt config/secrets.json -o config/secrets_prod.enc.json --vault-key <vault-key>"],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"Overwrite the output file if it already exists","allowNo":false},"output-file":{"name":"output-file","type":"option","char":"o","description":"Output file (default: <file>.enc.json)"},"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"file","description":"File containing unencrypted secrets","required":true}]},"vault:show":{"id":"vault:show","description":"\nPrints an encrypted secrets file content.\n\nThis method can display either:\n - the entire content of the secrets file\n - a single key value\n\nSee https://github.com/kuzzleio/kuzzle-vault/ for more information.\n","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou vault:show config/secrets.enc.json --vault-key <vault-key>","kourou vault:show config/secrets.enc.json aws.s3.secretKey --vault-key <vault-key>"],"flags":{"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"secrets-file","description":"Encrypted secrets file","required":true},{"name":"key","description":"Path to a key (lodash style)"}]},"vault:test":{"id":"vault:test","description":"\nTests if an encrypted secrets file can be decrypted.\n\nSee https://github.com/kuzzleio/kuzzle-vault/ for more information.\n","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou vault:test config/secrets.enc.json --vault-key <vault-key>"],"flags":{"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"secrets-file","description":"Encrypted secrets file","required":true}]}}}
{
"name": "kourou",
"description": "The CLI that helps you manage your Kuzzle instances",
"version": "0.13.1",
"version": "0.14.0",
"author": "The Kuzzle Team <support@kuzzle.io>",

@@ -54,3 +54,3 @@ "bin": {

"engines": {
"node": ">=8.0.0"
"node": ">=10.0.0"
},

@@ -76,2 +76,3 @@ "files": [

],
"repositoryPrefix": "<%- commandPath %>",
"topics": {

@@ -108,2 +109,5 @@ "api-key": {

}
},
"hooks": {
"command_not_found": "./lib/hooks/command_not_found/api-method"
}

@@ -110,0 +114,0 @@ },

@@ -27,3 +27,3 @@ # kourou

$ kourou (-v|--version|version)
kourou/0.13.1 linux-x64 node-v12.18.1
kourou/0.14.0 linux-x64 node-v12.18.2
$ kourou --help [COMMAND]

@@ -68,5 +68,5 @@ USAGE

$ kourou sdk:query auth:getCurrentUser --as gordon --username admin --password admin
🚀 Kourou - Executes an API query.
[ℹ] Connecting to http://localhost:7512 ...

@@ -78,2 +78,36 @@ [ℹ] Impersonate user "gordon"

## Automatic command infering for API methods
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`_
.
- `<command> <index> <collection>`
* _eg: `kourou collection:truncate iot sensors`_
.
- `<command> <index> <collection> <body>`
* _eg: `kourou bulk:import iot sensors '{bulkData: []}'`_
.
- `<command> <index> <collection> <id>`
* _eg: `kourou document:delete iot sensors sigfox-123`_
.
- `<command> <index> <collection> <id> <body>`
* _eg: `kourou document:create iot sensors sigfox-123 '{temperature: 42}'`_
Then any argument will be passed as-is to the `sdk:query` method.
# Commands

@@ -86,8 +120,6 @@

* [`kourou api-key:search USER`](#kourou-api-keysearch-user)
* [`kourou collection:create INDEX COLLECTION`](#kourou-collectioncreate-index-collection)
* [`kourou collection:create INDEX COLLECTION [BODY]`](#kourou-collectioncreate-index-collection-body)
* [`kourou collection:export INDEX COLLECTION`](#kourou-collectionexport-index-collection)
* [`kourou collection:import PATH`](#kourou-collectionimport-path)
* [`kourou config:diff FIRST SECOND`](#kourou-configdiff-first-second)
* [`kourou document:create INDEX COLLECTION`](#kourou-documentcreate-index-collection)
* [`kourou document:get INDEX COLLECTION ID`](#kourou-documentget-index-collection-id)
* [`kourou document:search INDEX COLLECTION`](#kourou-documentsearch-index-collection)

@@ -104,2 +136,4 @@ * [`kourou es:get INDEX ID`](#kourou-esget-index-id)

* [`kourou index:import PATH`](#kourou-indeximport-path)
* [`kourou instance:kill`](#kourou-instancekill)
* [`kourou instance:list`](#kourou-instancelist)
* [`kourou instance:logs`](#kourou-instancelogs)

@@ -115,3 +149,5 @@ * [`kourou instance:spawn`](#kourou-instancespawn)

* [`kourou user:export`](#kourou-userexport)
* [`kourou user:export-mappings`](#kourou-userexport-mappings)
* [`kourou user:import PATH`](#kourou-userimport-path)
* [`kourou user:import-mappings PATH`](#kourou-userimport-mappings-path)
* [`kourou vault:add SECRETS-FILE KEY VALUE`](#kourou-vaultadd-secrets-file-key-value)

@@ -148,3 +184,3 @@ * [`kourou vault:decrypt FILE`](#kourou-vaultdecrypt-file)

_See code: [src/commands/api-key/check.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/api-key/check.ts)_
_See code: [src/commands/api-key/check.ts](src/commands/api-key/check.ts)_

@@ -176,3 +212,3 @@ ## `kourou api-key:create USER`

_See code: [src/commands/api-key/create.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/api-key/create.ts)_
_See code: [src/commands/api-key/create.ts](src/commands/api-key/create.ts)_

@@ -205,3 +241,3 @@ ## `kourou api-key:delete USER ID`

_See code: [src/commands/api-key/delete.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/api-key/delete.ts)_
_See code: [src/commands/api-key/delete.ts](src/commands/api-key/delete.ts)_

@@ -231,5 +267,5 @@ ## `kourou api-key:search USER`

_See code: [src/commands/api-key/search.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/api-key/search.ts)_
_See code: [src/commands/api-key/search.ts](src/commands/api-key/search.ts)_
## `kourou collection:create INDEX COLLECTION`
## `kourou collection:create INDEX COLLECTION [BODY]`

@@ -240,3 +276,3 @@ Creates a collection

USAGE
$ kourou collection:create INDEX COLLECTION
$ kourou collection:create INDEX COLLECTION [BODY]

@@ -246,25 +282,16 @@ ARGUMENTS

COLLECTION Collection name
BODY Collection mappings and settings in JS or JSON format. Will be read from STDIN if available
OPTIONS
--as=as Impersonate a user
--body=body [default: {}] Collection mappings and settings in JS or JSON format. Will be read from STDIN if
available
--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: http] Kuzzle protocol (http or ws)
--ssl Use SSL to connect to Kuzzle
--username=username [default: anonymous] Kuzzle username (local strategy)
```
_See code: [src/commands/collection/create.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/collection/create.ts)_
_See code: [src/commands/collection/create.ts](src/commands/collection/create.ts)_

@@ -302,3 +329,3 @@ ## `kourou collection:export INDEX COLLECTION`

_See code: [src/commands/collection/export.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/collection/export.ts)_
_See code: [src/commands/collection/export.ts](src/commands/collection/export.ts)_

@@ -331,3 +358,3 @@ ## `kourou collection:import PATH`

_See code: [src/commands/collection/import.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/collection/import.ts)_
_See code: [src/commands/collection/import.ts](src/commands/collection/import.ts)_

@@ -354,62 +381,4 @@ ## `kourou config:diff FIRST SECOND`

_See code: [src/commands/config/diff.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/config/diff.ts)_
_See code: [src/commands/config/diff.ts](src/commands/config/diff.ts)_
## `kourou document:create INDEX COLLECTION`
Creates a document
```
USAGE
$ kourou document:create INDEX COLLECTION
ARGUMENTS
INDEX Index name
COLLECTION Collection name
OPTIONS
--as=as Impersonate a user
--body=body [default: {}] Document body in JS or JSON format. Will be read from STDIN if available
--help show CLI help
--host=host [default: localhost] Kuzzle server host
--id=id Optional document ID
--password=password Kuzzle user password
--port=port [default: 7512] Kuzzle server port
--protocol=protocol [default: http] Kuzzle protocol (http or ws)
--replace Replaces the document if it already exists
--ssl Use SSL to connect to Kuzzle
--username=username [default: anonymous] Kuzzle username (local strategy)
EXAMPLES
kourou document:create iot sensors --body '{network: "sigfox"}'
kourou document:create iot sensors < document.json
```
_See code: [src/commands/document/create.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/document/create.ts)_
## `kourou document:get INDEX COLLECTION ID`
Gets a document
```
USAGE
$ kourou document:get INDEX COLLECTION ID
ARGUMENTS
INDEX Index name
COLLECTION Collection name
ID Document ID
OPTIONS
--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: http] Kuzzle protocol (http or ws)
--ssl Use SSL to connect to Kuzzle
--username=username [default: anonymous] Kuzzle username (local strategy)
```
_See code: [src/commands/document/get.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/document/get.ts)_
## `kourou document:search INDEX COLLECTION`

@@ -448,3 +417,3 @@

_See code: [src/commands/document/search.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/document/search.ts)_
_See code: [src/commands/document/search.ts](src/commands/document/search.ts)_

@@ -469,3 +438,3 @@ ## `kourou es:get INDEX ID`

_See code: [src/commands/es/get.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/es/get.ts)_
_See code: [src/commands/es/get.ts](src/commands/es/get.ts)_

@@ -491,3 +460,3 @@ ## `kourou es:insert INDEX`

_See code: [src/commands/es/insert.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/es/insert.ts)_
_See code: [src/commands/es/insert.ts](src/commands/es/insert.ts)_

@@ -509,3 +478,3 @@ ## `kourou es:list-index`

_See code: [src/commands/es/list-index.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/es/list-index.ts)_
_See code: [src/commands/es/list-index.ts](src/commands/es/list-index.ts)_

@@ -533,3 +502,3 @@ ## `kourou file:decrypt FILE`

_See code: [src/commands/file/decrypt.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/file/decrypt.ts)_
_See code: [src/commands/file/decrypt.ts](src/commands/file/decrypt.ts)_

@@ -557,3 +526,3 @@ ## `kourou file:encrypt FILE`

_See code: [src/commands/file/encrypt.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/file/encrypt.ts)_
_See code: [src/commands/file/encrypt.ts](src/commands/file/encrypt.ts)_

@@ -578,3 +547,3 @@ ## `kourou file:test FILE`

_See code: [src/commands/file/test.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/file/test.ts)_
_See code: [src/commands/file/test.ts](src/commands/file/test.ts)_

@@ -622,3 +591,3 @@ ## `kourou help [COMMAND]`

_See code: [src/commands/import.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/import.ts)_
_See code: [src/commands/import.ts](src/commands/import.ts)_

@@ -649,3 +618,3 @@ ## `kourou index:export INDEX`

_See code: [src/commands/index/export.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/index/export.ts)_
_See code: [src/commands/index/export.ts](src/commands/index/export.ts)_

@@ -681,4 +650,30 @@ ## `kourou index:import PATH`

_See code: [src/commands/index/import.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/index/import.ts)_
_See code: [src/commands/index/import.ts](src/commands/index/import.ts)_
## `kourou instance:kill`
Stop and remove all the containers of a running kuzzle instance
```
USAGE
$ kourou instance:kill
OPTIONS
-a, --all Kill all instances
-i, --instance=instance Kuzzle instance name [ex: stack-0]
```
_See code: [src/commands/instance/kill.ts](src/commands/instance/kill.ts)_
## `kourou instance:list`
Lists the Kuzzle running instances
```
USAGE
$ kourou instance:list
```
_See code: [src/commands/instance/list.ts](src/commands/instance/list.ts)_
## `kourou instance:logs`

@@ -697,3 +692,3 @@

_See code: [src/commands/instance/logs.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/instance/logs.ts)_
_See code: [src/commands/instance/logs.ts](src/commands/instance/logs.ts)_

@@ -714,3 +709,3 @@ ## `kourou instance:spawn`

_See code: [src/commands/instance/spawn.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/instance/spawn.ts)_
_See code: [src/commands/instance/spawn.ts](src/commands/instance/spawn.ts)_

@@ -737,3 +732,3 @@ ## `kourou profile:export`

_See code: [src/commands/profile/export.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/profile/export.ts)_
_See code: [src/commands/profile/export.ts](src/commands/profile/export.ts)_

@@ -762,3 +757,3 @@ ## `kourou profile:import PATH`

_See code: [src/commands/profile/import.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/profile/import.ts)_
_See code: [src/commands/profile/import.ts](src/commands/profile/import.ts)_

@@ -785,3 +780,3 @@ ## `kourou role:export`

_See code: [src/commands/role/export.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/role/export.ts)_
_See code: [src/commands/role/export.ts](src/commands/role/export.ts)_

@@ -811,3 +806,3 @@ ## `kourou role:import PATH`

_See code: [src/commands/role/import.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/role/import.ts)_
_See code: [src/commands/role/import.ts](src/commands/role/import.ts)_

@@ -866,3 +861,3 @@ ## `kourou sdk:execute`

_See code: [src/commands/sdk/execute.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/sdk/execute.ts)_
_See code: [src/commands/sdk/execute.ts](src/commands/sdk/execute.ts)_

@@ -896,2 +891,4 @@ ## `kourou sdk:query CONTROLLER:ACTION`

--id=id ID argument (_id)
--password=password Kuzzle user password

@@ -912,12 +909,13 @@

arguments can be passed and repeated using the --arg or -a flag.
index and collection names can be passed with --index (-i) and --collection (-c) flags
Arguments can be passed and repeated using the --arg or -a flag.
Index and collection names can be passed with --index (-i) and --collection (-c) flags
ID can be passed with the --id flag.
Examples:
- kourou sdk:query document:get -i iot -c sensors -a _id=sigfox-42
- kourou sdk:query document:delete -i iot -c sensors -a refresh=wait_for
Query body
body can be passed with the --body flag with either a JSON or JS string.
body will be read from STDIN if available
Body can be passed with the --body flag with either a JSON or JS string.
Body will be read from STDIN if available

@@ -931,4 +929,4 @@ Examples:

use the --editor flag to modify the query before sending it to Kuzzle
use the --display flag to display a specific property of the response
Use the --editor flag to modify the query before sending it to Kuzzle
Use the --display flag to display a specific property of the response

@@ -938,5 +936,25 @@ Examples:

- kourou sdk:query server:now --display 'result.now'
Default fallback to API method
It's possible to use this command by only specifying the corresponding controller
and action as first argument.
Kourou will try to infer the first arguments to one the following pattern:
- <command> <index>
- <command> <index> <collection>
- <command> <index> <collection> <id>
- <command> <index> <collection> <body>
- <command> <index> <collection> <id> <body>
If a flag is given (-i, -c, --body or --id), then the flag value has prior to
argument infering.
Examples:
- kourou collection:list iot
- kourou collection:delete iot sensors
- kourou document:createOrReplace iot sensors sigfox-1 '{}'
- kourou bulk:import iot sensors '{bulkData: [...]}'
- kourou admin:loadMappings < mappings.json
```
_See code: [src/commands/sdk/query.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/sdk/query.ts)_
_See code: [src/commands/sdk/query.ts](src/commands/sdk/query.ts)_

@@ -993,3 +1011,3 @@ ## `kourou subscribe INDEX COLLECTION`

_See code: [src/commands/subscribe.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/subscribe.ts)_
_See code: [src/commands/subscribe.ts](src/commands/subscribe.ts)_

@@ -1045,4 +1063,26 @@ ## `kourou user:export`

_See code: [src/commands/user/export.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/user/export.ts)_
_See code: [src/commands/user/export.ts](src/commands/user/export.ts)_
## `kourou user:export-mappings`
Exports users collection mappings to JSON.
```
USAGE
$ kourou user:export-mappings
OPTIONS
--as=as Impersonate a user
--help show CLI help
--host=host [default: localhost] Kuzzle server host
--password=password Kuzzle user password
--path=path [default: users] Dump directory
--port=port [default: 7512] Kuzzle server port
--protocol=protocol [default: ws] Kuzzle protocol (http or websocket)
--ssl Use SSL to connect to Kuzzle
--username=username [default: anonymous] Kuzzle username (local strategy)
```
_See code: [src/commands/user/export-mappings.ts](src/commands/user/export-mappings.ts)_
## `kourou user:import PATH`

@@ -1070,4 +1110,28 @@

_See code: [src/commands/user/import.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/user/import.ts)_
_See code: [src/commands/user/import.ts](src/commands/user/import.ts)_
## `kourou user:import-mappings PATH`
Imports users collection mappings
```
USAGE
$ kourou user:import-mappings PATH
ARGUMENTS
PATH Dump file
OPTIONS
--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 websocket)
--ssl Use SSL to connect to Kuzzle
--username=username [default: anonymous] Kuzzle username (local strategy)
```
_See code: [src/commands/user/import-mappings.ts](src/commands/user/import-mappings.ts)_
## `kourou vault:add SECRETS-FILE KEY VALUE`

@@ -1102,3 +1166,3 @@

_See code: [src/commands/vault/add.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/vault/add.ts)_
_See code: [src/commands/vault/add.ts](src/commands/vault/add.ts)_

@@ -1133,3 +1197,3 @@ ## `kourou vault:decrypt FILE`

_See code: [src/commands/vault/decrypt.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/vault/decrypt.ts)_
_See code: [src/commands/vault/decrypt.ts](src/commands/vault/decrypt.ts)_

@@ -1175,3 +1239,3 @@ ## `kourou vault:encrypt FILE`

_See code: [src/commands/vault/encrypt.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/vault/encrypt.ts)_
_See code: [src/commands/vault/encrypt.ts](src/commands/vault/encrypt.ts)_

@@ -1207,3 +1271,3 @@ ## `kourou vault:show SECRETS-FILE [KEY]`

_See code: [src/commands/vault/show.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/vault/show.ts)_
_See code: [src/commands/vault/show.ts](src/commands/vault/show.ts)_

@@ -1233,3 +1297,3 @@ ## `kourou vault:test SECRETS-FILE`

_See code: [src/commands/vault/test.ts](https://github.com/kuzzleio/kourou/blob/v0.13.1/src/commands/vault/test.ts)_
_See code: [src/commands/vault/test.ts](src/commands/vault/test.ts)_
<!-- commandsstop -->

@@ -1236,0 +1300,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc