feat: add silky cli tools
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { checkFileExists, AssistantConfig } from '@/module/assistant/index.ts';
|
||||
import { checkFileExists, AssistantConfig, AssistantConfigData } from '@/module/assistant/index.ts';
|
||||
import { chalk } from '@/module/chalk.ts';
|
||||
import { HttpsPem } from '@/module/assistant/https/sign.ts';
|
||||
export type AssistantInitOptions = {
|
||||
@@ -66,13 +66,16 @@ export class AssistantInit extends AssistantConfig {
|
||||
const assistantPath = this.configPath?.configPath;
|
||||
// 创建助手配置文件 assistant-config.json
|
||||
if (!checkFileExists(assistantPath, true)) {
|
||||
this.setConfig({
|
||||
description: '助手配置文件',
|
||||
home: '/root/center',
|
||||
proxy: [],
|
||||
apiProxyList: [],
|
||||
});
|
||||
this.setConfig(this.getDefaultInitAssistantConfig());
|
||||
console.log(chalk.green('助手配置文件assistant-config.json创建成功'));
|
||||
}
|
||||
}
|
||||
protected getDefaultInitAssistantConfig() {
|
||||
return {
|
||||
description: '助手配置文件',
|
||||
home: '/root/center',
|
||||
proxy: [],
|
||||
apiProxyList: [],
|
||||
} as AssistantConfigData;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user