feat(coding-agent): add pi config TUI to manage resources

Adds a new 'pi config' command with a TUI to list and toggle package
resources (extensions, skills, prompts, themes).

- Displays resources grouped by source (packages, user, project)
- Subgroups by resource type (Extensions, Skills, Prompts, Themes)
- Toggle enabled/disabled state with space
- Filter resources by typing
- Supports +pattern for force-include, !pattern for exclude
- Properly reads exclusion patterns from settings.json

fixes #938
This commit is contained in:
Mario Zechner 2026-01-25 03:12:21 +01:00
parent ef5149fdf6
commit 150128fd2c
5 changed files with 977 additions and 0 deletions

View file

@ -9,6 +9,7 @@ import { type ImageContent, modelsAreEqual, supportsXhigh } from "@mariozechner/
import chalk from "chalk";
import { createInterface } from "readline";
import { type Args, parseArgs, printHelp } from "./cli/args.js";
import { selectConfig } from "./cli/config-selector.js";
import { processFileArguments } from "./cli/file-processor.js";
import { listModels } from "./cli/list-models.js";
import { selectSession } from "./cli/session-picker.js";
@ -424,11 +425,37 @@ function buildSessionOptions(
return options;
}
async function handleConfigCommand(args: string[]): Promise<boolean> {
if (args[0] !== "config") {
return false;
}
const cwd = process.cwd();
const agentDir = getAgentDir();
const settingsManager = SettingsManager.create(cwd, agentDir);
const packageManager = new DefaultPackageManager({ cwd, agentDir, settingsManager });
const resolvedPaths = await packageManager.resolve();
await selectConfig({
resolvedPaths,
settingsManager,
cwd,
agentDir,
});
process.exit(0);
}
export async function main(args: string[]) {
if (await handlePackageCommand(args)) {
return;
}
if (await handleConfigCommand(args)) {
return;
}
// Run migrations (pass cwd for project-local migrations)
const { migratedAuthProviders: migratedProviders, deprecationWarnings } = runMigrations(process.cwd());