feat: add npx installer CLI

- Add package.json with bin for antigravity-awesome-skills
- Add bin/install.js: clone to ~/.agent/skills (default), --cursor/--claude/--gemini/--path
- Git pull if dir exists; core.symlinks=true on Windows
- Update README and GETTING_STARTED with npx instructions
This commit is contained in:
sck_0
2026-01-29 12:40:51 +01:00
parent b74dbe7795
commit ba668dde07
4 changed files with 178 additions and 6 deletions

View File

@@ -54,8 +54,12 @@ AI Agents (like Claude Code, Cursor, or Gemini) are smart, but they lack **speci
Don't install 560+ skills manually. Use our **Starter Packs**:
1. **Clone the repo**:
1. **Install** (pick one):
```bash
# Easiest: npx installer (clones to ~/.agent/skills by default)
npx antigravity-awesome-skills
# Or clone manually
git clone https://github.com/sickn33/antigravity-awesome-skills.git .agent/skills
```
2. **Pick your persona** (See [docs/BUNDLES.md](docs/BUNDLES.md)):
@@ -91,7 +95,7 @@ These skills follow the universal **SKILL.md** format and work with any AI codin
> [!WARNING]
> **Windows Users**: This repository uses **symlinks** for official skills.
> You must enable Developer Mode or run Git as Administrator:
> The **npx** installer sets `core.symlinks=true` automatically. For **git clone**, enable Developer Mode or run Git as Administrator:
> `git clone -c core.symlinks=true https://github.com/...`
---
@@ -128,10 +132,33 @@ We have moved the full skill registry to a dedicated catalog to keep this README
## Installation
To use these skills with **Claude Code**, **Gemini CLI**, **Codex CLI**, **Cursor**, **Antigravity**, or **OpenCode**, clone this repository into your agent's skills directory:
To use these skills with **Claude Code**, **Gemini CLI**, **Codex CLI**, **Cursor**, **Antigravity**, or **OpenCode**:
### Option A: npx (recommended)
```bash
# Universal installation (works with most tools)
# Default: ~/.agent/skills (universal)
npx antigravity-awesome-skills
# Cursor
npx antigravity-awesome-skills --cursor
# Claude Code
npx antigravity-awesome-skills --claude
# Gemini CLI
npx antigravity-awesome-skills --gemini
# Custom path
npx antigravity-awesome-skills --path ./my-skills
```
Run `npx antigravity-awesome-skills --help` for all options. If the directory already exists, the installer runs `git pull` to update.
### Option B: git clone
```bash
# Universal (works with most tools)
git clone https://github.com/sickn33/antigravity-awesome-skills.git .agent/skills
# Claude Code specific

113
bin/install.js Executable file
View File

@@ -0,0 +1,113 @@
#!/usr/bin/env node
const { spawnSync } = require('child_process');
const path = require('path');
const fs = require('fs');
const REPO = 'https://github.com/sickn33/antigravity-awesome-skills.git';
const HOME = process.env.HOME || process.env.USERPROFILE || '';
function resolveDir(p) {
if (!p) return null;
const s = p.replace(/^~($|\/)/, HOME + '$1');
return path.resolve(s);
}
function parseArgs() {
const a = process.argv.slice(2);
let pathArg = null;
let cursor = false, claude = false, gemini = false;
for (let i = 0; i < a.length; i++) {
if (a[i] === '--help' || a[i] === '-h') return { help: true };
if (a[i] === '--path' && a[i + 1]) { pathArg = a[++i]; continue; }
if (a[i] === '--cursor') { cursor = true; continue; }
if (a[i] === '--claude') { claude = true; continue; }
if (a[i] === '--gemini') { gemini = true; continue; }
if (a[i] === 'install') continue;
}
return { pathArg, cursor, claude, gemini };
}
function defaultDir(opts) {
if (opts.pathArg) return resolveDir(opts.pathArg);
if (opts.cursor) return path.join(HOME, '.cursor', 'skills');
if (opts.claude) return path.join(HOME, '.claude', 'skills');
if (opts.gemini) return path.join(HOME, '.gemini', 'skills');
return path.join(HOME, '.agent', 'skills');
}
function printHelp() {
console.log(`
antigravity-awesome-skills — installer
npx antigravity-awesome-skills [install] [options]
Clones the skills repo into your agent's skills directory.
Options:
--cursor Install to ~/.cursor/skills (Cursor)
--claude Install to ~/.claude/skills (Claude Code)
--gemini Install to ~/.gemini/skills (Gemini CLI)
--path <dir> Install to <dir> (default: ~/.agent/skills)
Examples:
npx antigravity-awesome-skills
npx antigravity-awesome-skills --cursor
npx antigravity-awesome-skills --path ./my-skills
`);
}
function run(cmd, args, opts = {}) {
const r = spawnSync(cmd, args, { stdio: 'inherit', ...opts });
if (r.status !== 0) process.exit(r.status == null ? 1 : r.status);
}
function main() {
const opts = parseArgs();
if (opts.help) {
printHelp();
return;
}
const target = defaultDir(opts);
if (!target || !HOME) {
console.error('Could not resolve home directory. Use --path <absolute-path>.');
process.exit(1);
}
if (fs.existsSync(target)) {
const gitDir = path.join(target, '.git');
if (fs.existsSync(gitDir)) {
console.log('Directory already exists and is a git repo. Updating…');
process.chdir(target);
run('git', ['pull']);
return;
}
console.error(`Directory exists and is not a git repo: ${target}`);
console.error('Remove it or use --path to choose another location.');
process.exit(1);
}
const parent = path.dirname(target);
if (!fs.existsSync(parent)) {
try {
fs.mkdirSync(parent, { recursive: true });
} catch (e) {
console.error(`Cannot create parent directory: ${parent}`, e.message);
process.exit(1);
}
}
if (process.platform === 'win32') {
run('git', ['-c', 'core.symlinks=true', 'clone', REPO, target]);
} else {
run('git', ['clone', REPO, target]);
}
console.log(`\nInstalled to ${target}`);
console.log('Pick a bundle in docs/BUNDLES.md and use @skill-name in your AI assistant.');
}
main();

View File

@@ -20,10 +20,18 @@ We have curated **Starter Packs** to get you running immediately.
### 1. Install the Repo
Copy the skills to your agent's folder:
**Option A — npx (easiest):**
```bash
# Universal Installation (works for most agents)
npx antigravity-awesome-skills
```
This clones to `~/.agent/skills` by default. Use `--cursor`, `--claude`, or `--gemini` to install for a specific tool, or `--path <dir>` for a custom location. Run `npx antigravity-awesome-skills --help` for details.
**Option B — git clone:**
```bash
# Universal (works for most agents)
git clone https://github.com/sickn33/antigravity-awesome-skills.git .agent/skills
```

24
package.json Normal file
View File

@@ -0,0 +1,24 @@
{
"name": "antigravity-awesome-skills",
"version": "4.0.0",
"description": "560+ agentic skills for Claude Code, Gemini CLI, Cursor, Antigravity & more. Installer CLI.",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/sickn33/antigravity-awesome-skills.git"
},
"bin": {
"antigravity-awesome-skills": "./bin/install.js"
},
"files": [
"bin"
],
"keywords": [
"claude-code",
"cursor",
"gemini-cli",
"antigravity",
"agentic-skills",
"ai-coding"
]
}