Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ dist/
*.log
.openskills-temp/
.claude/
.agent/
vscode-extension/*.vsix
205 changes: 15 additions & 190 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 11 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
"version": "1.3.0",
"description": "Universal skills loader for AI coding agents - install and load Anthropic SKILL.md format skills in any agent",
"type": "module",
"main": "./dist/cli.js",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"./cli": "./dist/cli.js"
},
"bin": {
"openskills": "./dist/cli.js"
},
Expand Down Expand Up @@ -49,12 +57,12 @@
"@inquirer/prompts": "^7.9.0",
"chalk": "^5.6.2",
"commander": "^12.1.0",
"ora": "^9.0.0"
"nanospinner": "^1.2.2"
},
"devDependencies": {
"@types/node": "^24.9.1",
"tsup": "^8.5.0",
"typescript": "^5.9.3",
"vitest": "^4.0.3"
}
}
}
36 changes: 26 additions & 10 deletions src/commands/install.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { readFileSync, readdirSync, existsSync, mkdirSync, rmSync, cpSync, statSync } from 'fs';
import { join, basename, resolve } from 'path';
import { homedir } from 'os';
import { execSync } from 'child_process';
import { spawn } from 'child_process';
import chalk from 'chalk';
import ora from 'ora';
import { createSpinner } from 'nanospinner';
import { checkbox, confirm } from '@inquirer/prompts';
import { ExitPromptError } from '@inquirer/core';
import { hasValidFrontmatter, extractYamlField } from '../utils/yaml.js';
Expand Down Expand Up @@ -97,17 +97,33 @@ export async function installSkill(source: string, options: InstallOptions): Pro
mkdirSync(tempDir, { recursive: true });

try {
const spinner = ora('Cloning repository...').start();
const spinner = createSpinner('Cloning repository...').start();
try {
execSync(`git clone --depth 1 --quiet "${repoUrl}" "${tempDir}/repo"`, {
stdio: 'pipe',
await new Promise<void>((resolve, reject) => {
const gitProcess = spawn('git', ['clone', '--depth', '1', '--quiet', repoUrl, `${tempDir}/repo`], {
stdio: 'pipe',
});
let stderr = '';
gitProcess.stderr?.on('data', (data) => {
stderr += data.toString();
});
gitProcess.on('close', (code) => {
if (code === 0) {
resolve();
} else {
reject(new Error(stderr.trim() || `git clone failed with code ${code}`));
}
});
gitProcess.on('error', (err) => {
reject(err);
});
});
spinner.succeed('Repository cloned');
spinner.success({ text: 'Repository cloned' });
} catch (error) {
spinner.fail('Failed to clone repository');
const err = error as { stderr?: Buffer };
if (err.stderr) {
console.error(chalk.dim(err.stderr.toString().trim()));
spinner.error({ text: 'Failed to clone repository' });
const err = error as Error;
if (err.message) {
console.error(chalk.dim(err.message));
}
console.error(chalk.yellow('\nTip: For private repos, ensure git SSH keys or credentials are configured'));
process.exit(1);
Expand Down
Loading