@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 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('3.7.1');
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('\nšŸš€ OpenCode Workflow v3.7\n'));
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: process.cwd(), nodir: true });
720
+ const files = await glob(pattern, { cwd: baseDir, nodir: true });
711
721
  const filtered = files.filter(f => !ig.ignores(f));
712
722
 
713
- 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}`);
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(process.cwd(), file);
730
+ const filePath = path.join(baseDir, file);
720
731
  spinner.start(`[${indexName}] Indexing: ${file}`);
721
732
 
722
733
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comfanion/workflow",
3
- "version": "4.5.1",
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:17:28.192Z",
3
+ "buildDate": "2026-01-24T09:20:56.596Z",
4
4
  "files": [
5
5
  "config.yaml",
6
6
  "FLOW.yaml",