Viet Tran 70200ed41a
feat: add uxpro-cli for easy skill installation (#4)
* feat: add uxpro-cli for easy skill installation

- Add CLI tool (uxpro-cli) with commands: init, versions, update
- Support multiple AI assistants: claude, cursor, windsurf, antigravity, all
- Update README with CLI installation guide and usage examples
- Add CC BY-NC 4.0 license
- Update feature counts to accurate numbers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: rename CLI from uxpro to uipro

- Package: uxpro-cli -> uipro-cli
- Command: uxpro -> uipro

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-02 18:55:29 +07:00

43 lines
1.2 KiB
TypeScript

import chalk from 'chalk';
import ora from 'ora';
import { fetchReleases } from '../utils/github.js';
import { logger } from '../utils/logger.js';
export async function versionsCommand(): Promise<void> {
const spinner = ora('Fetching available versions...').start();
try {
const releases = await fetchReleases();
if (releases.length === 0) {
spinner.warn('No releases found');
return;
}
spinner.succeed(`Found ${releases.length} version(s)\n`);
console.log(chalk.bold('Available versions:\n'));
releases.forEach((release, index) => {
const isLatest = index === 0;
const tag = release.tag_name;
const date = new Date(release.published_at).toLocaleDateString();
if (isLatest) {
console.log(` ${chalk.green('*')} ${chalk.bold(tag)} ${chalk.dim(`(${date})`)} ${chalk.green('[latest]')}`);
} else {
console.log(` ${tag} ${chalk.dim(`(${date})`)}`);
}
});
console.log();
logger.dim('Use: uipro init --version <tag> to install a specific version');
} catch (error) {
spinner.fail('Failed to fetch versions');
if (error instanceof Error) {
logger.error(error.message);
}
process.exit(1);
}
}