@nolrm/contextkit 0.7.3
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/LICENSE +21 -0
- package/README.md +216 -0
- package/bin/contextkit.js +324 -0
- package/bin/vibe-kit.js +3 -0
- package/install-fallback.sh +59 -0
- package/lib/commands/ai.js +147 -0
- package/lib/commands/analyze.js +544 -0
- package/lib/commands/check.js +290 -0
- package/lib/commands/dashboard.js +383 -0
- package/lib/commands/install.js +1454 -0
- package/lib/commands/note.js +120 -0
- package/lib/commands/publish.js +184 -0
- package/lib/commands/pull.js +191 -0
- package/lib/commands/run.js +232 -0
- package/lib/commands/status.js +253 -0
- package/lib/commands/update.js +376 -0
- package/lib/index.js +9 -0
- package/lib/integrations/aider-integration.js +93 -0
- package/lib/integrations/base-integration.js +123 -0
- package/lib/integrations/claude-integration.js +141 -0
- package/lib/integrations/codex-integration.js +45 -0
- package/lib/integrations/continue-integration.js +99 -0
- package/lib/integrations/copilot-integration.js +73 -0
- package/lib/integrations/cursor-integration.js +162 -0
- package/lib/integrations/gemini-integration.js +62 -0
- package/lib/integrations/index.js +33 -0
- package/lib/integrations/windsurf-integration.js +88 -0
- package/lib/utils/download.js +50 -0
- package/lib/utils/git-hooks.js +228 -0
- package/lib/utils/project-detector.js +110 -0
- package/lib/utils/status-manager.js +107 -0
- package/lib/utils/tool-detector.js +137 -0
- package/package.json +85 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Vibe Kit
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# ContextKit
|
|
2
|
+
|
|
3
|
+
> Context Engineering for AI Development
|
|
4
|
+
|
|
5
|
+
Give your AI assistants (Cursor, Claude, Copilot, Codex, Gemini, Aider, Continue, Windsurf) structured context through markdown files. ContextKit creates a knowledge base that ensures AI generates code matching your exact patterns, style, and architecture—no more hallucinated code or mismatched conventions.
|
|
6
|
+
|
|
7
|
+
ContextKit is a CLI tool that provides **context-engineering** capabilities by creating `.contextkit/` directories with project standards, guidelines, and patterns that AI assistants read automatically.
|
|
8
|
+
|
|
9
|
+
**[Read the full documentation](https://contextkit-docs.vercel.app/)**
|
|
10
|
+
|
|
11
|
+
## Why ContextKit?
|
|
12
|
+
|
|
13
|
+
**The problem:** LLMs are great at syntax, not at *your* conventions. Generic AI output requires manual fixes for style, structure, and architecture.
|
|
14
|
+
|
|
15
|
+
**The solution:** ContextKit provides your AI with:
|
|
16
|
+
- **Glossary** of project terminology and business terms (e.g., `checkout`, `customer`, `order`)
|
|
17
|
+
- **Standards** for code style, testing patterns, and architecture
|
|
18
|
+
- **Templates** with canonical component shapes
|
|
19
|
+
|
|
20
|
+
Update `.md` files as your project evolves; the AI follows.
|
|
21
|
+
|
|
22
|
+
## Multi-Platform Support
|
|
23
|
+
|
|
24
|
+
Works with: **Cursor** • **Claude Code** • **GitHub Copilot** • **Codex CLI** • **Gemini CLI** • **Aider** • **Continue** • **Windsurf**
|
|
25
|
+
|
|
26
|
+
Each platform gets auto-loaded bridge files (`CLAUDE.md`, `AGENTS.md`, `GEMINI.md`, `.windsurfrules`, etc.) so your AI tools read project standards automatically.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Quick Start (60s)
|
|
31
|
+
|
|
32
|
+
**Requirements:** Node.js 14.x+ (16.x+ recommended) and npm/yarn. Optional: Git for hooks, AI tools for usage.
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Step 1: Install globally (recommended)
|
|
36
|
+
npm i -g @nolrm/contextkit
|
|
37
|
+
|
|
38
|
+
# Step 2: Navigate to your project and install
|
|
39
|
+
cd your-project
|
|
40
|
+
contextkit install
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
This creates `.contextkit/` with skeleton context files (blank templates to be filled by AI):
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
.contextkit/
|
|
47
|
+
standards/ # Skeleton files: code-style.md, testing.md, architecture.md, ai-guidelines.md, workflows.md
|
|
48
|
+
# Real files: glossary.md (universal), README.md (overview)
|
|
49
|
+
commands/ # analyze.md (project analysis & customization)
|
|
50
|
+
templates/ # example component template
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Generate content with AI** (recommended):
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
ck analyze
|
|
57
|
+
# AI scans your codebase and generates content for the skeleton files
|
|
58
|
+
# or in Cursor chat: @.contextkit/commands/analyze.md
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
⚠️ **Important:** After running `ck analyze`, manually review and edit the generated content to match your exact needs. The AI provides a starting point, but you must customize it.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Multi-Team Workflow
|
|
66
|
+
|
|
67
|
+
Perfect for teams where members use different AI tools:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# First team member (any tool) - sets up the project
|
|
71
|
+
contextkit install
|
|
72
|
+
|
|
73
|
+
# Each team member adds their platform
|
|
74
|
+
ck claude # creates CLAUDE.md + .claude/rules/
|
|
75
|
+
ck cursor # creates .cursor/rules/ (scoped .mdc files)
|
|
76
|
+
ck copilot # creates .github/copilot-instructions.md
|
|
77
|
+
ck codex # creates AGENTS.md
|
|
78
|
+
ck gemini # creates GEMINI.md + .gemini/settings.json
|
|
79
|
+
ck aider # creates CONVENTIONS.md + .aider/rules.md
|
|
80
|
+
ck continue # creates .continue/rules/ + config.yaml
|
|
81
|
+
ck windsurf # creates .windsurfrules + .windsurf/rules/
|
|
82
|
+
ck vscode # alias for copilot
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Each platform generates bridge files that the AI tool auto-reads. If a bridge file already exists (e.g., you have a custom `CLAUDE.md`), ContextKit appends its section below your content instead of overwriting. Share your `.contextkit/standards/*.md` files with the team and everyone gets the same context.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## See the difference (before → after)
|
|
90
|
+
|
|
91
|
+
**Prompt**
|
|
92
|
+
```
|
|
93
|
+
"Add checkout flow for customer"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**What the AI does with ContextKit**
|
|
97
|
+
- Reads `glossary.md` → `checkout` = checkout process; `customer` = customer account
|
|
98
|
+
- Applies `code-style.md` → strict TS, functional components
|
|
99
|
+
- Follows `testing.md` → numbered test cases
|
|
100
|
+
|
|
101
|
+
**Result (diff)**
|
|
102
|
+
```diff
|
|
103
|
+
- const Checkout = () => <button>Buy</button>
|
|
104
|
+
+ export function CheckoutFlow({ customer }: { customer: string }) {
|
|
105
|
+
+ // Uses customer from glossary context
|
|
106
|
+
+ return <div>Checkout for {customer}</div>
|
|
107
|
+
+ }
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Use it in your tool
|
|
113
|
+
|
|
114
|
+
**Cursor** — rules auto-load from `.cursor/rules/`
|
|
115
|
+
```
|
|
116
|
+
@.contextkit/commands/analyze.md
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Claude Code** — reads `CLAUDE.md` + `.claude/rules/` automatically
|
|
120
|
+
```bash
|
|
121
|
+
claude "create checkout flow for customer"
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**GitHub Copilot** — reads `.github/copilot-instructions.md` automatically
|
|
125
|
+
```
|
|
126
|
+
@.contextkit Create checkout flow for customer
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Codex CLI** — reads `AGENTS.md` automatically
|
|
130
|
+
```bash
|
|
131
|
+
codex "create checkout flow for customer"
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
**CLI** (Chat with AI)
|
|
135
|
+
```bash
|
|
136
|
+
ck ai "create checkout flow for customer"
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Key Features
|
|
142
|
+
|
|
143
|
+
- 🧠 **Context Engineering** - Structured MD files your AI reads automatically
|
|
144
|
+
- 🔍 **Smart Analysis** - AI generates standards content based on your codebase
|
|
145
|
+
- 🌍 **Project Agnostic** - Works with React, Vue, Node.js, PHP, Python, Rust, monorepos—any project type
|
|
146
|
+
- 🤖 **Multi-Platform** - Works with Cursor, Claude Code, Copilot, Codex, Gemini, Aider, Continue, Windsurf
|
|
147
|
+
- 🛡️ **Safe Install** - Backs up existing files with rollback support
|
|
148
|
+
- ⚡ **Zero Config** - Auto-detects package managers and AI tools
|
|
149
|
+
- ✅ **Policy Enforcement** - Configurable validation with `ck check`
|
|
150
|
+
- 📝 **Corrections Tracking** - Track AI performance issues with corrections log
|
|
151
|
+
- 🔄 **Workflow Orchestration** - Structured workflows with `ck run`
|
|
152
|
+
- 📦 **Registry System** - Share standards across teams with `ck publish/pull`
|
|
153
|
+
- 📊 **Observability Dashboard** - Visual metrics and compliance tracking
|
|
154
|
+
|
|
155
|
+
## Commands
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
# Installation & Setup
|
|
159
|
+
ck install # set up .contextkit in this repo
|
|
160
|
+
ck claude # add Claude Code integration (CLAUDE.md + rules)
|
|
161
|
+
ck cursor # add Cursor integration (scoped .mdc rules)
|
|
162
|
+
ck copilot # add GitHub Copilot integration
|
|
163
|
+
ck codex # add Codex CLI integration (AGENTS.md)
|
|
164
|
+
ck gemini # add Gemini CLI integration (GEMINI.md)
|
|
165
|
+
ck aider # add Aider integration (CONVENTIONS.md)
|
|
166
|
+
ck continue # add Continue integration
|
|
167
|
+
ck windsurf # add Windsurf integration (.windsurfrules)
|
|
168
|
+
ck vscode # alias for copilot
|
|
169
|
+
|
|
170
|
+
# Analysis & Updates
|
|
171
|
+
ck analyze # customize standards to your project
|
|
172
|
+
ck update # pull latest updates
|
|
173
|
+
ck status # check install & integrations
|
|
174
|
+
|
|
175
|
+
# Validation & Compliance
|
|
176
|
+
ck check # validate installation & policy compliance
|
|
177
|
+
ck check --strict # treat warnings as errors
|
|
178
|
+
|
|
179
|
+
# Corrections Logging
|
|
180
|
+
ck note "message" # add note to corrections log
|
|
181
|
+
ck note "AI issue" --category "AI Behavior" --priority HIGH
|
|
182
|
+
|
|
183
|
+
# Workflow Orchestration
|
|
184
|
+
ck run <workflow> # run structured workflow
|
|
185
|
+
ck run create-component # example workflow
|
|
186
|
+
ck run create-component --interactive # interactive mode
|
|
187
|
+
|
|
188
|
+
# Registry & Versioning
|
|
189
|
+
ck publish --name @company/react-standards --version 1.0.0
|
|
190
|
+
ck pull @company/react-standards@1.0.0
|
|
191
|
+
ck pull @company/react-standards@latest --backup
|
|
192
|
+
|
|
193
|
+
# Observability
|
|
194
|
+
ck dashboard # start web dashboard
|
|
195
|
+
ck dashboard --no-server # CLI metrics only
|
|
196
|
+
|
|
197
|
+
# AI Usage (loads .contextkit context automatically)
|
|
198
|
+
ck "create a button" # quick AI chat with context
|
|
199
|
+
ck ai "create a button" # explicit AI command
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Links
|
|
203
|
+
|
|
204
|
+
• 🐛 [Issues](https://github.com/nolrm/contextkit/issues)
|
|
205
|
+
• 💬 [Discussions](https://github.com/nolrm/contextkit/discussions)
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## License
|
|
210
|
+
|
|
211
|
+
MIT
|
|
212
|
+
|
|
213
|
+
## Author
|
|
214
|
+
|
|
215
|
+
**Marlon Maniti**
|
|
216
|
+
GitHub: [@nolrm](https://github.com/nolrm)
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { program } = require('commander');
|
|
4
|
+
const chalk = require('chalk');
|
|
5
|
+
const { install, update, status } = require('../lib');
|
|
6
|
+
const analyze = require('../lib/commands/analyze');
|
|
7
|
+
const ai = require('../lib/commands/ai');
|
|
8
|
+
const check = require('../lib/commands/check');
|
|
9
|
+
const note = require('../lib/commands/note');
|
|
10
|
+
const run = require('../lib/commands/run');
|
|
11
|
+
const publish = require('../lib/commands/publish');
|
|
12
|
+
const pull = require('../lib/commands/pull');
|
|
13
|
+
const dashboard = require('../lib/commands/dashboard');
|
|
14
|
+
const packageJson = require('../package.json');
|
|
15
|
+
|
|
16
|
+
// Set up the CLI
|
|
17
|
+
program
|
|
18
|
+
.name('contextkit')
|
|
19
|
+
.description('ContextKit - Context Engineering for AI Development')
|
|
20
|
+
.version(packageJson.version, '-v, --version', 'Show version number');
|
|
21
|
+
|
|
22
|
+
// Install command
|
|
23
|
+
program
|
|
24
|
+
.command('install')
|
|
25
|
+
.description('Install ContextKit in current project')
|
|
26
|
+
.option('--no-hooks', 'Skip Git hooks installation')
|
|
27
|
+
.option('--non-interactive', 'Skip interactive prompts')
|
|
28
|
+
.action(async (options) => {
|
|
29
|
+
try {
|
|
30
|
+
await install(options);
|
|
31
|
+
} catch (error) {
|
|
32
|
+
console.error(chalk.red('Installation failed:'), error.message);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// Status command
|
|
38
|
+
program
|
|
39
|
+
.command('status')
|
|
40
|
+
.description('Check installation status')
|
|
41
|
+
.action(async () => {
|
|
42
|
+
try {
|
|
43
|
+
await status();
|
|
44
|
+
} catch (error) {
|
|
45
|
+
console.error(chalk.red('Status check failed:'), error.message);
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// Update command
|
|
51
|
+
program
|
|
52
|
+
.command('update')
|
|
53
|
+
.description('Update to latest version')
|
|
54
|
+
.option('--force', 'Force update even if no changes')
|
|
55
|
+
.action(async (options) => {
|
|
56
|
+
try {
|
|
57
|
+
await update(options);
|
|
58
|
+
} catch (error) {
|
|
59
|
+
console.error(chalk.red('Update failed:'), error.message);
|
|
60
|
+
process.exit(1);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// Analyze command
|
|
65
|
+
program
|
|
66
|
+
.command('analyze')
|
|
67
|
+
.description('Analyze project and customize ContextKit standards')
|
|
68
|
+
.option('--ai <tool>', 'AI tool to use (aider, claude, gemini)')
|
|
69
|
+
.option('--scope <scope>', 'Analysis scope: frontend, backend, both, or current (for monorepos)')
|
|
70
|
+
.option('--package <package>', 'Analyze specific package path (e.g., apps/admin)')
|
|
71
|
+
.option('--non-interactive', 'Skip interactive prompts (use defaults)')
|
|
72
|
+
.action(async (options) => {
|
|
73
|
+
try {
|
|
74
|
+
await analyze(options);
|
|
75
|
+
} catch (error) {
|
|
76
|
+
console.error(chalk.red('Analysis failed:'), error.message);
|
|
77
|
+
process.exit(1);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
// AI command with "ai" keyword
|
|
82
|
+
program
|
|
83
|
+
.command('ai <prompt>')
|
|
84
|
+
.description('Chat with AI using ContextKit context')
|
|
85
|
+
.option('--ai <tool>', 'AI tool to use (aider, claude, gemini)')
|
|
86
|
+
.action(async (prompt, options) => {
|
|
87
|
+
try {
|
|
88
|
+
await ai(prompt, options);
|
|
89
|
+
} catch (error) {
|
|
90
|
+
console.error(chalk.red('AI chat failed:'), error.message);
|
|
91
|
+
process.exit(1);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
// Check command
|
|
96
|
+
program
|
|
97
|
+
.command('check')
|
|
98
|
+
.description('Validate ContextKit installation and check policy compliance')
|
|
99
|
+
.option('--strict', 'Treat warnings as errors')
|
|
100
|
+
.option('--verbose', 'Show detailed information')
|
|
101
|
+
.action(async (options) => {
|
|
102
|
+
try {
|
|
103
|
+
await check(options);
|
|
104
|
+
} catch (error) {
|
|
105
|
+
console.error(chalk.red('Check failed:'), error.message);
|
|
106
|
+
process.exit(1);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
// Note command
|
|
111
|
+
program
|
|
112
|
+
.command('note <message>')
|
|
113
|
+
.description('Add a note to the corrections log')
|
|
114
|
+
.option('--category <category>', 'Category (Rule Updates, AI Behavior, Preferences)')
|
|
115
|
+
.option('--priority <priority>', 'Priority (HIGH, MEDIUM, LOW)', 'MEDIUM')
|
|
116
|
+
.option('--task <task>', 'Task/feature name')
|
|
117
|
+
.option('--changes <changes>', 'Changes description')
|
|
118
|
+
.action(async (message, options) => {
|
|
119
|
+
try {
|
|
120
|
+
await note(message, options);
|
|
121
|
+
} catch (error) {
|
|
122
|
+
console.error(chalk.red('Note failed:'), error.message);
|
|
123
|
+
process.exit(1);
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
// Run command
|
|
128
|
+
program
|
|
129
|
+
.command('run <workflow>')
|
|
130
|
+
.description('Run a workflow defined in instructions')
|
|
131
|
+
.option('--interactive', 'Interactive mode (pause between steps)')
|
|
132
|
+
.action(async (workflow, options) => {
|
|
133
|
+
try {
|
|
134
|
+
await run(workflow, options);
|
|
135
|
+
} catch (error) {
|
|
136
|
+
console.error(chalk.red('Workflow failed:'), error.message);
|
|
137
|
+
process.exit(1);
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
// Publish command
|
|
142
|
+
program
|
|
143
|
+
.command('publish')
|
|
144
|
+
.description('Publish current ContextKit configuration to registry')
|
|
145
|
+
.option('--name <name>', 'Package name (e.g., @company/react-standards)')
|
|
146
|
+
.option('--version <version>', 'Version (e.g., 1.0.0)')
|
|
147
|
+
.action(async (options) => {
|
|
148
|
+
try {
|
|
149
|
+
await publish(options);
|
|
150
|
+
} catch (error) {
|
|
151
|
+
console.error(chalk.red('Publish failed:'), error.message);
|
|
152
|
+
process.exit(1);
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
// Pull command
|
|
157
|
+
program
|
|
158
|
+
.command('pull <package>')
|
|
159
|
+
.description('Pull ContextKit configuration from registry')
|
|
160
|
+
.option('--force', 'Force overwrite existing .contextkit')
|
|
161
|
+
.option('--backup', 'Backup existing .contextkit before pulling')
|
|
162
|
+
.action(async (packageSpec, options) => {
|
|
163
|
+
try {
|
|
164
|
+
await pull(packageSpec, options);
|
|
165
|
+
} catch (error) {
|
|
166
|
+
console.error(chalk.red('Pull failed:'), error.message);
|
|
167
|
+
process.exit(1);
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
// Dashboard command
|
|
172
|
+
program
|
|
173
|
+
.command('dashboard')
|
|
174
|
+
.description('Start observability dashboard')
|
|
175
|
+
.option('--port <port>', 'Port number', '3001')
|
|
176
|
+
.option('--no-server', 'Display metrics only (no web server)')
|
|
177
|
+
.action(async (options) => {
|
|
178
|
+
try {
|
|
179
|
+
await dashboard(options);
|
|
180
|
+
} catch (error) {
|
|
181
|
+
console.error(chalk.red('Dashboard failed:'), error.message);
|
|
182
|
+
process.exit(1);
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
// Platform-specific install commands
|
|
187
|
+
program
|
|
188
|
+
.command('cursor')
|
|
189
|
+
.description('Install Cursor integration only')
|
|
190
|
+
.option('--non-interactive', 'Skip interactive prompts')
|
|
191
|
+
.action(async (options) => {
|
|
192
|
+
try {
|
|
193
|
+
await install({ platform: 'cursor', ...options });
|
|
194
|
+
} catch (error) {
|
|
195
|
+
console.error(chalk.red('Installation failed:'), error.message);
|
|
196
|
+
process.exit(1);
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
program
|
|
201
|
+
.command('continue')
|
|
202
|
+
.description('Install Continue integration only')
|
|
203
|
+
.option('--non-interactive', 'Skip interactive prompts')
|
|
204
|
+
.action(async (options) => {
|
|
205
|
+
try {
|
|
206
|
+
await install({ platform: 'continue', ...options });
|
|
207
|
+
} catch (error) {
|
|
208
|
+
console.error(chalk.red('Installation failed:'), error.message);
|
|
209
|
+
process.exit(1);
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
program
|
|
214
|
+
.command('aider')
|
|
215
|
+
.description('Install Aider integration only')
|
|
216
|
+
.option('--non-interactive', 'Skip interactive prompts')
|
|
217
|
+
.action(async (options) => {
|
|
218
|
+
try {
|
|
219
|
+
await install({ platform: 'aider', ...options });
|
|
220
|
+
} catch (error) {
|
|
221
|
+
console.error(chalk.red('Installation failed:'), error.message);
|
|
222
|
+
process.exit(1);
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
program
|
|
227
|
+
.command('vscode')
|
|
228
|
+
.description('Install VS Code integration only')
|
|
229
|
+
.option('--non-interactive', 'Skip interactive prompts')
|
|
230
|
+
.action(async (options) => {
|
|
231
|
+
try {
|
|
232
|
+
await install({ platform: 'vscode', ...options });
|
|
233
|
+
} catch (error) {
|
|
234
|
+
console.error(chalk.red('Installation failed:'), error.message);
|
|
235
|
+
process.exit(1);
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
program
|
|
240
|
+
.command('claude')
|
|
241
|
+
.description('Install Claude CLI integration only')
|
|
242
|
+
.option('--non-interactive', 'Skip interactive prompts')
|
|
243
|
+
.action(async (options) => {
|
|
244
|
+
try {
|
|
245
|
+
await install({ platform: 'claude', ...options });
|
|
246
|
+
} catch (error) {
|
|
247
|
+
console.error(chalk.red('Installation failed:'), error.message);
|
|
248
|
+
process.exit(1);
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
program
|
|
253
|
+
.command('gemini')
|
|
254
|
+
.description('Install Gemini CLI integration only')
|
|
255
|
+
.option('--non-interactive', 'Skip interactive prompts')
|
|
256
|
+
.action(async (options) => {
|
|
257
|
+
try {
|
|
258
|
+
await install({ platform: 'gemini', ...options });
|
|
259
|
+
} catch (error) {
|
|
260
|
+
console.error(chalk.red('Installation failed:'), error.message);
|
|
261
|
+
process.exit(1);
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
program
|
|
266
|
+
.command('codex')
|
|
267
|
+
.description('Install Codex CLI integration only')
|
|
268
|
+
.option('--non-interactive', 'Skip interactive prompts')
|
|
269
|
+
.action(async (options) => {
|
|
270
|
+
try {
|
|
271
|
+
await install({ platform: 'codex', ...options });
|
|
272
|
+
} catch (error) {
|
|
273
|
+
console.error(chalk.red('Installation failed:'), error.message);
|
|
274
|
+
process.exit(1);
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
program
|
|
279
|
+
.command('copilot')
|
|
280
|
+
.description('Install GitHub Copilot integration only')
|
|
281
|
+
.option('--non-interactive', 'Skip interactive prompts')
|
|
282
|
+
.action(async (options) => {
|
|
283
|
+
try {
|
|
284
|
+
await install({ platform: 'copilot', ...options });
|
|
285
|
+
} catch (error) {
|
|
286
|
+
console.error(chalk.red('Installation failed:'), error.message);
|
|
287
|
+
process.exit(1);
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
program
|
|
292
|
+
.command('windsurf')
|
|
293
|
+
.description('Install Windsurf integration only')
|
|
294
|
+
.option('--non-interactive', 'Skip interactive prompts')
|
|
295
|
+
.action(async (options) => {
|
|
296
|
+
try {
|
|
297
|
+
await install({ platform: 'windsurf', ...options });
|
|
298
|
+
} catch (error) {
|
|
299
|
+
console.error(chalk.red('Installation failed:'), error.message);
|
|
300
|
+
process.exit(1);
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
// Catch-all for unknown commands (treats them as prompts)
|
|
305
|
+
// This MUST be registered AFTER all commands but BEFORE parse()
|
|
306
|
+
program.on('command:*', function(args) {
|
|
307
|
+
// The command wasn't found, treat it as a prompt
|
|
308
|
+
const prompt = args.join(' ');
|
|
309
|
+
|
|
310
|
+
if (prompt) {
|
|
311
|
+
try {
|
|
312
|
+
ai(prompt, {}).catch(error => {
|
|
313
|
+
console.error(chalk.red('AI chat failed:'), error.message);
|
|
314
|
+
process.exit(1);
|
|
315
|
+
});
|
|
316
|
+
} catch (error) {
|
|
317
|
+
console.error(chalk.red('AI chat failed:'), error.message);
|
|
318
|
+
process.exit(1);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
// Parse command line arguments
|
|
324
|
+
program.parse();
|
package/bin/vibe-kit.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# install-fallback.sh - Fallback installation for users without Node.js
|
|
3
|
+
|
|
4
|
+
set -e
|
|
5
|
+
|
|
6
|
+
# Colors for output
|
|
7
|
+
RED='\033[0;31m'
|
|
8
|
+
GREEN='\033[0;32m'
|
|
9
|
+
YELLOW='\033[1;33m'
|
|
10
|
+
BLUE='\033[0;34m'
|
|
11
|
+
PURPLE='\033[0;35m'
|
|
12
|
+
NC='\033[0m' # No Color
|
|
13
|
+
|
|
14
|
+
echo -e "${PURPLE}🎵 ContextKit Installation${NC}"
|
|
15
|
+
echo ""
|
|
16
|
+
|
|
17
|
+
# Check if Node.js is available
|
|
18
|
+
if command -v node >/dev/null 2>&1; then
|
|
19
|
+
echo -e "${GREEN}✅ Node.js detected. Installing via npm...${NC}"
|
|
20
|
+
echo ""
|
|
21
|
+
|
|
22
|
+
# Install via npm
|
|
23
|
+
npm install -g @nolrm/contextkit
|
|
24
|
+
|
|
25
|
+
echo ""
|
|
26
|
+
echo -e "${GREEN}🎉 ContextKit installed successfully!${NC}"
|
|
27
|
+
echo ""
|
|
28
|
+
echo -e "${BLUE}📖 Usage:${NC}"
|
|
29
|
+
echo " contextkit install # Install in current project"
|
|
30
|
+
echo " contextkit status # Check installation status"
|
|
31
|
+
echo " contextkit update # Update to latest version"
|
|
32
|
+
echo ""
|
|
33
|
+
echo -e "${YELLOW}💡 Try: 'contextkit install' in your project directory${NC}"
|
|
34
|
+
|
|
35
|
+
else
|
|
36
|
+
echo -e "${YELLOW}⚠️ Node.js not found. Installing via shell script...${NC}"
|
|
37
|
+
echo ""
|
|
38
|
+
|
|
39
|
+
# Fallback to direct installation
|
|
40
|
+
echo -e "${BLUE}📥 Downloading installation script...${NC}"
|
|
41
|
+
|
|
42
|
+
# Download and run the legacy install.sh
|
|
43
|
+
curl -sSL https://raw.githubusercontent.com/nolrm/contextkit/main/legacy/install.sh | bash
|
|
44
|
+
|
|
45
|
+
echo ""
|
|
46
|
+
echo -e "${GREEN}🎉 ContextKit installed successfully!${NC}"
|
|
47
|
+
echo ""
|
|
48
|
+
echo -e "${BLUE}📖 Usage:${NC}"
|
|
49
|
+
echo " Use AI commands with @.contextkit/ references"
|
|
50
|
+
echo " Read .contextkit/standards/README.md for guidelines"
|
|
51
|
+
echo ""
|
|
52
|
+
echo -e "${YELLOW}💡 Try: 'Create a Button component following contextkit standards'${NC}"
|
|
53
|
+
echo ""
|
|
54
|
+
echo -e "${BLUE}💡 For CLI commands, install Node.js and run:${NC}"
|
|
55
|
+
echo " npm install -g @nolrm/contextkit"
|
|
56
|
+
fi
|
|
57
|
+
|
|
58
|
+
echo ""
|
|
59
|
+
echo -e "${PURPLE}🎵 Get the right vibe for your code!${NC}"
|