@comfanion/workflow 4.5.2 → 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 CHANGED
@@ -637,6 +637,7 @@ program
637
637
  .command('index')
638
638
  .description('Index codebase for semantic search')
639
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)')
640
641
  .option('-p, --pattern <glob>', 'File pattern (overrides preset)')
641
642
  .option('--force', 'Re-index all files (ignore cache)')
642
643
  .option('--list', 'List all indexes and their stats')
@@ -703,6 +704,11 @@ program
703
704
  const { glob } = await import('glob');
704
705
  const { default: ignore } = await import('ignore');
705
706
 
707
+ // Determine base directory
708
+ const baseDir = options.dir
709
+ ? path.resolve(process.cwd(), options.dir)
710
+ : process.cwd();
711
+
706
712
  // Load .gitignore
707
713
  let ig = ignore();
708
714
  try {
@@ -711,16 +717,17 @@ program
711
717
  } catch {}
712
718
  ig.add(['node_modules', '.git', 'dist', 'build', '.opencode/vectors', '.opencode/vectorizer']);
713
719
 
714
- const files = await glob(pattern, { cwd: process.cwd(), nodir: true });
720
+ const files = await glob(pattern, { cwd: baseDir, nodir: true });
715
721
  const filtered = files.filter(f => !ig.ignores(f));
716
722
 
717
- spinner.succeed(`Found ${filtered.length} files for index "${indexName}"`);
723
+ const dirLabel = options.dir ? ` in ${options.dir}` : '';
724
+ spinner.succeed(`Found ${filtered.length} files for index "${indexName}"${dirLabel}`);
718
725
 
719
726
  let indexed = 0;
720
727
  let skipped = 0;
721
728
 
722
729
  for (const file of filtered) {
723
- const filePath = path.join(process.cwd(), file);
730
+ const filePath = path.join(baseDir, file);
724
731
  spinner.start(`[${indexName}] Indexing: ${file}`);
725
732
 
726
733
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comfanion/workflow",
3
- "version": "4.5.2",
3
+ "version": "4.6.0",
4
4
  "description": "Initialize OpenCode Workflow system for AI-assisted development with semantic code search",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "3.0.0",
3
- "buildDate": "2026-01-24T09:18:56.694Z",
3
+ "buildDate": "2026-01-24T09:20:56.596Z",
4
4
  "files": [
5
5
  "config.yaml",
6
6
  "FLOW.yaml",