multi-agents-cli 1.1.15 → 1.1.17

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.
@@ -775,6 +775,95 @@ const main = async () => {
775
775
  guards.validateConfig(config, ROOT);
776
776
  const tracking = guards.loadTracking(ROOT, config);
777
777
 
778
+ // ── Claude Code CLI gate ───────────────────────────────────────────────────
779
+
780
+ const checkClaudeAuth = () => {
781
+ try { execSync('claude --version', { stdio: 'pipe' }); return true; } catch { return false; }
782
+ };
783
+
784
+ const installClaudeCode = () => {
785
+ const frames = ['⠋','⠙','⠹','⠸','⠼','⠴','⠦','⠧','⠇','⠏'];
786
+ let i = 0;
787
+ const spin = setInterval(() => process.stdout.write(`\r ${frames[i++ % frames.length]} Installing Claude Code CLI...`), 60);
788
+ try {
789
+ execSync('npm install -g @anthropic-ai/claude-code', { stdio: 'pipe' });
790
+ clearInterval(spin);
791
+ process.stdout.write('\r' + ' '.repeat(40) + '\r');
792
+ console.log(` ${green('✓')} Claude Code CLI installed\n`);
793
+ return true;
794
+ } catch {
795
+ clearInterval(spin);
796
+ process.stdout.write('\r' + ' '.repeat(40) + '\r');
797
+ console.log(` ${red('✖')} Installation failed - try manually: ${cyan('npm install -g @anthropic-ai/claude-code')}\n`);
798
+ return false;
799
+ }
800
+ };
801
+
802
+ const runClaudeLogin = () => {
803
+ const { spawnSync } = require('child_process');
804
+ console.log(`\n ${dim('Running claude login...')}\n`);
805
+ const result = spawnSync('claude', ['login'], { stdio: 'inherit' });
806
+ return result.status === 0;
807
+ };
808
+
809
+ let claudeInstalled = false;
810
+ try { execSync('which claude', { stdio: 'pipe' }); claudeInstalled = true; } catch {}
811
+
812
+ if (!claudeInstalled) {
813
+ console.log(`\n${red(' ✖ Claude Code CLI not found.')}\n`);
814
+ const installIdx = await prompts({
815
+ type: 'select',
816
+ name: 'value',
817
+ message: 'How would you like to proceed?',
818
+ choices: [
819
+ { title: `${green('→')} I have an account - install Claude Code for me`, value: 0 },
820
+ { title: `${dim('→')} I don\'t have an account yet - show me how to get started`, value: 1 },
821
+ { title: `${dim('←')} Exit`, value: 2 },
822
+ ],
823
+ }, { onCancel: () => process.exit(0) });
824
+
825
+ if (installIdx.value === 2 || installIdx.value === undefined) process.exit(0);
826
+
827
+ if (installIdx.value === 1) {
828
+ console.log(`\n ${bold('To get started with Claude Code:')}\n`);
829
+ console.log(` ${bold('1.')} Create a free account at ${cyan('https://claude.ai/signup')}`);
830
+ console.log(` ${bold('2.')} Install Claude Code: ${cyan('npm install -g @anthropic-ai/claude-code')}`);
831
+ console.log(` ${bold('3.')} Authenticate: ${cyan('claude login')}`);
832
+ console.log(` ${bold('4.')} Re-run: ${cyan('npm run agent')}\n`);
833
+ const { execSync: _open } = require('child_process');
834
+ try { _open('open https://claude.ai/signup', { stdio: 'pipe' }); } catch {}
835
+ process.exit(0);
836
+ }
837
+
838
+ const installed = installClaudeCode();
839
+ if (!installed) process.exit(1);
840
+ }
841
+
842
+ // Auth check
843
+ let claudeAuthed = false;
844
+ try { execSync('claude --version', { stdio: 'pipe' }); claudeAuthed = true; } catch {}
845
+
846
+ if (!claudeAuthed) {
847
+ console.log(`\n${red(' ✖ Claude Code not authenticated.')}\n`);
848
+ const authIdx = await prompts({
849
+ type: 'select',
850
+ name: 'value',
851
+ message: 'How would you like to proceed?',
852
+ choices: [
853
+ { title: `${green('→')} Run claude login now`, value: 0 },
854
+ { title: `${dim('←')} Exit`, value: 1 },
855
+ ],
856
+ }, { onCancel: () => process.exit(0) });
857
+
858
+ if (authIdx.value === 1 || authIdx.value === undefined) process.exit(0);
859
+ const loggedIn = runClaudeLogin();
860
+ if (!loggedIn) {
861
+ console.log(`\n ${red('✖')} Login failed - re-run ${cyan('npm run agent')} after authenticating\n`);
862
+ process.exit(1);
863
+ }
864
+ }
865
+
866
+
778
867
  // ── Project status snapshot ───────────────────────────────────────────────────
779
868
 
780
869
  const rawEntries = parseBuildState();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "multi-agents-cli",
3
- "version": "1.1.15",
3
+ "version": "1.1.17",
4
4
  "description": "Multi-agent workflow orchestration for Claude Code — isolated git worktrees, structured state tracking, autonomous task chaining",
5
5
  "keywords": [
6
6
  "claude-code",