@comfanion/workflow 4.5.1 ā 4.6.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/bin/cli.js +16 -5
- package/package.json +1 -1
- package/src/build-info.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -15,6 +15,10 @@ const OPENCODE_SRC = path.join(PACKAGE_DIR, 'src', 'opencode');
|
|
|
15
15
|
const REPO_TEMPLATES_SRC = path.join(PACKAGE_DIR, 'src', 'repo-structure');
|
|
16
16
|
const VECTORIZER_SRC = path.join(PACKAGE_DIR, 'src', 'vectorizer');
|
|
17
17
|
|
|
18
|
+
// Read version from package.json
|
|
19
|
+
const packageJson = JSON.parse(fs.readFileSync(path.join(PACKAGE_DIR, 'package.json'), 'utf8'));
|
|
20
|
+
const VERSION = packageJson.version;
|
|
21
|
+
|
|
18
22
|
/**
|
|
19
23
|
* Install vectorizer module with dependencies
|
|
20
24
|
*/
|
|
@@ -70,7 +74,7 @@ const program = new Command();
|
|
|
70
74
|
program
|
|
71
75
|
.name('create-opencode-workflow')
|
|
72
76
|
.description('Initialize OpenCode Workflow system for AI-assisted development')
|
|
73
|
-
.version(
|
|
77
|
+
.version(VERSION);
|
|
74
78
|
|
|
75
79
|
program
|
|
76
80
|
.command('init')
|
|
@@ -82,7 +86,7 @@ program
|
|
|
82
86
|
.option('--full', 'Create full repo structure')
|
|
83
87
|
.option('--vectorizer', 'Install vectorizer for semantic code search')
|
|
84
88
|
.action(async (options) => {
|
|
85
|
-
console.log(chalk.blue.bold(
|
|
89
|
+
console.log(chalk.blue.bold(`\nš OpenCode Workflow v${VERSION}\n`));
|
|
86
90
|
|
|
87
91
|
const targetDir = path.join(process.cwd(), '.opencode');
|
|
88
92
|
const existingConfigPath = path.join(targetDir, 'config.yaml');
|
|
@@ -633,6 +637,7 @@ program
|
|
|
633
637
|
.command('index')
|
|
634
638
|
.description('Index codebase for semantic search')
|
|
635
639
|
.option('-i, --index <name>', 'Index name: code, docs, config, all, or custom', 'code')
|
|
640
|
+
.option('-d, --dir <path>', 'Directory to index (default: current directory)')
|
|
636
641
|
.option('-p, --pattern <glob>', 'File pattern (overrides preset)')
|
|
637
642
|
.option('--force', 'Re-index all files (ignore cache)')
|
|
638
643
|
.option('--list', 'List all indexes and their stats')
|
|
@@ -699,6 +704,11 @@ program
|
|
|
699
704
|
const { glob } = await import('glob');
|
|
700
705
|
const { default: ignore } = await import('ignore');
|
|
701
706
|
|
|
707
|
+
// Determine base directory
|
|
708
|
+
const baseDir = options.dir
|
|
709
|
+
? path.resolve(process.cwd(), options.dir)
|
|
710
|
+
: process.cwd();
|
|
711
|
+
|
|
702
712
|
// Load .gitignore
|
|
703
713
|
let ig = ignore();
|
|
704
714
|
try {
|
|
@@ -707,16 +717,17 @@ program
|
|
|
707
717
|
} catch {}
|
|
708
718
|
ig.add(['node_modules', '.git', 'dist', 'build', '.opencode/vectors', '.opencode/vectorizer']);
|
|
709
719
|
|
|
710
|
-
const files = await glob(pattern, { cwd:
|
|
720
|
+
const files = await glob(pattern, { cwd: baseDir, nodir: true });
|
|
711
721
|
const filtered = files.filter(f => !ig.ignores(f));
|
|
712
722
|
|
|
713
|
-
|
|
723
|
+
const dirLabel = options.dir ? ` in ${options.dir}` : '';
|
|
724
|
+
spinner.succeed(`Found ${filtered.length} files for index "${indexName}"${dirLabel}`);
|
|
714
725
|
|
|
715
726
|
let indexed = 0;
|
|
716
727
|
let skipped = 0;
|
|
717
728
|
|
|
718
729
|
for (const file of filtered) {
|
|
719
|
-
const filePath = path.join(
|
|
730
|
+
const filePath = path.join(baseDir, file);
|
|
720
731
|
spinner.start(`[${indexName}] Indexing: ${file}`);
|
|
721
732
|
|
|
722
733
|
try {
|
package/package.json
CHANGED