feat: quarantine cleanup on failure, federated search by default

- Hoist cloneResult above try block so catch can clean up temp dir
  on any failure path, not just the happy path
- Always include GitHub API in find search results (was behind
  --federated flag, now default)
This commit is contained in:
Rohit Ghumare
2026-04-11 11:45:03 +01:00
parent dc3f9ba330
commit da14f329fd
2 changed files with 10 additions and 7 deletions
+4 -5
View File
@@ -60,8 +60,9 @@ export class FindCommand extends Command {
description: "Minimal output (just list skills)",
});
federated = Option.Boolean("--federated,-f", false, {
description: "Search external registries (GitHub SKILL.md files)",
federated = Option.Boolean("--federated,-f", true, {
description: "Search external registries (enabled by default)",
hidden: true,
});
async execute(): Promise<number> {
@@ -162,9 +163,7 @@ export class FindCommand extends Command {
s.start("Searching skills.sh + external registries...");
const fedSearch = new FederatedSearch();
fedSearch.addRegistry(new SkillsShRegistry());
if (this.federated) {
fedSearch.addRegistry(new GitHubSkillRegistry());
}
fedSearch.addRegistry(new GitHubSkillRegistry());
try {
const fedResult = await fedSearch.search(searchTerm, {
limit: parseInt(this.limit, 10) || 10,
+6 -2
View File
@@ -132,14 +132,17 @@ export class InstallCommand extends Command {
const isInteractive =
process.stdin.isTTY && !this.skills && !this.all && !this.yes;
const s = spinner();
let cloneResult: Awaited<ReturnType<typeof this.resolveSource>>["cloneResult"] = null;
try {
if (process.stdin.isTTY && !this.quiet) {
welcome();
}
const { providerAdapter, cloneResult } = await this.resolveSource(s);
if (!providerAdapter || !cloneResult) return 1;
const resolved = await this.resolveSource(s);
if (!resolved.providerAdapter || !resolved.cloneResult) return 1;
const providerAdapter = resolved.providerAdapter;
cloneResult = resolved.cloneResult;
const discoveredSkills = cloneResult.discoveredSkills || [];
@@ -175,6 +178,7 @@ export class InstallCommand extends Command {
return 0;
} catch (err) {
if (cloneResult) this.cleanupTemp(cloneResult);
s.stop(colors.error("Installation failed"));
console.log(colors.muted(err instanceof Error ? err.message : String(err)));
return 1;