@handsupmin/gc-tree 0.7.7 → 0.7.9

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.
Files changed (2) hide show
  1. package/dist/src/cli.js +5 -2
  2. package/package.json +1 -1
package/dist/src/cli.js CHANGED
@@ -1,8 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import { existsSync } from 'node:fs';
3
3
  import { readFile } from 'node:fs/promises';
4
+ import { resolve } from 'node:path';
4
5
  import { stdin, stderr, stdout } from 'node:process';
5
6
  import { readAsciiLogo, readAsciiTree } from './ascii.js';
7
+ import { gctreeGlobalRoot } from './integration-files.js';
6
8
  import { dispatchGcTreeHook } from './hook.js';
7
9
  import { onboardBranch } from './onboard.js';
8
10
  import { buildProviderLaunchPlan, maybeLaunchProvider, promptLanguageSelection, promptLaunchProviderSelection, promptProviderSelection, } from './provider.js';
@@ -524,10 +526,11 @@ async function main() {
524
526
  const host = normalizeProviderMode(readArg('--host'));
525
527
  if (!host)
526
528
  usage();
527
- const targetDir = readArg('--target') || process.cwd();
529
+ const explicitTarget = readArg('--target');
530
+ const isGlobal = !explicitTarget || Object.values({ codex: gctreeGlobalRoot('codex'), claude: gctreeGlobalRoot('claude-code') }).some((r) => resolve(explicitTarget) === resolve(r));
528
531
  const result = await ensureScaffold({
529
532
  providerMode: host,
530
- targetDir,
533
+ ...(isGlobal ? { scope: 'global' } : { targetDir: explicitTarget, scope: 'local' }),
531
534
  force: hasFlag('--force'),
532
535
  });
533
536
  console.log(JSON.stringify(result, null, 2));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@handsupmin/gc-tree",
3
- "version": "0.7.7",
3
+ "version": "0.7.9",
4
4
  "description": "Global Context Tree, a lightweight branch-aware global context orchestrator for AI coding tools",
5
5
  "type": "module",
6
6
  "private": false,