Skip to content
This repository was archived by the owner on Jan 29, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 115 additions & 0 deletions dist/cli/gemini-cli.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
/**
* Basic Gemini CLI implementation
*
* Simple Gemini CLI functionality for the bin/gemini-flow to use
*/

export class GeminiCLI {
constructor() {
this.models = ['gemini-1.5-flash', 'gemini-1.5-pro'];
}

async run() {
const args = process.argv.slice(2);

// Simple help output
if (args.length === 0 || args.includes('--help') || args.includes('-h')) {
this.showHelp();
return;
}

const command = args[0];

switch (command) {
case 'chat':
case 'c':
await this.handleChat(args.slice(1));
break;
case 'generate':
case 'g':
await this.handleGenerate(args.slice(1));
break;
case 'list-models':
case 'models':
this.handleListModels();
break;
case 'auth':
this.handleAuth(args.slice(1));
break;
default:
console.log(`Unknown command: ${command}`);
this.showHelp();
process.exit(1);
}
}

showHelp() {
console.log(`
Gemini-Flow CLI - Simple Gemini Interface

Usage:
gemini-flow [command] [options]

Commands:
chat, c Start interactive chat
generate, g Generate content from prompt
list-models, models List available models
auth Manage authentication

Options:
--help, -h Show help
--version Show version

Examples:
gemini-flow chat
gemini-flow generate "Hello world"
gemini-flow list-models
gemini-flow auth --key YOUR_API_KEY
`);
}

async handleChat(args) {
console.log('🤖 Gemini Chat Mode');
console.log('(Basic implementation - install dependencies for full functionality)');
console.log('Use Ctrl+C to exit');

// Basic prompt for demonstration
if (args.length > 0) {
console.log(`You: ${args.join(' ')}`);
console.log('Assistant: Hello! This is a basic CLI implementation. For full functionality, please ensure all dependencies are installed.');
}
}

async handleGenerate(args) {
if (args.length === 0) {
console.log('Error: Please provide a prompt for generation');
return;
}

const prompt = args.join(' ');
console.log(`Generating response for: "${prompt}"`);
console.log('Note: This is a basic CLI implementation. For full functionality, please ensure all dependencies are installed.');
}

handleListModels() {
console.log('Available models:');
this.models.forEach(model => {
console.log(` - ${model}`);
});
}

handleAuth(args) {
if (args.includes('--key')) {
const keyIndex = args.indexOf('--key') + 1;
if (keyIndex < args.length) {
console.log('API key configured (basic implementation)');
} else {
console.log('Error: Please provide an API key');
}
} else if (args.includes('--status')) {
console.log('Authentication status: Not implemented in basic CLI');
} else {
console.log('Auth commands: --key <key>, --status, --test, --clear');
}
}
}
29 changes: 29 additions & 0 deletions dist/cli/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env node
/**
* Gemini-Flow - AI Orchestration Platform CLI
*
* Main CLI entry point with full orchestration capabilities and simple mode fallback
*/
const args = process.argv.slice(2);
const isSimpleMode = process.env.GEMINI_FLOW_SIMPLE_MODE === "true" ||
args.includes("--simple-mode") ||
(args.length > 0 &&
["chat", "c", "generate", "g", "list-models", "models", "auth"].includes(args[0]));
if (isSimpleMode) {
// Use simplified CLI for basic Gemini commands
import("./simple-index.js").catch((error) => {
console.error("Failed to load simple CLI:", error.message);
process.exit(1);
});
}
else {
// Use full orchestration platform CLI
import("./full-index.js").catch((error) => {
console.error("Failed to load full CLI, falling back to simple mode...");
// Fallback to simple CLI if full CLI fails
import("./simple-index.js").catch((fallbackError) => {
console.error("Failed to load fallback CLI:", fallbackError.message);
process.exit(1);
});
});
}
Comment thread
clduab11 marked this conversation as resolved.
Loading