declare-cc 0.3.0 → 0.3.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/bin/install.js +33 -38
- package/package.json +1 -1
package/bin/install.js
CHANGED
|
@@ -128,16 +128,16 @@ function getGlobalDir(runtime, explicitDir = null) {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
const banner = '\n' +
|
|
131
|
-
cyan + '
|
|
132
|
-
'
|
|
133
|
-
' ██║
|
|
134
|
-
' ██║
|
|
135
|
-
'
|
|
136
|
-
'
|
|
131
|
+
cyan + ' ██████╗ ███████╗ ██████╗██╗ █████╗ ██████╗ ███████╗\n' +
|
|
132
|
+
' ██╔══██╗██╔════╝██╔════╝██║ ██╔══██╗██╔══██╗██╔════╝\n' +
|
|
133
|
+
' ██║ ██║█████╗ ██║ ██║ ███████║██████╔╝█████╗\n' +
|
|
134
|
+
' ██║ ██║██╔══╝ ██║ ██║ ██╔══██║██╔══██╗██╔══╝\n' +
|
|
135
|
+
' ██████╔╝███████╗╚██████╗███████╗██║ ██║██║ ██║███████╗\n' +
|
|
136
|
+
' ╚═════╝ ╚══════╝ ╚═════╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝' + reset + '\n' +
|
|
137
137
|
'\n' +
|
|
138
|
-
'
|
|
139
|
-
' A meta-prompting
|
|
140
|
-
'
|
|
138
|
+
' Declare ' + dim + 'v' + pkg.version + reset + '\n' +
|
|
139
|
+
' A future-driven meta-prompting engine for agentic development.\n' +
|
|
140
|
+
' Forked from GSD · https://github.com/decocms/declare-cc\n';
|
|
141
141
|
|
|
142
142
|
// Parse --config-dir argument
|
|
143
143
|
function parseConfigDirArg() {
|
|
@@ -171,7 +171,7 @@ console.log(banner);
|
|
|
171
171
|
|
|
172
172
|
// Show help if requested
|
|
173
173
|
if (hasHelp) {
|
|
174
|
-
console.log(` ${yellow}Usage:${reset} npx
|
|
174
|
+
console.log(` ${yellow}Usage:${reset} npx declare-cc [options]\n\n ${yellow}Options:${reset}\n ${cyan}-g, --global${reset} Install globally (to config directory)\n ${cyan}-l, --local${reset} Install locally (to current directory)\n ${cyan}--claude${reset} Install for Claude Code only\n ${cyan}--opencode${reset} Install for OpenCode only\n ${cyan}--gemini${reset} Install for Gemini only\n ${cyan}--all${reset} Install for all runtimes\n ${cyan}-u, --uninstall${reset} Uninstall Declare (remove all Declare files)\n ${cyan}-c, --config-dir <path>${reset} Specify custom config directory\n ${cyan}-h, --help${reset} Show this help message\n ${cyan}--force-statusline${reset} Replace existing statusline config\n\n ${yellow}Examples:${reset}\n ${dim}# Interactive install (prompts for runtime and location)${reset}\n npx declare-cc\n\n ${dim}# Install for Claude Code globally${reset}\n npx declare-cc --claude --global\n\n ${dim}# Install for Gemini globally${reset}\n npx declare-cc --gemini --global\n\n ${dim}# Install for all runtimes globally${reset}\n npx declare-cc --all --global\n\n ${dim}# Install to custom config directory${reset}\n npx declare-cc --claude --global --config-dir ~/.claude-bc\n\n ${dim}# Install to current project only${reset}\n npx declare-cc --claude --local\n\n ${dim}# Uninstall Declare from Claude Code globally${reset}\n npx declare-cc --claude --global --uninstall\n\n ${yellow}Notes:${reset}\n The --config-dir option is useful when you have multiple configurations.\n It takes priority over CLAUDE_CONFIG_DIR / GEMINI_CONFIG_DIR environment variables.\n`);
|
|
175
175
|
process.exit(0);
|
|
176
176
|
}
|
|
177
177
|
|
|
@@ -1369,41 +1369,32 @@ function install(isGlobal, runtime = 'claude') {
|
|
|
1369
1369
|
// OpenCode: flat structure in command/ directory
|
|
1370
1370
|
const commandDir = path.join(targetDir, 'command');
|
|
1371
1371
|
fs.mkdirSync(commandDir, { recursive: true });
|
|
1372
|
-
|
|
1373
|
-
// Copy commands/
|
|
1374
|
-
const
|
|
1375
|
-
copyFlattenedCommands(
|
|
1376
|
-
|
|
1377
|
-
|
|
1372
|
+
|
|
1373
|
+
// Copy commands/declare/*.md as command/declare-*.md (flatten structure)
|
|
1374
|
+
const declareSrc = path.join(src, 'commands', 'declare');
|
|
1375
|
+
copyFlattenedCommands(declareSrc, commandDir, 'declare', pathPrefix, runtime);
|
|
1376
|
+
const count = fs.readdirSync(commandDir).filter(f => f.startsWith('declare-')).length;
|
|
1377
|
+
if (count > 0) {
|
|
1378
1378
|
console.log(` ${green}✓${reset} Installed ${count} commands to command/`);
|
|
1379
1379
|
} else {
|
|
1380
|
-
failures.push('command/
|
|
1380
|
+
failures.push('command/declare-*');
|
|
1381
1381
|
}
|
|
1382
1382
|
} else {
|
|
1383
1383
|
// Claude Code & Gemini: nested structure in commands/ directory
|
|
1384
1384
|
const commandsDir = path.join(targetDir, 'commands');
|
|
1385
1385
|
fs.mkdirSync(commandsDir, { recursive: true });
|
|
1386
|
-
|
|
1387
|
-
const
|
|
1388
|
-
const
|
|
1389
|
-
copyWithPathReplacement(
|
|
1390
|
-
if (verifyInstalled(
|
|
1391
|
-
|
|
1386
|
+
|
|
1387
|
+
const declareSrc = path.join(src, 'commands', 'declare');
|
|
1388
|
+
const declareDest = path.join(commandsDir, 'declare');
|
|
1389
|
+
copyWithPathReplacement(declareSrc, declareDest, pathPrefix, runtime);
|
|
1390
|
+
if (verifyInstalled(declareDest, 'commands/declare')) {
|
|
1391
|
+
const count = fs.readdirSync(declareDest).filter(f => f.endsWith('.md')).length;
|
|
1392
|
+
console.log(` ${green}✓${reset} Installed ${count} commands to commands/declare`);
|
|
1392
1393
|
} else {
|
|
1393
|
-
failures.push('commands/
|
|
1394
|
+
failures.push('commands/declare');
|
|
1394
1395
|
}
|
|
1395
1396
|
}
|
|
1396
1397
|
|
|
1397
|
-
// Copy get-shit-done skill with path replacement
|
|
1398
|
-
const skillSrc = path.join(src, 'get-shit-done');
|
|
1399
|
-
const skillDest = path.join(targetDir, 'get-shit-done');
|
|
1400
|
-
copyWithPathReplacement(skillSrc, skillDest, pathPrefix, runtime);
|
|
1401
|
-
if (verifyInstalled(skillDest, 'get-shit-done')) {
|
|
1402
|
-
console.log(` ${green}✓${reset} Installed get-shit-done`);
|
|
1403
|
-
} else {
|
|
1404
|
-
failures.push('get-shit-done');
|
|
1405
|
-
}
|
|
1406
|
-
|
|
1407
1398
|
// Copy agents to agents directory
|
|
1408
1399
|
const agentsSrc = path.join(src, 'agents');
|
|
1409
1400
|
if (fs.existsSync(agentsSrc)) {
|
|
@@ -1444,9 +1435,13 @@ function install(isGlobal, runtime = 'claude') {
|
|
|
1444
1435
|
}
|
|
1445
1436
|
}
|
|
1446
1437
|
|
|
1438
|
+
// Ensure declare/ metadata dir exists for VERSION and CHANGELOG
|
|
1439
|
+
const declareMetaDir = path.join(targetDir, 'declare');
|
|
1440
|
+
fs.mkdirSync(declareMetaDir, { recursive: true });
|
|
1441
|
+
|
|
1447
1442
|
// Copy CHANGELOG.md
|
|
1448
1443
|
const changelogSrc = path.join(src, 'CHANGELOG.md');
|
|
1449
|
-
const changelogDest = path.join(
|
|
1444
|
+
const changelogDest = path.join(declareMetaDir, 'CHANGELOG.md');
|
|
1450
1445
|
if (fs.existsSync(changelogSrc)) {
|
|
1451
1446
|
fs.copyFileSync(changelogSrc, changelogDest);
|
|
1452
1447
|
if (verifyFileInstalled(changelogDest, 'CHANGELOG.md')) {
|
|
@@ -1457,7 +1452,7 @@ function install(isGlobal, runtime = 'claude') {
|
|
|
1457
1452
|
}
|
|
1458
1453
|
|
|
1459
1454
|
// Write VERSION file
|
|
1460
|
-
const versionDest = path.join(
|
|
1455
|
+
const versionDest = path.join(declareMetaDir, 'VERSION');
|
|
1461
1456
|
fs.writeFileSync(versionDest, pkg.version);
|
|
1462
1457
|
if (verifyFileInstalled(versionDest, 'VERSION')) {
|
|
1463
1458
|
console.log(` ${green}✓${reset} Wrote VERSION (${pkg.version})`);
|
|
@@ -1590,11 +1585,11 @@ function finishInstall(settingsPath, settings, statuslineCommand, shouldInstallS
|
|
|
1590
1585
|
if (runtime === 'opencode') program = 'OpenCode';
|
|
1591
1586
|
if (runtime === 'gemini') program = 'Gemini';
|
|
1592
1587
|
|
|
1593
|
-
const command = isOpencode ? '/
|
|
1588
|
+
const command = isOpencode ? '/declare-help' : '/declare:help';
|
|
1594
1589
|
console.log(`
|
|
1595
1590
|
${green}Done!${reset} Launch ${program} and run ${cyan}${command}${reset}.
|
|
1596
1591
|
|
|
1597
|
-
${cyan}
|
|
1592
|
+
${cyan}Docs & source:${reset} https://github.com/decocms/declare-cc
|
|
1598
1593
|
`);
|
|
1599
1594
|
}
|
|
1600
1595
|
|
package/package.json
CHANGED