import "reflect-metadata"; import { CacheClearCommand } from "typeorm/commands/CacheClearCommand"; import { EntityCreateCommand } from "typeorm/commands/EntityCreateCommand"; import { QueryCommand } from "typeorm/commands/QueryCommand"; import { SchemaLogCommand } from "typeorm/commands/SchemaLogCommand"; import { SubscriberCreateCommand } from "typeorm/commands/SubscriberCreateCommand"; import yargonaut from "yargonaut"; import yargs from "yargs"; import { MigrationCreateCommand } from "../lib/commands/MigrationCreateCommand"; import { MigrationGenerateCommand } from "../lib/commands/MigrationGenerateCommand"; import { MigrationRevertCommand } from "../lib/commands/MigrationRevertCommand"; import { MigrationRollupCommand } from "../lib/commands/MigrationRollupCommand"; import { MigrationRunCommand } from "../lib/commands/MigrationRunCommand"; import { MigrationShowCommand } from "../lib/commands/MigrationShowCommand"; import { SchemaCreateCommand } from "../lib/commands/SchemaCreateCommand"; import { SchemaDropCommand } from "../lib/commands/SchemaDropCommand"; import { SchemaSyncCommand } from "../lib/commands/SchemaSyncCommand"; // This is a straight port of TypeORM's command line utilities and includes a bunch of them verbatim. TypeORM's normal command line utilities don't support passing in any kind of custom options, which we use for better logging, naming strategies, automatic environment-specific connection selection, etc. So, we've forked the command line utilities in TypeORM that use a connection and switched them to using Starscream's connection factory stuff. That way, it's always the same! Woop! const _command = yargs .usage("Usage: $0 [options]") .command(new SchemaSyncCommand()) .command(new SchemaLogCommand()) .command(new SchemaCreateCommand()) .command(new SchemaDropCommand()) .command(new QueryCommand()) .command(new EntityCreateCommand()) .command(new SubscriberCreateCommand()) .command(new MigrationCreateCommand()) .command(new MigrationGenerateCommand()) .command(new MigrationRunCommand()) .command(new MigrationShowCommand()) .command(new MigrationRevertCommand()) .command(new MigrationRollupCommand()) .command(new CacheClearCommand()) .recommendCommands() .demandCommand(1) .strict() .alias("v", "version") .help("h") .alias("h", "help").argv; yargonaut.style("blue").style("yellow", "required").helpStyle("green").errorsStyle("red");