local-lite 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -3
- package/bin/local-lite.mjs +62 -0
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -93,9 +93,16 @@ For an application-level upgrade checklist or AI-assisted code review, see the
|
|
|
93
93
|
## AI Skills
|
|
94
94
|
|
|
95
95
|
The package ships [Agent Skills](./skills) that AI coding assistants can load:
|
|
96
|
-
`local-lite-setup`, `local-lite-custom-adapter` and `local-lite-upgrade`.
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
`local-lite-setup`, `local-lite-custom-adapter` and `local-lite-upgrade`.
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
npx local-lite install-skills # Copilot: .github/skills
|
|
100
|
+
npx local-lite install-skills --target claude # Claude Code: .claude/skills
|
|
101
|
+
npx local-lite install-skills --dir path/to/dir --force
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Without npm, fetch them from GitHub:
|
|
105
|
+
`npx degit georgechitechi/local-lite/skills .github/skills`.
|
|
99
106
|
|
|
100
107
|
## Features
|
|
101
108
|
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { cp, mkdir, readdir } from 'node:fs/promises';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
|
|
6
|
+
const skillsRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', 'skills');
|
|
7
|
+
const targets = {
|
|
8
|
+
copilot: '.github/skills',
|
|
9
|
+
claude: '.claude/skills',
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const usage = `Usage: local-lite install-skills [--target copilot|claude] [--dir <path>] [--force]
|
|
13
|
+
|
|
14
|
+
Copies the bundled AI skills into your project.
|
|
15
|
+
--target copilot (default, .github/skills) or claude (.claude/skills)
|
|
16
|
+
--dir custom destination directory (overrides --target)
|
|
17
|
+
--force overwrite existing skill files`;
|
|
18
|
+
|
|
19
|
+
function parseArgs(argv) {
|
|
20
|
+
const options = { target: 'copilot', dir: undefined, force: false };
|
|
21
|
+
for (let i = 0; i < argv.length; i++) {
|
|
22
|
+
const arg = argv[i];
|
|
23
|
+
if (arg === '--force') options.force = true;
|
|
24
|
+
else if (arg === '--target') options.target = argv[++i];
|
|
25
|
+
else if (arg === '--dir') {
|
|
26
|
+
options.dir = argv[++i];
|
|
27
|
+
if (!options.dir) throw new Error('--dir requires a path.');
|
|
28
|
+
} else throw new Error(`Unknown option: ${arg}`);
|
|
29
|
+
}
|
|
30
|
+
if (!options.dir && !targets[options.target]) {
|
|
31
|
+
throw new Error(`Unknown target "${options.target}". Use copilot or claude.`);
|
|
32
|
+
}
|
|
33
|
+
return options;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async function installSkills(options) {
|
|
37
|
+
const destination = path.resolve(process.cwd(), options.dir ?? targets[options.target]);
|
|
38
|
+
await mkdir(destination, { recursive: true });
|
|
39
|
+
const entries = await readdir(skillsRoot, { withFileTypes: true });
|
|
40
|
+
for (const entry of entries.filter((item) => item.isDirectory())) {
|
|
41
|
+
await cp(path.join(skillsRoot, entry.name), path.join(destination, entry.name), {
|
|
42
|
+
recursive: true,
|
|
43
|
+
force: options.force,
|
|
44
|
+
errorOnExist: false,
|
|
45
|
+
});
|
|
46
|
+
console.log(`Installed ${entry.name} -> ${path.join(destination, entry.name)}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const [command, ...rest] = process.argv.slice(2);
|
|
51
|
+
try {
|
|
52
|
+
if (command === 'install-skills') {
|
|
53
|
+
await installSkills(parseArgs(rest));
|
|
54
|
+
} else {
|
|
55
|
+
console.log(usage);
|
|
56
|
+
process.exitCode = command && command !== '--help' && command !== '-h' ? 1 : 0;
|
|
57
|
+
}
|
|
58
|
+
} catch (error) {
|
|
59
|
+
console.error(error instanceof Error ? error.message : error);
|
|
60
|
+
console.error(usage);
|
|
61
|
+
process.exitCode = 1;
|
|
62
|
+
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "local-lite",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Never let a lost connection break a promise. Local-first sync that faithfully keeps data safe until you're back online.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"local-lite": "bin/local-lite.mjs"
|
|
10
|
+
},
|
|
8
11
|
"files": [
|
|
12
|
+
"bin",
|
|
9
13
|
"dist",
|
|
10
14
|
"docs",
|
|
11
15
|
"skills",
|