mirror of
https://github.com/rohitg00/skillkit.git
synced 2026-11-18 18:04:26 +00:00
Merge pull request #115 from rohitg00/slim-install-deps
chore: slim CLI install by making heavy deps optional
This commit is contained in:
@@ -375,6 +375,67 @@ bun add -g skillkit # bun
|
||||
npx skillkit <command> # no install
|
||||
```
|
||||
|
||||
### Install sizes
|
||||
|
||||
Core commands — `install`, `list`, `find`, `translate`, `recommend`, `publish` —
|
||||
ship in the default package. Four power features are shipped as **optional
|
||||
dependencies** so a bare CLI install stays small:
|
||||
|
||||
| Feature | Package | Command |
|
||||
| ------------------------ | -------------------- | --------------------------- |
|
||||
| Interactive terminal UI | `@skillkit/tui` | `skillkit ui` / `skillkit tui` |
|
||||
| REST/OpenAPI server | `@skillkit/api` | `skillkit serve` |
|
||||
| Peer mesh networking | `@skillkit/mesh` | `skillkit mesh …` |
|
||||
| Inter-agent messaging | `@skillkit/messaging`| `skillkit message …` |
|
||||
|
||||
```bash
|
||||
# Full install — every feature, everything works out of the box (default):
|
||||
npm install -g skillkit
|
||||
|
||||
# Slim install — core commands only, ~75% smaller, no native addons:
|
||||
npm install -g skillkit --omit=optional
|
||||
pnpm add -g skillkit --prod --no-optional
|
||||
```
|
||||
|
||||
Cold `npm install` measurements on a fresh cache:
|
||||
|
||||
| Install mode | Packages | Time | Deprecations |
|
||||
| --------------------- | -------- | ---- | ------------ |
|
||||
| `skillkit` | 475 | 18 s | 3 |
|
||||
| `skillkit --omit=optional` | 118 | 9 s | 0 |
|
||||
|
||||
If you skipped optional deps and later want the UI, server, mesh, or
|
||||
messaging, add just the one you need:
|
||||
|
||||
```bash
|
||||
npm install -g @skillkit/tui # skillkit ui
|
||||
npm install -g @skillkit/api # skillkit serve
|
||||
npm install -g @skillkit/mesh # skillkit mesh
|
||||
npm install -g @skillkit/messaging # skillkit message
|
||||
```
|
||||
|
||||
### Using `npx` (no install)
|
||||
|
||||
`npx skillkit add <owner/repo>` is the fastest way to try it. First run
|
||||
downloads the package into the npx cache (`~/.npm/_npx/`); every run
|
||||
after that is instant.
|
||||
|
||||
```bash
|
||||
# Full (defaults to installing optional features):
|
||||
npx skillkit add anthropics/skills
|
||||
|
||||
# Slim — core commands only, ~75% fewer packages, 0 warnings:
|
||||
npx --omit=optional skillkit add anthropics/skills
|
||||
```
|
||||
|
||||
Run `npx skillkit` a few times and you will want the global install —
|
||||
it skips the prompt-to-proceed and kills the per-release cache refetch:
|
||||
|
||||
```bash
|
||||
npm install -g skillkit --omit=optional # 9 s, 118 packages, one time
|
||||
skillkit add anthropics/skills # instant every run
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Apache License 2.0 — see [LICENSE](LICENSE).
|
||||
|
||||
@@ -5,7 +5,45 @@ Universal skills manager for AI coding agents. Install, manage, and sync skills
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
# Full install (default) — every feature, everything works:
|
||||
npm install -g skillkit
|
||||
|
||||
# Slim install — core commands only, ~75% smaller, no native addons:
|
||||
npm install -g skillkit --omit=optional
|
||||
```
|
||||
|
||||
### What's optional
|
||||
|
||||
Four power features ship as **optional dependencies** so the core CLI
|
||||
stays lean. They install automatically with `npm install -g skillkit`,
|
||||
and are skipped with `--omit=optional`:
|
||||
|
||||
| Feature | Package | Command |
|
||||
| ------------------------ | -------------------- | ------------------------------ |
|
||||
| Interactive terminal UI | `@skillkit/tui` | `skillkit ui` / `skillkit tui` |
|
||||
| REST/OpenAPI server | `@skillkit/api` | `skillkit serve` |
|
||||
| Peer mesh networking | `@skillkit/mesh` | `skillkit mesh …` |
|
||||
| Inter-agent messaging | `@skillkit/messaging`| `skillkit message …` |
|
||||
|
||||
Add one later with `npm install -g @skillkit/tui` (or `api` / `mesh` / `messaging`).
|
||||
|
||||
### Using `npx`
|
||||
|
||||
`npx skillkit add <owner/repo>` works with zero install. First run pulls
|
||||
the package into the npx cache (`~/.npm/_npx/`); every subsequent run
|
||||
from the same cache is instant.
|
||||
|
||||
```bash
|
||||
npx skillkit add anthropics/skills # full
|
||||
npx --omit=optional skillkit add anthropics/skills # slim, 118 pkgs, 9 s
|
||||
```
|
||||
|
||||
Running `npx` more than a couple of times? Install globally — no
|
||||
prompt-to-proceed, no refetch on each release:
|
||||
|
||||
```bash
|
||||
npm install -g skillkit --omit=optional
|
||||
skillkit add anthropics/skills
|
||||
```
|
||||
|
||||
## Quick Start
|
||||
|
||||
@@ -53,16 +53,17 @@
|
||||
"node": ">=18.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@skillkit/api": "workspace:*",
|
||||
"@skillkit/core": "workspace:*",
|
||||
"@skillkit/agents": "workspace:*",
|
||||
"@skillkit/cli": "workspace:*",
|
||||
"@skillkit/tui": "workspace:*",
|
||||
"@skillkit/memory": "workspace:*",
|
||||
"@skillkit/mesh": "workspace:*",
|
||||
"@skillkit/messaging": "workspace:*",
|
||||
"clipanion": "^4.0.0-rc.4"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@skillkit/api": "workspace:*",
|
||||
"@skillkit/tui": "workspace:*",
|
||||
"@skillkit/mesh": "workspace:*",
|
||||
"@skillkit/messaging": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.10.5",
|
||||
"tsup": "^8.3.5",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Re-export all public APIs from packages
|
||||
export * from '@skillkit/core';
|
||||
export * from '@skillkit/agents';
|
||||
|
||||
// Re-export TUI entry point
|
||||
export { startTUI } from '@skillkit/tui';
|
||||
export async function startTUI(...args: unknown[]): Promise<unknown> {
|
||||
const mod = await import('@skillkit/tui');
|
||||
return mod.startTUI(...(args as Parameters<typeof mod.startTUI>));
|
||||
}
|
||||
|
||||
@@ -7,4 +7,7 @@ export default defineConfig({
|
||||
splitting: false,
|
||||
sourcemap: true,
|
||||
clean: true,
|
||||
platform: 'node',
|
||||
target: 'node18',
|
||||
skipNodeModulesBundle: true,
|
||||
});
|
||||
|
||||
@@ -33,6 +33,61 @@ bun add -g skillkit
|
||||
|
||||
Both `skillkit` and `sk` work as command aliases.
|
||||
|
||||
## Full vs slim install
|
||||
|
||||
SkillKit ships four power features as **optional dependencies** so the
|
||||
core install stays small. The default `npm install -g skillkit` installs
|
||||
every feature; `--omit=optional` installs only the core CLI.
|
||||
|
||||
| Feature | Package | Command |
|
||||
| ------------------------ | -------------------- | ------------------------------ |
|
||||
| Interactive terminal UI | `@skillkit/tui` | `skillkit ui` / `skillkit tui` |
|
||||
| REST/OpenAPI server | `@skillkit/api` | `skillkit serve` |
|
||||
| Peer mesh networking | `@skillkit/mesh` | `skillkit mesh …` |
|
||||
| Inter-agent messaging | `@skillkit/messaging`| `skillkit message …` |
|
||||
|
||||
```bash
|
||||
# Full (default) — every feature works out of the box:
|
||||
npm install -g skillkit
|
||||
|
||||
# Slim — core commands only, ~75% smaller, no native addons, 0 deprecation warnings:
|
||||
npm install -g skillkit --omit=optional
|
||||
```
|
||||
|
||||
Add one later:
|
||||
|
||||
```bash
|
||||
npm install -g @skillkit/tui # enables: skillkit ui
|
||||
npm install -g @skillkit/api # enables: skillkit serve
|
||||
npm install -g @skillkit/mesh # enables: skillkit mesh
|
||||
npm install -g @skillkit/messaging # enables: skillkit message
|
||||
```
|
||||
|
||||
The CLI catches a missing optional feature and prints a one-line hint,
|
||||
so you'll never see an unhandled stack trace.
|
||||
|
||||
## Using `npx`
|
||||
|
||||
`npx skillkit add <owner/repo>` runs without a global install. First run
|
||||
downloads into the npx cache (`~/.npm/_npx/`); every call after that is
|
||||
instant until the cache expires or a new version ships.
|
||||
|
||||
```bash
|
||||
# Full — every feature works:
|
||||
npx skillkit add anthropics/skills
|
||||
|
||||
# Slim — core commands only, 75% fewer packages, 0 warnings:
|
||||
npx --omit=optional skillkit add anthropics/skills
|
||||
```
|
||||
|
||||
If you use `npx skillkit` more than a couple of times, install globally
|
||||
to skip the prompt-to-proceed and avoid the per-release cache refetch:
|
||||
|
||||
```bash
|
||||
npm install -g skillkit --omit=optional
|
||||
skillkit add anthropics/skills
|
||||
```
|
||||
|
||||
## Verify
|
||||
|
||||
```bash
|
||||
|
||||
@@ -61,14 +61,42 @@ const sections: DocSection[] = [
|
||||
content: (
|
||||
<div className="space-y-4">
|
||||
<h3 className="text-lg font-semibold text-white">Quick Start</h3>
|
||||
<CodeBlock>{`# Install globally via npm
|
||||
<CodeBlock>{`# Full install — every feature works out of the box (default):
|
||||
npm install -g skillkit
|
||||
|
||||
# Or use npx directly
|
||||
npx skillkit --help
|
||||
# Slim install — core commands only, ~75% smaller, 0 deprecation warnings:
|
||||
npm install -g skillkit --omit=optional
|
||||
|
||||
# Or install via pnpm
|
||||
pnpm add -g skillkit`}</CodeBlock>
|
||||
# Or use npx directly:
|
||||
npx skillkit --help`}</CodeBlock>
|
||||
|
||||
<h3 className="text-lg font-semibold text-white mt-6">Optional Features</h3>
|
||||
<p className="text-zinc-300 text-sm">
|
||||
TUI, REST server, peer mesh, and inter-agent messaging ship as optional
|
||||
dependencies. They install by default, or add later à la carte:
|
||||
</p>
|
||||
<CodeBlock>{`npm install -g @skillkit/tui # enables: skillkit ui
|
||||
npm install -g @skillkit/api # enables: skillkit serve
|
||||
npm install -g @skillkit/mesh # enables: skillkit mesh
|
||||
npm install -g @skillkit/messaging # enables: skillkit message`}</CodeBlock>
|
||||
|
||||
<h3 className="text-lg font-semibold text-white mt-6">Using npx (no install)</h3>
|
||||
<p className="text-zinc-300 text-sm">
|
||||
<code className="text-zinc-200">npx skillkit add <owner/repo></code> runs with zero install.
|
||||
First call caches the package at <code className="text-zinc-200">~/.npm/_npx/</code>; every
|
||||
run after that is instant until a new version ships.
|
||||
</p>
|
||||
<CodeBlock>{`# Full (default):
|
||||
npx skillkit add anthropics/skills
|
||||
|
||||
# Slim — core only, 75% fewer packages, 0 warnings:
|
||||
npx --omit=optional skillkit add anthropics/skills`}</CodeBlock>
|
||||
<p className="text-zinc-300 text-sm">
|
||||
Using npx more than a couple times? Install globally to skip the
|
||||
prompt-to-proceed and avoid the per-release cache refetch:
|
||||
</p>
|
||||
<CodeBlock>{`npm install -g skillkit --omit=optional
|
||||
skillkit add anthropics/skills`}</CodeBlock>
|
||||
|
||||
<h3 className="text-lg font-semibold text-white mt-6">Verify Installation</h3>
|
||||
<CodeBlock>{`skillkit --version
|
||||
|
||||
@@ -60,14 +60,42 @@ const sections: DocSection[] = [
|
||||
content: (
|
||||
<div className="space-y-4">
|
||||
<h3 className="text-lg font-semibold text-white">Quick Start</h3>
|
||||
<CodeBlock>{`# Install globally via npm
|
||||
<CodeBlock>{`# Full install — every feature works out of the box (default):
|
||||
npm install -g skillkit
|
||||
|
||||
# Or use npx directly
|
||||
npx skillkit --help
|
||||
# Slim install — core commands only, ~75% smaller, 0 deprecation warnings:
|
||||
npm install -g skillkit --omit=optional
|
||||
|
||||
# Or install via pnpm
|
||||
pnpm add -g skillkit`}</CodeBlock>
|
||||
# Or use npx directly:
|
||||
npx skillkit --help`}</CodeBlock>
|
||||
|
||||
<h3 className="text-lg font-semibold text-white mt-6">Optional Features</h3>
|
||||
<p className="text-zinc-300 text-sm">
|
||||
TUI, REST server, peer mesh, and inter-agent messaging ship as optional
|
||||
dependencies. They install by default, or add later à la carte:
|
||||
</p>
|
||||
<CodeBlock>{`npm install -g @skillkit/tui # enables: skillkit ui
|
||||
npm install -g @skillkit/api # enables: skillkit serve
|
||||
npm install -g @skillkit/mesh # enables: skillkit mesh
|
||||
npm install -g @skillkit/messaging # enables: skillkit message`}</CodeBlock>
|
||||
|
||||
<h3 className="text-lg font-semibold text-white mt-6">Using npx (no install)</h3>
|
||||
<p className="text-zinc-300 text-sm">
|
||||
<code className="text-zinc-200">npx skillkit add <owner/repo></code> runs with zero install.
|
||||
First call caches the package at <code className="text-zinc-200">~/.npm/_npx/</code>; every
|
||||
run after that is instant until a new version ships.
|
||||
</p>
|
||||
<CodeBlock>{`# Full (default):
|
||||
npx skillkit add anthropics/skills
|
||||
|
||||
# Slim — core only, 75% fewer packages, 0 warnings:
|
||||
npx --omit=optional skillkit add anthropics/skills`}</CodeBlock>
|
||||
<p className="text-zinc-300 text-sm">
|
||||
Using npx more than a couple times? Install globally to skip the
|
||||
prompt-to-proceed and avoid the per-release cache refetch:
|
||||
</p>
|
||||
<CodeBlock>{`npm install -g skillkit --omit=optional
|
||||
skillkit add anthropics/skills`}</CodeBlock>
|
||||
|
||||
<h3 className="text-lg font-semibold text-white mt-6">Verify Installation</h3>
|
||||
<CodeBlock>{`skillkit --version
|
||||
|
||||
@@ -22,14 +22,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@clack/prompts": "^0.11.0",
|
||||
"@skillkit/api": "workspace:*",
|
||||
"@skillkit/core": "workspace:*",
|
||||
"@skillkit/agents": "workspace:*",
|
||||
"@skillkit/resources": "workspace:*",
|
||||
"@skillkit/tui": "workspace:*",
|
||||
"@skillkit/memory": "workspace:*",
|
||||
"@skillkit/mesh": "workspace:*",
|
||||
"@skillkit/messaging": "workspace:*",
|
||||
"chalk": "^5.3.0",
|
||||
"clipanion": "^4.0.0-rc.4",
|
||||
"got": "^14.4.1",
|
||||
@@ -38,6 +33,12 @@
|
||||
"picocolors": "^1.1.1",
|
||||
"yaml": "^2.7.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@skillkit/api": "workspace:*",
|
||||
"@skillkit/tui": "workspace:*",
|
||||
"@skillkit/mesh": "workspace:*",
|
||||
"@skillkit/messaging": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.10.5",
|
||||
"tsup": "^8.3.5",
|
||||
|
||||
@@ -357,6 +357,8 @@ export class InstallCommand extends Command {
|
||||
if (isInteractive) {
|
||||
const allAgentTypes = getAllAdapters().map((a) => a.type);
|
||||
const lastAgents = getLastAgents();
|
||||
const rawDetected = await detectAgent().catch(() => undefined);
|
||||
const detectedAgent = rawDetected && rawDetected !== 'universal' ? rawDetected : undefined;
|
||||
|
||||
step(`Detected ${allAgentTypes.length} agents`);
|
||||
|
||||
@@ -364,6 +366,7 @@ export class InstallCommand extends Command {
|
||||
message: "Install to",
|
||||
agents: allAgentTypes,
|
||||
lastSelected: lastAgents,
|
||||
detected: detectedAgent,
|
||||
});
|
||||
|
||||
if (isCancel(agentResult)) {
|
||||
@@ -372,6 +375,10 @@ export class InstallCommand extends Command {
|
||||
}
|
||||
|
||||
const targetAgents = (agentResult as { agents: string[] }).agents as AgentType[];
|
||||
if (targetAgents.length === 0) {
|
||||
cancel("Installation cancelled");
|
||||
return { agents: null, exitCode: 0 };
|
||||
}
|
||||
saveLastAgents(targetAgents);
|
||||
return { agents: targetAgents, exitCode: 0 };
|
||||
}
|
||||
|
||||
@@ -117,9 +117,11 @@ export async function quickAgentSelect(options: {
|
||||
message?: string;
|
||||
agents: string[];
|
||||
lastSelected?: string[];
|
||||
}): Promise<{ agents: string[]; method: 'last' | 'all' | 'select' } | symbol> {
|
||||
const { agents, lastSelected = [] } = options;
|
||||
detected?: string;
|
||||
}): Promise<{ agents: string[]; method: 'last' | 'all' | 'select' | 'detected' } | symbol> {
|
||||
const { agents, lastSelected = [], detected } = options;
|
||||
const hasLast = lastSelected.length > 0 && lastSelected.some(a => agents.includes(a));
|
||||
const hasDetected = !!detected && agents.includes(detected);
|
||||
|
||||
const selectOptions: Array<{ value: string; label: string; hint?: string }> = [];
|
||||
|
||||
@@ -130,21 +132,29 @@ export async function quickAgentSelect(options: {
|
||||
|
||||
selectOptions.push({
|
||||
value: 'last',
|
||||
label: `Same as last time (Recommended)`,
|
||||
label: 'Same as last time (Recommended)',
|
||||
hint: `${agentList}${more}`,
|
||||
});
|
||||
}
|
||||
|
||||
selectOptions.push({
|
||||
value: 'all',
|
||||
label: 'All detected agents',
|
||||
hint: `${agents.length} agent${agents.length !== 1 ? 's' : ''}`,
|
||||
});
|
||||
if (hasDetected) {
|
||||
selectOptions.push({
|
||||
value: 'detected',
|
||||
label: `Just ${formatAgent(detected!)} (detected)`,
|
||||
hint: detected,
|
||||
});
|
||||
}
|
||||
|
||||
selectOptions.push({
|
||||
value: 'select',
|
||||
label: 'Select specific agents',
|
||||
hint: 'Choose manually',
|
||||
hint: 'Choose manually, spacebar to toggle',
|
||||
});
|
||||
|
||||
selectOptions.push({
|
||||
value: 'all',
|
||||
label: 'All supported agents',
|
||||
hint: `${agents.length} agent${agents.length !== 1 ? 's' : ''} — writes to every adapter`,
|
||||
});
|
||||
|
||||
const result = await clack.select({
|
||||
@@ -156,20 +166,37 @@ export async function quickAgentSelect(options: {
|
||||
return result;
|
||||
}
|
||||
|
||||
const method = result as 'last' | 'all' | 'select';
|
||||
const method = result as 'last' | 'all' | 'select' | 'detected';
|
||||
|
||||
if (method === 'last') {
|
||||
return { agents: lastSelected.filter(a => agents.includes(a)), method };
|
||||
}
|
||||
|
||||
if (method === 'detected') {
|
||||
return { agents: [detected!], method };
|
||||
}
|
||||
|
||||
if (method === 'all') {
|
||||
const confirmed = await clack.confirm({
|
||||
message: `Install to all ${agents.length} agents?`,
|
||||
initialValue: false,
|
||||
});
|
||||
|
||||
if (clack.isCancel(confirmed) || !confirmed) {
|
||||
return clack.isCancel(confirmed) ? confirmed : { agents: [], method: 'all' };
|
||||
}
|
||||
|
||||
return { agents, method };
|
||||
}
|
||||
|
||||
const initialValues = lastSelected.length > 0
|
||||
? lastSelected.filter(a => agents.includes(a))
|
||||
: hasDetected ? [detected!] : [];
|
||||
|
||||
const selected = await agentMultiselect({
|
||||
message: 'Select agents',
|
||||
agents,
|
||||
initialValues: lastSelected.length > 0 ? lastSelected : agents,
|
||||
initialValues,
|
||||
});
|
||||
|
||||
if (clack.isCancel(selected)) {
|
||||
|
||||
Generated
+76
-3366
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user