feat: update CLI commands to new structure and enhance settings handling

This commit is contained in:
catlog22
2026-01-04 19:56:40 +08:00
parent 27a0129f72
commit 2a13d8b17f
4 changed files with 57 additions and 20 deletions

View File

@@ -939,9 +939,10 @@ async function executeCodexLens(args: string[], options: ExecuteOptions = {}): P
async function initIndex(params: Params): Promise<ExecuteResult> {
const { path = '.', languages } = params;
const args = ['init', path];
// Use 'index init' subcommand (new CLI structure)
const args = ['index', 'init', path];
if (languages && languages.length > 0) {
args.push('--languages', languages.join(','));
args.push('--language', languages.join(','));
}
return executeCodexLens(args, { cwd: path });

View File

@@ -658,9 +658,10 @@ async function executeInitAction(params: Params): Promise<SearchResult> {
}
// Build args with --no-embeddings for FTS-only index (faster)
const args = ['init', path, '--no-embeddings'];
// Use 'index init' subcommand (new CLI structure)
const args = ['index', 'init', path, '--no-embeddings'];
if (languages && languages.length > 0) {
args.push('--languages', languages.join(','));
args.push('--language', languages.join(','));
}
// Track progress updates
@@ -750,9 +751,10 @@ async function executeUpdateAction(params: Params): Promise<SearchResult> {
}
// Build args for incremental init (without --force)
const args = ['init', path];
// Use 'index init' subcommand (new CLI structure)
const args = ['index', 'init', path];
if (languages && languages.length > 0) {
args.push('--languages', languages.join(','));
args.push('--language', languages.join(','));
}
// Track progress updates
@@ -2398,9 +2400,10 @@ export async function executeInitWithProgress(
};
}
const args = ['init', path];
// Use 'index init' subcommand (new CLI structure)
const args = ['index', 'init', path];
if (languages && languages.length > 0) {
args.push('--languages', languages.join(','));
args.push('--language', languages.join(','));
}
// Track progress updates