diff --git a/README.md b/README.md index b62aeaf..f55013b 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,8 @@ coderrr market coderrr install web-scraper # List installed skills -coderrr skills +coderrr list skills # Preferred command +coderrr skills # Legacy alias (still supported) ``` | Skill | Description | diff --git a/src/skillMarketplace.js b/src/skillMarketplace.js index 3f15030..d57e4a7 100644 --- a/src/skillMarketplace.js +++ b/src/skillMarketplace.js @@ -13,7 +13,7 @@ const skillRegistry = require('./skillRegistry'); const { installSkillDependencies } = require('./skillRunner'); // Registry configuration -const REGISTRY_URL = 'https://raw.githubusercontent.com/Akash-nath29/coderrr-skills/main/registry.json'; +const REGISTRY_URL = process.env.CODERRR_SKILLS_REGISTRY || 'https://raw.githubusercontent.com/Akash-nath29/coderrr-skills/main/registry.json'; const CACHE_DIR = path.join(os.homedir(), '.coderrr'); const CACHE_FILE = path.join(CACHE_DIR, 'registry-cache.json'); const CACHE_TTL = 5 * 60 * 1000; // 5 minutes @@ -75,6 +75,14 @@ async function fetchRegistry() { const response = await axios.get(REGISTRY_URL, { timeout: 10000 }); const registry = response.data; + // Validate registry format + if (!registry || typeof registry !== 'object') { + throw new Error('Invalid registry format'); + } + if (!registry.skills || typeof registry.skills !== 'object') { + throw new Error('Invalid registry format'); + } + // Cache the result saveCache(registry); diff --git a/src/skillsUI.js b/src/skillsUI.js index 909cdcc..391792c 100644 --- a/src/skillsUI.js +++ b/src/skillsUI.js @@ -263,6 +263,19 @@ function registerSkillCommands(program) { displaySkillsList(); }); + // List resources (skills, recipes, etc.) + program + .command('list ') + .description('List available resources (skills, recipes, etc.)') + .action((resource) => { + if (resource.toLowerCase() === 'skills') { + displaySkillsList(); + } else { + console.log(chalk.yellow(`\n▲ Unknown resource: "${resource}"`)); + console.log(chalk.gray('Available resources: skills\n')); + } + }); + // Install a skill (local or from marketplace) program .command('install ')