@strapi/strapi
Version:
An open source headless CMS solution to create and manage your own API. It provides a powerful dashboard and features to make your life easier. Databases supported: MySQL, MariaDB, PostgreSQL, SQLite
18 lines (15 loc) • 1.43 kB
JavaScript
import { createCommand, Option } from 'commander';
import { excludeOption, onlyOption, throttleOption, validateExcludeOnly } from '../../utils/data-transfer.mjs';
import { promptEncryptionKey } from '../../utils/commander.mjs';
import action from './action.mjs';
import { prepareExportDirFormatCli } from './validate-dir-format.mjs';
/**
* `$ strapi export`
*/ const command = ()=>{
return createCommand('export').description('Export data from Strapi to file').allowExcessArguments(false).addOption(new Option('--no-encrypt', `Disables 'aes-128-ecb' encryption of the output file`).default(true)).addOption(new Option('--no-compress', 'Disables gzip compression of output file').default(true)).addOption(new Option('--verbose', 'Enable verbose logs')).addOption(new Option('-k, --key <string>', 'Provide encryption key in command instead of using the prompt')).addOption(new Option('-f, --file <file>', 'tar: base name without extensions; dir: output directory path (--format dir)')).addOption(new Option('--format <format>', 'export as tar archive or unpacked directory').choices([
'tar',
'dir'
]).default('tar')).addOption(excludeOption).addOption(onlyOption).addOption(throttleOption).hook('preAction', validateExcludeOnly).hook('preAction', prepareExportDirFormatCli).hook('preAction', promptEncryptionKey).action(action);
};
export { command as default };
//# sourceMappingURL=command.mjs.map