@keyshade/cli
Version:
52 lines (46 loc) • 1.79 kB
text/typescript
import 'dotenv/config'
import { Command } from 'commander'
import type BaseCommand from './commands/base.command'
import InitCommand from './commands/init.command'
import RunCommand from './commands/run.command'
import ProfileCommand from './commands/profile.command'
import EnvironmentCommand from './commands/environment.command'
import WorkspaceCommand from '@/commands/workspace.command'
import ScanCommand from '@/commands/scan.command'
import ProjectCommand from './commands/project.command'
import SecretCommand from './commands/secret.command'
import VariableCommand from './commands/variable.command'
import { version } from '../package.json'
import ConfigCommand from './commands/config.command'
import IntegrationCommand from './commands/integration.command'
import LoginCommand from './commands/login.command'
import ResetCommand from './commands/reset.command'
import PatCommand from '@/commands/pat.command'
import ImportCommand from '@/commands/import.command'
const program = new Command()
program.name('keyshade')
program.version(version, '-V, --version', 'Output the current version')
program.option('--profile <string>', 'The profile to use')
program.option('--token <string>', 'Token used to authenticate your requests')
program.option('-u, --base-url <string>', 'The base URL to use')
const COMMANDS: BaseCommand[] = [
new LoginCommand(),
new InitCommand(),
new ImportCommand(),
new RunCommand(),
new ProfileCommand(),
new ResetCommand(),
new WorkspaceCommand(),
new ProjectCommand(),
new EnvironmentCommand(),
new SecretCommand(),
new VariableCommand(),
new ConfigCommand(),
new IntegrationCommand(),
new ScanCommand(),
new PatCommand()
]
COMMANDS.forEach((command) => {
command.prepare(program)
})
program.parse(process.argv)