fix(coding-agent): git temp path resolution, add pi list command (#645)

- Fix getGitInstallPath to check scope === 'temporary' directly
- Remove redundant temporary parameter from git methods
- Add 'pi list' command to show installed extensions from settings
This commit is contained in:
Mario Zechner 2026-01-21 00:00:33 +01:00
parent 4058680d22
commit 8ec7d6867a
4 changed files with 46 additions and 15 deletions

View file

@ -53,7 +53,7 @@ async function readPipedStdin(): Promise<string | undefined> {
});
}
type PackageCommand = "install" | "remove" | "update";
type PackageCommand = "install" | "remove" | "update" | "list";
interface PackageCommandOptions {
command: PackageCommand;
@ -63,7 +63,7 @@ interface PackageCommandOptions {
function parsePackageCommand(args: string[]): PackageCommandOptions | undefined {
const [command, ...rest] = args;
if (command !== "install" && command !== "remove" && command !== "update") {
if (command !== "install" && command !== "remove" && command !== "update" && command !== "list") {
return undefined;
}
@ -165,6 +165,35 @@ async function handlePackageCommand(args: string[]): Promise<boolean> {
return true;
}
if (options.command === "list") {
const globalSettings = settingsManager.getGlobalSettings();
const projectSettings = settingsManager.getProjectSettings();
const globalExtensions = globalSettings.extensions ?? [];
const projectExtensions = projectSettings.extensions ?? [];
if (globalExtensions.length === 0 && projectExtensions.length === 0) {
console.log(chalk.dim("No extensions installed."));
return true;
}
if (globalExtensions.length > 0) {
console.log(chalk.bold("Global extensions:"));
for (const ext of globalExtensions) {
console.log(` ${ext}`);
}
}
if (projectExtensions.length > 0) {
if (globalExtensions.length > 0) console.log();
console.log(chalk.bold("Project extensions:"));
for (const ext of projectExtensions) {
console.log(` ${ext}`);
}
}
return true;
}
await packageManager.update(options.source);
if (options.source) {
console.log(chalk.green(`Updated ${options.source}`));