diff --git a/cortex-js/src/command.module.ts b/cortex-js/src/command.module.ts index 667e13934..91935de69 100644 --- a/cortex-js/src/command.module.ts +++ b/cortex-js/src/command.module.ts @@ -6,7 +6,6 @@ import { CortexModule } from './usecases/cortex/cortex.module'; import { ServeCommand } from './infrastructure/commanders/serve.command'; import { ModelsCommand } from './infrastructure/commanders/models.command'; import { ExtensionModule } from './infrastructure/repositories/extensions/extension.module'; -import { InitCommand } from './infrastructure/commanders/init.command'; import { HttpModule } from '@nestjs/axios'; import { InitRunModeQuestions } from './infrastructure/commanders/questions/init.questions'; import { ModelListCommand } from './infrastructure/commanders/models/model-list.command'; @@ -76,7 +75,6 @@ import { EnginesInitCommand } from './infrastructure/commanders/engines/engines- ModelsCommand, ServeCommand, ChatCommand, - InitCommand, PSCommand, KillCommand, PresetCommand, diff --git a/cortex-js/src/infrastructure/commanders/cortex-command.commander.ts b/cortex-js/src/infrastructure/commanders/cortex-command.commander.ts index 9ba0d23ed..8b5663b30 100644 --- a/cortex-js/src/infrastructure/commanders/cortex-command.commander.ts +++ b/cortex-js/src/infrastructure/commanders/cortex-command.commander.ts @@ -2,7 +2,6 @@ import { RootCommand, CommandRunner } from 'nest-commander'; import { ServeCommand } from './serve.command'; import { ChatCommand } from './chat.command'; import { ModelsCommand } from './models.command'; -import { InitCommand } from './init.command'; import { RunCommand } from './shortcuts/run.command'; import { ModelPullCommand } from './models/model-pull.command'; import { PSCommand } from './ps.command'; @@ -24,7 +23,6 @@ import { ConfigsCommand } from './configs.command'; ModelsCommand, ServeCommand, ChatCommand, - InitCommand, RunCommand, ModelPullCommand, PSCommand, diff --git a/cortex-js/src/infrastructure/commanders/init.command.ts b/cortex-js/src/infrastructure/commanders/init.command.ts deleted file mode 100644 index e9999d562..000000000 --- a/cortex-js/src/infrastructure/commanders/init.command.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { - CommandRunner, - InquirerService, - SubCommand, - Option, -} from 'nest-commander'; -import { InitCliUsecases } from './usecases/init.cli.usecases'; -import { InitOptions } from './types/init-options.interface'; -import { SetCommandContext } from './decorators/CommandContext'; -import { TelemetryUsecases } from '@/usecases/telemetry/telemetry.usecases'; -import { - EventName, - TelemetrySource, -} from '@/domain/telemetry/telemetry.interface'; -import { ContextService } from '../services/context/context.service'; - -@SubCommand({ - name: 'init', - aliases: ['setup'], - arguments: '[version]', - description: "Init settings and download cortex's dependencies", - argsDescription: { - version: 'Version of cortex engine', - }, -}) -@SetCommandContext() -export class InitCommand extends CommandRunner { - constructor( - private readonly inquirerService: InquirerService, - private readonly initUsecases: InitCliUsecases, - readonly contextService: ContextService, - private readonly telemetryUsecases: TelemetryUsecases, - ) { - super(); - } - - async run(passedParams: string[], options?: InitOptions): Promise { - if (options?.silent) { - await this.initUsecases.installEngine(undefined); - } else { - options = await this.inquirerService.ask( - 'init-run-mode-questions', - options, - ); - - const version = passedParams[0] ?? 'latest'; - - await this.initUsecases.installEngine(options, version); - this.telemetryUsecases.sendEvent( - [ - { - name: EventName.INIT, - }, - ], - TelemetrySource.CLI, - ); - } - console.log('Cortex engines installed successfully!'); - } - - @Option({ - flags: '-s, --silent', - description: 'Init without asking questions', - defaultValue: false, - }) - parseSilent() { - return true; - } -}