@fractary/faber-cli 1.3.5 → 1.3.7

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.
@@ -39,6 +39,7 @@ export function createPlanCommand() {
39
39
  * Main execution logic for plan command
40
40
  */
41
41
  async function executePlanCommand(options) {
42
+ console.error('[DEBUG] Starting executePlanCommand');
42
43
  const outputFormat = options.json ? 'json' : options.output || 'text';
43
44
  // Validate arguments
44
45
  if (!options.workId && !options.workLabel) {
@@ -48,9 +49,13 @@ async function executePlanCommand(options) {
48
49
  throw new Error('Cannot use both --work-id and --work-label at the same time');
49
50
  }
50
51
  // Initialize clients
52
+ console.error('[DEBUG] Loading config...');
51
53
  const config = await ConfigManager.load();
54
+ console.error('[DEBUG] Creating RepoClient...');
52
55
  const repoClient = await RepoClient.create(config);
56
+ console.error('[DEBUG] Creating AnthropicClient...');
53
57
  const anthropicClient = new AnthropicClient(config);
58
+ console.error('[DEBUG] Clients initialized');
54
59
  if (outputFormat === 'text') {
55
60
  console.log(chalk.blue('FABER CLI - Workflow Planning'));
56
61
  console.log(chalk.gray('═'.repeat(50)));
@@ -133,11 +138,13 @@ async function executePlanCommand(options) {
133
138
  // Step 4: Plan each issue
134
139
  if (outputFormat === 'text') {
135
140
  console.log(chalk.cyan('\n→ Planning workflows...'));
141
+ process.stdout.write(''); // Force flush
136
142
  }
137
143
  const results = [];
138
144
  for (const issue of issuesWithWorkflows) {
139
145
  if (outputFormat === 'text') {
140
146
  console.log(chalk.gray(`\n[${results.length + 1}/${issuesWithWorkflows.length}] Issue #${issue.number}: ${issue.title}`));
147
+ process.stdout.write(''); // Force flush
141
148
  }
142
149
  try {
143
150
  const result = await planSingleIssue(issue, config, repoClient, anthropicClient, options, outputFormat);
@@ -263,6 +270,7 @@ async function planSingleIssue(issue, config, repoClient, anthropicClient, optio
263
270
  // Generate plan via Anthropic API
264
271
  if (outputFormat === 'text') {
265
272
  console.log(chalk.gray(' → Generating plan...'));
273
+ process.stdout.write(''); // Force flush
266
274
  }
267
275
  const plan = await anthropicClient.generatePlan({
268
276
  workflow: issue.workflow,
@@ -275,6 +283,7 @@ async function planSingleIssue(issue, config, repoClient, anthropicClient, optio
275
283
  if (!options.noBranch) {
276
284
  if (outputFormat === 'text') {
277
285
  console.log(chalk.gray(` → Creating branch: ${branch}...`));
286
+ process.stdout.write(''); // Force flush
278
287
  }
279
288
  await repoClient.createBranch(branch);
280
289
  }
@@ -283,6 +292,7 @@ async function planSingleIssue(issue, config, repoClient, anthropicClient, optio
283
292
  if (!options.noWorktree) {
284
293
  if (outputFormat === 'text') {
285
294
  console.log(chalk.gray(` → Creating worktree: ${worktree}...`));
295
+ process.stdout.write(''); // Force flush
286
296
  }
287
297
  const worktreeResult = await repoClient.createWorktree({
288
298
  workId: issue.number.toString(),
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAapC;;GAEG;AACH,wBAAgB,cAAc,IAAI,OAAO,CA4IxC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoBpC;;GAEG;AACH,wBAAgB,cAAc,IAAI,OAAO,CA4IxC"}
package/dist/index.js CHANGED
@@ -15,6 +15,11 @@ import { createLogsCommand } from './commands/logs/index.js';
15
15
  import { createInitCommand } from './commands/init.js';
16
16
  import { createPlanCommand } from './commands/plan/index.js';
17
17
  import { createAuthCommand } from './commands/auth/index.js';
18
+ // Force unbuffered output to prevent buffering issues in terminals
19
+ if (process.stdout.isTTY) {
20
+ process.stdout._handle?.setBlocking?.(true);
21
+ }
22
+ console.error('[DEBUG] CLI starting, args:', process.argv);
18
23
  const version = '1.3.2';
19
24
  /**
20
25
  * Create and configure the main CLI program
@@ -139,8 +144,11 @@ export function createFaberCLI() {
139
144
  const isMainModule = import.meta.url === `file://${process.argv[1]}` ||
140
145
  process.argv[1]?.endsWith('fractary-faber');
141
146
  if (isMainModule) {
147
+ console.error('[DEBUG] Creating CLI program');
142
148
  const program = createFaberCLI();
149
+ console.error('[DEBUG] Parsing argv');
143
150
  program.parse(process.argv);
151
+ console.error('[DEBUG] Parse complete');
144
152
  // Show help if no command provided
145
153
  if (!process.argv.slice(2).length) {
146
154
  program.outputHelp();
@@ -14,6 +14,11 @@ export declare class ConfigManager {
14
14
  * Load configuration
15
15
  */
16
16
  static load(): Promise<FaberConfig>;
17
+ /**
18
+ * Find config file by searching upwards from current directory
19
+ * Similar to how git finds .git directory
20
+ */
21
+ private static findConfigFile;
17
22
  /**
18
23
  * Read Claude Code configuration for worktree location
19
24
  */
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,oBAAoB,CAAC;AAEpE;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAc;IAE5B,OAAO;IAIP;;OAEG;WACU,IAAI,IAAI,OAAO,CAAC,WAAW,CAAC;IAgEzC;;OAEG;mBACkB,8BAA8B;IAoBnD;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAyBnC;;OAEG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,WAAW,GAAG,GAAG;CAGjC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,oBAAoB,CAAC;AAEpE;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAc;IAE5B,OAAO;IAIP;;OAEG;WACU,IAAI,IAAI,OAAO,CAAC,WAAW,CAAC;IAkEzC;;;OAGG;mBACkB,cAAc;IAwBnC;;OAEG;mBACkB,8BAA8B;IAoBnD;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAyBnC;;OAEG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,WAAW,GAAG,GAAG;CAGjC"}
@@ -25,23 +25,25 @@ export class ConfigManager {
25
25
  config.github = {
26
26
  token: process.env.GITHUB_TOKEN,
27
27
  };
28
- // Load from FABER config file
28
+ // Load from FABER config file - search upwards from current directory
29
29
  try {
30
- const faberConfigPath = path.join(process.cwd(), '.fractary', 'settings.json');
31
- const faberConfigContent = await fs.readFile(faberConfigPath, 'utf-8');
32
- const faberConfig = JSON.parse(faberConfigContent);
33
- // Merge with config
34
- if (faberConfig.anthropic) {
35
- config.anthropic = { ...config.anthropic, ...faberConfig.anthropic };
36
- }
37
- if (faberConfig.github) {
38
- config.github = { ...config.github, ...faberConfig.github };
39
- }
40
- if (faberConfig.worktree) {
41
- config.worktree = { ...config.worktree, ...faberConfig.worktree };
42
- }
43
- if (faberConfig.workflow) {
44
- config.workflow = { ...config.workflow, ...faberConfig.workflow };
30
+ const faberConfigPath = await ConfigManager.findConfigFile('.fractary', 'settings.json');
31
+ if (faberConfigPath) {
32
+ const faberConfigContent = await fs.readFile(faberConfigPath, 'utf-8');
33
+ const faberConfig = JSON.parse(faberConfigContent);
34
+ // Merge with config
35
+ if (faberConfig.anthropic) {
36
+ config.anthropic = { ...config.anthropic, ...faberConfig.anthropic };
37
+ }
38
+ if (faberConfig.github) {
39
+ config.github = { ...config.github, ...faberConfig.github };
40
+ }
41
+ if (faberConfig.worktree) {
42
+ config.worktree = { ...config.worktree, ...faberConfig.worktree };
43
+ }
44
+ if (faberConfig.workflow) {
45
+ config.workflow = { ...config.workflow, ...faberConfig.workflow };
46
+ }
45
47
  }
46
48
  }
47
49
  catch (error) {
@@ -72,6 +74,30 @@ export class ConfigManager {
72
74
  }
73
75
  return config;
74
76
  }
77
+ /**
78
+ * Find config file by searching upwards from current directory
79
+ * Similar to how git finds .git directory
80
+ */
81
+ static async findConfigFile(dirName, fileName) {
82
+ let currentDir = process.cwd();
83
+ const root = path.parse(currentDir).root;
84
+ while (true) {
85
+ const configPath = path.join(currentDir, dirName, fileName);
86
+ try {
87
+ await fs.access(configPath);
88
+ return configPath;
89
+ }
90
+ catch (error) {
91
+ // File doesn't exist, try parent directory
92
+ }
93
+ // Check if we've reached the root
94
+ if (currentDir === root) {
95
+ return null;
96
+ }
97
+ // Move to parent directory
98
+ currentDir = path.dirname(currentDir);
99
+ }
100
+ }
75
101
  /**
76
102
  * Read Claude Code configuration for worktree location
77
103
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fractary/faber-cli",
3
- "version": "1.3.5",
3
+ "version": "1.3.7",
4
4
  "description": "FABER CLI - Command-line interface for FABER development toolkit",
5
5
  "main": "dist/index.js",
6
6
  "bin": {