@nolrm/contextkit 0.12.3 → 0.12.4
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 +6 -2
- package/bin/contextkit.js +1 -1
- package/lib/commands/install.js +20 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,15 +32,19 @@ Each platform gets auto-loaded bridge files (`CLAUDE.md`, `AGENTS.md`, `GEMINI.m
|
|
|
32
32
|
**Requirements:** Node.js 14.x+ (16.x+ recommended) and npm/yarn. Optional: Git for hooks, AI tools for usage.
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
|
-
# Step 1: Install globally (
|
|
35
|
+
# Step 1: Install the CLI globally (one-time, any machine)
|
|
36
36
|
npm i -g @nolrm/contextkit
|
|
37
37
|
|
|
38
|
-
# Step 2:
|
|
38
|
+
# Step 2: Initialize in your project (once per project)
|
|
39
39
|
cd your-project
|
|
40
40
|
contextkit install # interactive — prompts "Which AI tool?"
|
|
41
41
|
contextkit install claude # or specify your platform directly
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
+
> **Project-level only.** `ck install` creates `.contextkit/` in your current directory and commits it with your project. There is no global mode — your standards live in git, not on your machine. This keeps them portable, CI-compatible, and shared with your team.
|
|
45
|
+
|
|
46
|
+
> **Tip:** Need to share standards across projects? Push your `.contextkit/` to a shared repo and pull it with `ck pull`.
|
|
47
|
+
|
|
44
48
|
This creates `.contextkit/` with skeleton context files (blank templates to be filled by AI):
|
|
45
49
|
|
|
46
50
|
```
|
package/bin/contextkit.js
CHANGED
|
@@ -22,7 +22,7 @@ program
|
|
|
22
22
|
// Install command
|
|
23
23
|
program
|
|
24
24
|
.command('install [platform]')
|
|
25
|
-
.description('
|
|
25
|
+
.description('Initialize ContextKit in the current project directory (run once per project, not global)')
|
|
26
26
|
.option('--no-hooks', 'Skip Git hooks installation')
|
|
27
27
|
.option('--non-interactive', 'Skip interactive prompts')
|
|
28
28
|
.action(async (platform, options) => {
|
package/lib/commands/install.js
CHANGED
|
@@ -36,6 +36,15 @@ class InstallCommand {
|
|
|
36
36
|
console.log(chalk.yellow('🧹 Removed legacy pre-commit hook (replaced by pre-push)'));
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
// Warn if run outside a project directory
|
|
40
|
+
const hasGit = await this._findFileUpward('.git', 3);
|
|
41
|
+
const hasPkg = await fs.pathExists('package.json');
|
|
42
|
+
if (!hasGit && !hasPkg) {
|
|
43
|
+
console.log(chalk.yellow('⚠️ No project detected (no .git or package.json found in this directory).'));
|
|
44
|
+
console.log(chalk.yellow(' Make sure you are inside your project before running `ck install`.'));
|
|
45
|
+
console.log('');
|
|
46
|
+
}
|
|
47
|
+
|
|
39
48
|
const requestedPlatform = options.platform;
|
|
40
49
|
const isFullInstall = !!options.fullInstall;
|
|
41
50
|
|
|
@@ -1574,6 +1583,17 @@ If standards are still skeletons, warn that @imports in CLAUDE.md are loading em
|
|
|
1574
1583
|
console.log(chalk.magenta('✨ Done! Your AI now understands your project.'));
|
|
1575
1584
|
console.log('');
|
|
1576
1585
|
}
|
|
1586
|
+
|
|
1587
|
+
async _findFileUpward(name, maxLevels) {
|
|
1588
|
+
let dir = process.cwd();
|
|
1589
|
+
for (let i = 0; i <= maxLevels; i++) {
|
|
1590
|
+
if (await fs.pathExists(path.join(dir, name))) return true;
|
|
1591
|
+
const parent = path.dirname(dir);
|
|
1592
|
+
if (parent === dir) break;
|
|
1593
|
+
dir = parent;
|
|
1594
|
+
}
|
|
1595
|
+
return false;
|
|
1596
|
+
}
|
|
1577
1597
|
}
|
|
1578
1598
|
|
|
1579
1599
|
async function install(options) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nolrm/contextkit",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.4",
|
|
4
4
|
"description": "ContextKit - Context Engineering for AI Development. Provide rich context to AI through structured MD files with standards, code guides, and documentation. Works with Cursor, Claude, Aider, VS Code Copilot, and more.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"bin": {
|