steadybit
Version:
Command-line interface to interact with the Steadybit API
48 lines • 3.35 kB
JavaScript
;
// SPDX-License-Identifier: MIT
// SPDX-FileCopyrightText: 2022 Steadybit GmbH
Object.defineProperty(exports, "__esModule", { value: true });
const commander_1 = require("commander");
const exec_1 = require("../experiment/exec");
const get_1 = require("../experiment/get");
const dump_1 = require("../experiment/dump");
const apply_1 = require("../experiment/apply");
const delete_1 = require("../experiment/delete");
const requirements_1 = require("./requirements");
const program = new commander_1.Command();
program
.command('run')
.alias('exec')
.description('Executes an experiment run. If a file is specified the experiment is saved before execution.')
.addOption(new commander_1.Option('-k, --key <key>', 'The experiment key.').conflicts('file'))
.addOption(new commander_1.Option('-f, --file <files...>', 'The path to the experiment file or a directory containing multiple files.').conflicts('key'))
.addOption(new commander_1.Option('-R, --recursive', 'Process the directory used in -f, --file recursively. Useful when you want to manage related experiments organized within the same directory.').default(false))
.addOption(new commander_1.Option('--no-wait', 'Do not wait for experiment run to finish.'))
.addOption(new commander_1.Option('--yes', 'Skip the prompt asking for experiment run confirmation. Not necessary when no TTY is attached.').default(false))
.action((0, requirements_1.requirePlatformAccess)(exec_1.executeExperiments));
program
.command('get')
.description('Get an experiment from Steadybit. Output is written to file or stdout.')
.addOption(new commander_1.Option('-k, --key <key>', 'The experiment key.').makeOptionMandatory(true))
.addOption(new commander_1.Option('-f, --file <file>', 'The path to the experiment file.'))
.action((0, requirements_1.requirePlatformAccess)(get_1.getExperiment));
program
.command('apply')
.description('Upload an experiment to Steadybit. If a key is provided, an update is performed. Otherwise, the externalId from the yaml is used to create or update the experiment.')
.addOption(new commander_1.Option('-k, --key <key>', 'The experiment key.'))
.addOption(new commander_1.Option('-f, --file <files...>', 'The path to the experiment file or a directory containing multiple files').makeOptionMandatory(true))
.addOption(new commander_1.Option('-R, --recursive', 'Process the directory used in -f, --file recursively. Useful when you want to manage related experiments organized within the same directory.').default(false))
.action((0, requirements_1.requirePlatformAccess)(apply_1.applyExperiments));
program
.command('delete')
.description('Delete an experiment from Steadybit.')
.addOption(new commander_1.Option('-k, --key <key>', 'The experiment key.').makeOptionMandatory(true))
.action((0, requirements_1.requirePlatformAccess)(delete_1.deleteExperiment));
program
.command('dump')
.description('Dump all experiments and executions from all teams in Steadybit.')
.addOption(new commander_1.Option('-d, --directory <dir>', 'The path to dump all the experiments to').default('.'))
.action((0, requirements_1.requirePlatformAccess)(dump_1.dump));
program.parseAsync(process.argv);
//# sourceMappingURL=steadybit-experiment.js.map