viepilot 1.0.0
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/CHANGELOG.md +230 -0
- package/LICENSE +23 -0
- package/README.md +550 -0
- package/bin/viepilot.cjs +222 -0
- package/bin/vp-tools.cjs +912 -0
- package/dev-install.sh +109 -0
- package/docs/README.md +125 -0
- package/docs/advanced-usage.md +366 -0
- package/docs/api/README.md +12 -0
- package/docs/api/graphql-schema.md +5 -0
- package/docs/api/kafka-events.md +5 -0
- package/docs/api/rest-api.md +19 -0
- package/docs/api/websocket-api.md +5 -0
- package/docs/dev/architecture.md +226 -0
- package/docs/dev/cli-reference.md +324 -0
- package/docs/dev/contributing.md +195 -0
- package/docs/dev/deployment.md +204 -0
- package/docs/dev/getting-started.md +16 -0
- package/docs/dev/testing.md +171 -0
- package/docs/dev/ui-components-library.md +36 -0
- package/docs/getting-started.md +163 -0
- package/docs/skills-reference.md +399 -0
- package/docs/troubleshooting.md +297 -0
- package/docs/user/faq.md +117 -0
- package/docs/user/features/autonomous-mode.md +111 -0
- package/docs/user/features/checkpoint-recovery.md +76 -0
- package/docs/user/features/debug-mode.md +77 -0
- package/docs/user/features/ui-direction.md +29 -0
- package/docs/user/quick-start.md +157 -0
- package/docs/videos/01-installation.md +113 -0
- package/docs/videos/02-first-project.md +132 -0
- package/docs/videos/03-autonomous-mode.md +147 -0
- package/install.sh +144 -0
- package/lib/cli-shared.cjs +108 -0
- package/package.json +78 -0
- package/skills/vp-audit/SKILL.md +140 -0
- package/skills/vp-auto/SKILL.md +204 -0
- package/skills/vp-brainstorm/SKILL.md +75 -0
- package/skills/vp-crystallize/SKILL.md +175 -0
- package/skills/vp-debug/SKILL.md +96 -0
- package/skills/vp-docs/SKILL.md +258 -0
- package/skills/vp-evolve/SKILL.md +165 -0
- package/skills/vp-pause/SKILL.md +150 -0
- package/skills/vp-request/SKILL.md +250 -0
- package/skills/vp-resume/SKILL.md +141 -0
- package/skills/vp-rollback/SKILL.md +116 -0
- package/skills/vp-status/SKILL.md +137 -0
- package/skills/vp-task/SKILL.md +139 -0
- package/skills/vp-ui-components/SKILL.md +64 -0
- package/templates/phase/PHASE-STATE.md +35 -0
- package/templates/phase/SPEC.md +40 -0
- package/templates/phase/SUMMARY.md +67 -0
- package/templates/phase/TASK.md +101 -0
- package/templates/phase/VERIFICATION.md +49 -0
- package/templates/project/AI-GUIDE.md +114 -0
- package/templates/project/ARCHITECTURE.md +70 -0
- package/templates/project/CHANGELOG.md +36 -0
- package/templates/project/CONTRIBUTING.md +154 -0
- package/templates/project/CONTRIBUTORS.md +41 -0
- package/templates/project/PROJECT-CONTEXT.md +74 -0
- package/templates/project/PROJECT-META.md +133 -0
- package/templates/project/README.md +197 -0
- package/templates/project/ROADMAP.md +56 -0
- package/templates/project/SYSTEM-RULES.md +368 -0
- package/templates/project/TRACKER.md +50 -0
- package/ui-components/INDEX.md +9 -0
- package/ui-components/base/button/README.md +8 -0
- package/ui-components/base/button/metadata.json +8 -0
- package/ui-components/base/card/README.md +8 -0
- package/ui-components/base/card/metadata.json +8 -0
- package/ui-components/base/input/README.md +8 -0
- package/ui-components/base/input/metadata.json +8 -0
- package/workflows/audit.md +549 -0
- package/workflows/autonomous.md +425 -0
- package/workflows/brainstorm.md +257 -0
- package/workflows/crystallize.md +418 -0
- package/workflows/debug.md +241 -0
- package/workflows/documentation.md +587 -0
- package/workflows/evolve.md +258 -0
- package/workflows/pause-work.md +255 -0
- package/workflows/request.md +534 -0
- package/workflows/resume-work.md +226 -0
- package/workflows/rollback.md +202 -0
- package/workflows/ui-components.md +109 -0
package/bin/viepilot.cjs
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Guided installer entrypoint for `npx viepilot`.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const path = require('path');
|
|
8
|
+
const { spawnSync } = require('child_process');
|
|
9
|
+
const readline = require('readline');
|
|
10
|
+
|
|
11
|
+
const TARGETS = [
|
|
12
|
+
{ id: 'claude-code', label: 'Claude Code' },
|
|
13
|
+
{ id: 'cursor-agent', label: 'Cursor Agent' },
|
|
14
|
+
{ id: 'cursor-ide', label: 'Cursor IDE' },
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
function printHelp() {
|
|
18
|
+
console.log(`
|
|
19
|
+
ViePilot CLI
|
|
20
|
+
|
|
21
|
+
Usage:
|
|
22
|
+
viepilot install [options]
|
|
23
|
+
viepilot --help
|
|
24
|
+
viepilot --list-targets
|
|
25
|
+
|
|
26
|
+
Install options:
|
|
27
|
+
--target <id|id,id|all> Target profile(s): claude-code,cursor-agent,cursor-ide
|
|
28
|
+
--yes Non-interactive mode (skip confirmations)
|
|
29
|
+
--dry-run Print actions only, do not execute installers
|
|
30
|
+
--list-targets Print supported targets and exit
|
|
31
|
+
--help Show help
|
|
32
|
+
`);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function printTargets() {
|
|
36
|
+
TARGETS.forEach((t) => {
|
|
37
|
+
console.log(`${t.id}\t${t.label}`);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function parseInstallArgs(args) {
|
|
42
|
+
const options = {
|
|
43
|
+
yes: false,
|
|
44
|
+
dryRun: false,
|
|
45
|
+
listTargets: false,
|
|
46
|
+
targets: null,
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
for (let i = 0; i < args.length; i++) {
|
|
50
|
+
const arg = args[i];
|
|
51
|
+
if (arg === '--yes') options.yes = true;
|
|
52
|
+
else if (arg === '--dry-run') options.dryRun = true;
|
|
53
|
+
else if (arg === '--list-targets') options.listTargets = true;
|
|
54
|
+
else if (arg === '--target') {
|
|
55
|
+
const value = args[i + 1];
|
|
56
|
+
if (!value) {
|
|
57
|
+
throw new Error('Missing value for --target');
|
|
58
|
+
}
|
|
59
|
+
options.targets = value;
|
|
60
|
+
i++;
|
|
61
|
+
} else if (arg === '--help' || arg === '-h') {
|
|
62
|
+
options.help = true;
|
|
63
|
+
} else {
|
|
64
|
+
throw new Error(`Unknown option: ${arg}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return options;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function normalizeTargets(rawTargets) {
|
|
72
|
+
if (!rawTargets) return null;
|
|
73
|
+
if (rawTargets === 'all') return TARGETS.map((t) => t.id);
|
|
74
|
+
const allowed = new Set(TARGETS.map((t) => t.id));
|
|
75
|
+
const parsed = rawTargets.split(',').map((s) => s.trim()).filter(Boolean);
|
|
76
|
+
if (parsed.length === 0) throw new Error('No targets provided');
|
|
77
|
+
for (const item of parsed) {
|
|
78
|
+
if (!allowed.has(item)) throw new Error(`Unsupported target: ${item}`);
|
|
79
|
+
}
|
|
80
|
+
return [...new Set(parsed)];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function ask(question) {
|
|
84
|
+
return new Promise((resolve) => {
|
|
85
|
+
const rl = readline.createInterface({
|
|
86
|
+
input: process.stdin,
|
|
87
|
+
output: process.stdout,
|
|
88
|
+
});
|
|
89
|
+
rl.question(question, (answer) => {
|
|
90
|
+
rl.close();
|
|
91
|
+
resolve(answer.trim());
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
async function interactiveTargetSelection() {
|
|
97
|
+
console.log('\nSelect install targets (comma-separated numbers):');
|
|
98
|
+
TARGETS.forEach((t, idx) => {
|
|
99
|
+
console.log(` ${idx + 1}. ${t.label} (${t.id})`);
|
|
100
|
+
});
|
|
101
|
+
console.log(' 4. All targets');
|
|
102
|
+
console.log(' 0. Cancel');
|
|
103
|
+
const answer = await ask('Choice: ');
|
|
104
|
+
|
|
105
|
+
if (answer === '0') return [];
|
|
106
|
+
if (answer === '4') return TARGETS.map((t) => t.id);
|
|
107
|
+
|
|
108
|
+
const indexes = answer
|
|
109
|
+
.split(',')
|
|
110
|
+
.map((x) => Number(x.trim()))
|
|
111
|
+
.filter((n) => Number.isInteger(n) && n >= 1 && n <= TARGETS.length);
|
|
112
|
+
|
|
113
|
+
const selected = [...new Set(indexes.map((n) => TARGETS[n - 1].id))];
|
|
114
|
+
return selected;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function handlerForTarget(target) {
|
|
118
|
+
const root = path.join(__dirname, '..');
|
|
119
|
+
if (target === 'cursor-agent') {
|
|
120
|
+
return {
|
|
121
|
+
script: path.join(root, 'dev-install.sh'),
|
|
122
|
+
env: { VIEPILOT_AUTO_YES: '1', VIEPILOT_INSTALL_PROFILE: target },
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
return {
|
|
126
|
+
script: path.join(root, 'install.sh'),
|
|
127
|
+
env: { VIEPILOT_AUTO_YES: '1', VIEPILOT_INSTALL_PROFILE: target },
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function runInstaller(target, dryRun) {
|
|
132
|
+
const config = handlerForTarget(target);
|
|
133
|
+
const commandLabel = `${config.script} [profile=${target}]`;
|
|
134
|
+
if (dryRun) {
|
|
135
|
+
console.log(`[dry-run] ${commandLabel}`);
|
|
136
|
+
return { ok: true, target, dryRun: true };
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const result = spawnSync('bash', [config.script], {
|
|
140
|
+
stdio: 'inherit',
|
|
141
|
+
env: { ...process.env, ...config.env },
|
|
142
|
+
cwd: path.join(__dirname, '..'),
|
|
143
|
+
});
|
|
144
|
+
return { ok: result.status === 0, target, code: result.status ?? 1 };
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
async function installCommand(rawArgs) {
|
|
148
|
+
const options = parseInstallArgs(rawArgs);
|
|
149
|
+
if (options.help) {
|
|
150
|
+
printHelp();
|
|
151
|
+
return 0;
|
|
152
|
+
}
|
|
153
|
+
if (options.listTargets) {
|
|
154
|
+
printTargets();
|
|
155
|
+
return 0;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
let selectedTargets = normalizeTargets(options.targets);
|
|
159
|
+
|
|
160
|
+
if (!selectedTargets) {
|
|
161
|
+
if (options.yes) {
|
|
162
|
+
selectedTargets = TARGETS.map((t) => t.id);
|
|
163
|
+
console.log('No --target provided with --yes; defaulting to all targets.');
|
|
164
|
+
} else {
|
|
165
|
+
selectedTargets = await interactiveTargetSelection();
|
|
166
|
+
if (selectedTargets.length === 0) {
|
|
167
|
+
console.log('Installation canceled.');
|
|
168
|
+
return 0;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
console.log(`\nSelected targets: ${selectedTargets.join(', ')}`);
|
|
174
|
+
const results = selectedTargets.map((target) => runInstaller(target, options.dryRun));
|
|
175
|
+
const failed = results.filter((r) => !r.ok);
|
|
176
|
+
|
|
177
|
+
console.log('\nInstall summary:');
|
|
178
|
+
for (const r of results) {
|
|
179
|
+
if (r.ok && r.dryRun) console.log(`- ${r.target}: planned`);
|
|
180
|
+
else if (r.ok) console.log(`- ${r.target}: installed`);
|
|
181
|
+
else console.log(`- ${r.target}: failed (exit ${r.code})`);
|
|
182
|
+
}
|
|
183
|
+
console.log('\nNext actions:');
|
|
184
|
+
console.log('- Open project in Cursor/Claude and run /vp-status');
|
|
185
|
+
console.log('- If needed, run /vp-brainstorm then /vp-crystallize');
|
|
186
|
+
|
|
187
|
+
return failed.length === 0 ? 0 : 1;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
async function main() {
|
|
191
|
+
const [, , command, ...rest] = process.argv;
|
|
192
|
+
if (!command || command === '--help' || command === '-h') {
|
|
193
|
+
printHelp();
|
|
194
|
+
process.exit(0);
|
|
195
|
+
}
|
|
196
|
+
if (command === '--list-targets') {
|
|
197
|
+
printTargets();
|
|
198
|
+
process.exit(0);
|
|
199
|
+
}
|
|
200
|
+
if (command !== 'install') {
|
|
201
|
+
console.error(`Unknown command: ${command}`);
|
|
202
|
+
printHelp();
|
|
203
|
+
process.exit(1);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
try {
|
|
207
|
+
const code = await installCommand(rest);
|
|
208
|
+
process.exit(code);
|
|
209
|
+
} catch (error) {
|
|
210
|
+
console.error(`Error: ${error.message}`);
|
|
211
|
+
process.exit(1);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
if (require.main === module) {
|
|
216
|
+
main();
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
module.exports = {
|
|
220
|
+
parseInstallArgs,
|
|
221
|
+
normalizeTargets,
|
|
222
|
+
};
|