New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

galaxy-code

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

galaxy-code

Galaxy Code - AI-powered coding assistant with MCP integration

npmnpm
Version
0.1.2
Version published
Weekly downloads
9
800%
Maintainers
1
Weekly downloads
 
Created
Source

🌌 Galaxy CLI

AI Pair Programming Tool - Công cụ lập trình với AI trợ lý thông minh, hỗ trợ phân tích, lập kế hoạch và tạo code tự động.

⚠️ Trạng thái Alpha

Dự án đang trong giai đoạn phát triển Alpha

Galaxy CLI hiện đang trong giai đoạn phát triển và thử nghiệm Alpha. Phiên bản chính thức (stable release) sẽ được công bố trong tương lai khi dự án đã hoàn thiện và được kiểm thử kỹ lưỡng.

Lưu ý:

  • ⚠️ Dự án chưa được public trên GitHub hay các kho package registry
  • 🔄 API và cấu trúc có thể thay đổi trong quá trình phát triển
  • ⛔ Không khuyến nghị sử dụng cho môi trường production hiện tại

Để cập nhật thông tin về phiên bản chính thức:

  • 📧 Email: kevinbui210191@gmail.com / hieubt2@msb.com.vn
  • 📱 Theo dõi repository để nhận thông báo khi project được public

📋 Mục lục

🎯 Giới thiệu

Galaxy CLI là công cụ AI pair programming mạnh mẽ được xây dựng với:

  • Giao diện CLI hiện đại sử dụng Ink (React for CLI)
  • Multi-AI orchestration với Gemini 2.5 Flash làm trung tâm điều phối
  • 27+ công cụ chuyên biệt cho file operations, git, testing, document parsing
  • Intelligent planning với qwen3-coder:480b-cloud
  • Business Analysis với gpt-oss:120b-cloud

🛠 Công nghệ sử dụng

Frontend CLI

  • Ink - React cho terminal, render component như web app
  • ink-spinner - Loading animations (dots, arc, etc.)
  • figlet - ASCII art banner
  • TypeScript - Type safety

AI & LLM Stack

  • Google Gemini 2.5 Flash - Orchestrator chính, tool calling
  • Ollama Models:
    • gpt-oss:120b-cloud - Business Analysis & Requirements
    • qwen3-coder:480b-cloud - Code generation & Planning

Tools & Utilities

  • Bun - Fast runtime và package manager
  • PDF/DOCX/XLSX parsers - Document analysis
  • Node.js child_process - Command execution
  • Git CLI integration - Version control

🏗 Kiến trúc hệ thống

┌─────────────────────────────────────────────┐
│         Galaxy CLI (Ink React App)          │
│  - User Input với autocomplete              │
│  - Spinner loading states                   │
│  - Figlet banner                            │
└─────────────────┬───────────────────────────┘
                  │
                  ▼
┌─────────────────────────────────────────────┐
│      Gemini 2.5 Flash (Orchestrator)        │
│  - Tool calling & function execution        │
│  - Plan execution & todos display           │
│  - Multi-language support (EN/VI)           │
└─────────────────┬───────────────────────────┘
                  │
        ┌─────────┴─────────────┐
        │                       │
        ▼                       ▼
┌───────────────┐       ┌──────────────────┐
│  BA Analyzer  │       │ Planning Agent   │
│ gpt-oss:120b  │       │ qwen3-coder:480b │
│               │       │ Feature-driven   │
└───────────────┘       └──────────────────┘
        │                       │
        │                       ▼
        │               ┌──────────────────────┐
        │               │ Execution Plan       │
        │               │ - Feature steps      │
        │               │ - Tool selection     │
        │               └──────────────────────┘
        │                       │
        └───────────┬───────────┘
                    ▼
        ┌───────────────────────────┐
        │   Code Generate Agent     │
        │   qwen3-coder:480b-cloud  │
        │                           │
        │ ┌─────────────────────┐   │
        │ │ Integrated Tools:   │   │
        │ │ - file_write        │   │
        │ │ - file_read         │   │
        │ │ - command_run       │   │
        │ │ - file_search       │   │
        │ └─────────────────────┘   │
        │                           │
        │ Output: {step, status,    │
        │  message, filesCreated}   │
        └───────────────────────────┘
                    │
                    ▼
        ┌───────────────────────────┐
        │  Tool Registry (28 tools) │
        │                           │
        │  📁 File   🔧 Command     │
        │  🔀 Git    📝 Document    │
        │  🧪 Test   🔍 Search      │
        └───────────────────────────┘

Design Pattern: Orchestrator + Tools

Trước đây (Multi-agent):

  • 11 agents riêng biệt
  • Phức tạp, khó maintain
  • Nhiều context switching

Hiện tại (Feature-Driven):

  • 1 Orchestrator (Gemini) - Điều phối & todos display
  • 3 Specialized agents:
    • BA Analyzer (gpt-oss) - Requirements analysis
    • Planning Agent (qwen3-coder) - Feature-based planning
    • Code Generate Agent (qwen3-coder) - Self-contained executor
  • 28 focused tools
  • Feature-driven execution (1 feature = 1 step)

🔄 Luồng hoạt động

1️⃣ Analyze Existing Project

User: "Phân tích dự án này"
  │
  ├─> file_tree(cwd) → Lấy cấu trúc thư mục
  ├─> file_read(package.json, README) → Đọc tech stack
  └─> Trả về phân tích toàn diện

Output: Project description, tech stack, features, architecture

2️⃣ Create New Project

User: "Tạo app Next.js e-commerce"
  │
  ├─> 🔍 ba_it_analyze(userRequest, context)
  │     ↓
  │   ┌─────────────────────────────────────┐
  │   │ BA Analysis Result (English)        │
  │   │ - projectName                       │
  │   │ - type: "create_project"            │
  │   │ - coreFeatures: [...]               │
  │   │ - technicalStack: {...}             │
  │   │ - estimatedDevelopmentTime          │
  │   │ - recommendations: [...]            │
  │   │ - questionsForUser: [...]           │
  │   └─────────────────────────────────────┘
  │     ↓
  ├─> 📊 PRESENT to User (Vietnamese/English)
  │
  │   📊 **Phân tích dự án**: Next.js E-commerce
  │   💡 **Mô tả**: Ứng dụng thương mại điện tử...
  │
  │   **✨ Tính năng chính**:
  │   - Catalog sản phẩm
  │   - Giỏ hàng
  │   - Thanh toán (Stripe)
  │   ...
  │
  │   Bạn đồng ý phương án này?
  │
  │     ↓
  ├─> ⏸️  WAIT for user confirmation
  │     ↓
  ├─> ✅ User: "Đồng ý, làm đi"
  │     ↓
  ├─> 📋 plan_task(userContext, baAnalysis)
  │     ↓
  │   ┌─────────────────────────────────────────────┐
  │   │ Feature-Driven Plan                         │
  │   │ {                                           │
  │   │   summary: "Build e-commerce with 3 features",│
  │   │   steps: [                                  │
  │   │     {step: 1, tool: "command_run",          │
  │   │      action: "Init Next.js"},               │
  │   │     {step: 2, tool: "install_dependencies"},│
  │   │     {step: 3, tool: "code_generate",        │
  │   │      featureName: "Product Catalog",        │
  │   │      featureDescription: "...",             │
  │   │      priority: "must-have"},                │
  │   │     {step: 4, tool: "code_generate",        │
  │   │      featureName: "Shopping Cart"},         │
  │   │     {step: 5, tool: "code_generate",        │
  │   │      featureName: "Checkout"}               │
  │   │   ],                                        │
  │   │   estimatedTime: "long"                     │
  │   │ }                                           │
  │   └─────────────────────────────────────────────┘
  │     ↓
  ├─> 📋 **Present Plan with Todos**:
  │
  │     📋 Implementation Plan (long):
  │     ☐ Step 1: Initialize Next.js project
  │     ☐ Step 2: Install dependencies
  │     ☐ Step 3: Implement Product Catalog
  │     ☐ Step 4: Implement Shopping Cart
  │     ☐ Step 5: Implement Checkout
  │
  │     ↓
  └─> 🚀 **Execute Steps Sequentially**:

      Step 1: command_run("npm create next-app...")
      ☒ Step 1: Initialize Next.js - Completed

      Step 2: install_dependencies()
      ☒ Step 2: Install dependencies - Installed

      Step 3: code_generate({
        step: 3,
        featureName: "Product Catalog",
        technicalStack: {...},
        userStories: [...],
        dataModel: [...]
      })
      ↓ Code Generate Agent:
        - Generates complete code
        - Writes files: components/, api/, types/
        - Returns: {step: 3, status: 'done', filesCreated: [...]}
      ☒ Step 3: Product Catalog - Created 5 files

      Step 4: code_generate(Shopping Cart)
      ☒ Step 4: Shopping Cart - Created 3 files

      Step 5: code_generate(Checkout)
      ☒ Step 5: Checkout - Created 4 files

      ✅ All steps completed! Created 12 files total.

3️⃣ Add Feature to Existing Project

User: "Thêm authentication vào app"
  │
  ├─> 🔍 ba_it_analyze(userRequest, context)
  │     │ type: "update_project"
  │     ↓
  ├─> 📊 Present analysis
  │     ↓
  ├─> 📋 plan_task(userContext, baAnalysis)
  │     │ → Skip project setup
  │     │ → Focus on feature implementation
  │     ↓
  └─> 🚀 Execute steps

4️⃣ Simple Questions

User: "React hooks là gì?"
  │
  └─> 💬 Direct answer (no tools)

📦 Cài đặt

Yêu cầu hệ thống

  • Bun >= 1.0
  • Ollama với models:
    • gpt-oss:120b-cloud
    • qwen3-coder:480b-cloud
  • Google Gemini API Key

Bước 1: Clone & Install

cd terminal/galaxy_cli
bun install

Bước 2: Setup Environment

# .env file
GEMINI_API_KEY=your_gemini_api_key_here
OLLAMA_HOST=http://localhost:11434

Bước 3: Build

bun run build

Bước 4: Run

bun run start
# hoặc
bun run dev

🚀 Sử dụng

Chạy CLI

# Development mode với watch
bun run dev

# Production mode
bun run start

# Với CLI flags
bun run start --test          # Enable test planning
bun run start --review        # Enable review planning
bun run start --test --review # Enable both
bun run start --help          # Show help
bun run start --version       # Show version

CLI Flags

FlagShortDefaultMô tả
--help-h-Hiển thị trợ giúp
--version-v-Hiển thị version
--test-falseEnable test planning step
--review-falseEnable review planning step

Commands (Trong CLI)

CommandMô tảExample
/helpHiển thị danh sách lệnh/help
/exitThoát khỏi Galaxy CLI/exit
/clearXóa lịch sử hội thoại/clear
/historyXem 10 input gần nhất/history
/pwdHiển thị thư mục làm việc/pwd
/informationHiển thị thông tin hệ thống/information
/testToggle test planning/test true hoặc /test false
/reviewToggle review planning/review true hoặc /review false

Example Usage

# Phân tích dự án hiện tại
> Phân tích dự án này

# Tạo project mới
> Tạo app Next.js với TypeScript và Tailwind

# Thêm tính năng
> Thêm authentication với JWT

# Hỏi đáp
> Giải thích về React Context API

# Bật/tắt test planning
> /test true
✅ Test planning enabled

# Kiểm tra thông tin hệ thống
> /information
📊 System Information:
Name: Galaxy CLI
Version: 2.0.0
Current Project: /home/user/my-project
Testing: ON
Review Code: OFF

🤖 AI Models & Vai trò

1. Gemini 2.5 Flash (Orchestrator)

  • Vai trò: Central coordinator & plan executor
  • Nhiệm vụ:
    • Tool calling & function execution
    • Plan execution với todos display (☐/☒)
    • Workflow decision making
    • Multi-language response (EN/VI)
    • User interaction & confirmation

2. gpt-oss:120b-cloud (BA Analyzer)

  • Vai trò: Business Analysis expert
  • Nhiệm vụ:
    • Phân tích yêu cầu người dùng
    • Xác định features, tech stack, data model
    • Phân loại: create_project vs update_project
    • Đề xuất recommendations & questions
    • Output: English only (internal consistency)

3. qwen3-coder:480b-cloud (Planning Agent)

  • Vai trò: Feature-driven planner
  • Nhiệm vụ:
    • Map coreFeatures → execution steps
    • 1 must-have feature = 1 code_generate step
    • Conditional test/review steps based on CLI flags
    • Chọn tools phù hợp (command_run, install_dependencies, code_generate)
    • Ước lượng thời gian (quick/medium/long)
    • Input: userContext + baAnalysis + system context (test/review flags)
    • Output: English only (step array với featureName, tool, reasoning)

4. qwen3-coder:480b-cloud (Code Generate Agent) ✨ NEW

  • Vai trò: Self-contained feature executor
  • Nhiệm vụ:
    • Nhận feature spec từ planning step
    • Generate production-ready code (NO placeholders)
    • Tự động write files, run commands
    • Integrated tools: file_write, file_read, command_run, file_search
    • Return: {step, status: 'done'|'error', message, filesCreated}
  • Input:
    • step, featureName, featureDescription, priority
    • technicalStack, userStories, dataModel, apiEndpoints
  • Output: Execution result với file list

🔧 Danh sách Tools

📁 File Operations (6 tools)

  • file_read - Đọc nội dung file
  • file_write - Ghi/tạo file mới
  • file_list - List files trong thư mục
  • file_search - Tìm kiếm pattern trong files
  • file_tree - Hiển thị cây thư mục
  • file_delete - Xóa file

🔀 Git Operations (5 tools)

  • git_status - Check git status
  • git_commit - Commit changes
  • git_push - Push to remote
  • git_pull - Pull từ remote
  • git_diff - Xem git diff

🔧 Command & Testing (3 tools)

  • command_run - Chạy shell command
  • install_dependencies - Auto-detect & install deps
  • test_run - Chạy tests

📝 Document Parsing (1 tool)

  • document_parse - Parse PDF, DOCX, XLSX

🧠 AI Analysis & Planning (3 tools)

  • ba_it_analyze - Business analysis với gpt-oss:120b
  • plan_task - Feature-driven planning với qwen3-coder:480b
  • code_generate - ✨ Self-contained feature executor với qwen3-coder:480b

🏗 Project Setup (2 tools)

  • project_ask_config - Interactive project setup
  • project_build_command - Generate build commands

📊 Decision Logic

Khi nào dùng ba_it_analyze?

✅ Dùng khi:

  • Tạo dự án MỚI (bắt buộc)
  • Thêm tính năng LỚN (auth, payments, complex systems)
  • Yêu cầu CHUNG CHUNG ("build app", "e-commerce")

❌ Không dùng:

  • Câu hỏi đơn giản
  • Phân tích dự án hiện tại (dùng file_tree + file_read)

Khi nào dùng plan_task?

✅ Dùng khi:

  • Sau khi user xác nhận BA analysis
  • Cần implementation nhiều bước
  • Refactoring phức tạp

Required params:

  • userContext (bắt buộc) - Yêu cầu của user
  • baAnalysis (optional) - Kết quả từ ba_it_analyze

Khi nào dùng code_generate?

✅ Dùng khi:

  • Orchestrator execute step từ plan
  • Step có tool = "code_generate"
  • Cần implement 1 feature hoàn chỉnh

Required params:

  • step - Step number
  • featureName - Tên feature từ coreFeatures
  • featureDescription - Mô tả chi tiết
  • technicalStack - Tech stack từ BA
  • Optional: userStories, dataModel, apiEndpoints

Output: {step, status: 'done'|'error', message, filesCreated: [...]}

🎨 UI Components

Banner

   ____       _                    ____ _     ___
  / ___| __ _| | __ ___  ___   _  / ___| |   |_ _|
 | |  _ / _` | |/ _` \ \/ / | | || |   | |    | |
 | |_| | (_| | | (_| |>  <| |_| || |___| |___ | |
  \____|\__,_|_|\__,_/_/\_\\__, | \____|_____|___|
                           |___/

Loading States

  • Spinner với dots animation: ⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏
  • Color: cyan
  • Text: "Thinking..."

🔐 Environment Variables

# Required
GEMINI_API_KEY=        # Google Gemini API key
OLLAMA_HOST=           # Ollama server URL (default: http://localhost:11434)

# Optional
DEBUG=                 # Enable debug logs (true/false)

🏃 Development

Project Structure

terminal/galaxy_cli/
├── source/
│   ├── ai/
│   │   └── orchestrator.ts      # Gemini orchestrator
│   ├── connections/
│   │   ├── gemini.ts            # Gemini connection
│   │   └── ollama.ts            # Ollama connection
│   ├── prompts/
│   │   ├── orchestrator.ts      # Main workflow prompts
│   │   ├── ba-it-analyzer.ts    # BA analysis prompts
│   │   └── planning-agent.ts    # Planning prompts
│   ├── tools/
│   │   ├── ba-it-analyzer.ts    # BA analyzer tool
│   │   ├── planning-agent.ts    # Planning agent tool
│   │   ├── file-operations.ts   # File tools
│   │   ├── git-operations.ts    # Git tools
│   │   └── registry.ts          # Tool registry
│   ├── app.tsx                  # Main Ink app
│   └── cli.tsx                  # CLI entry
├── dist/                        # Compiled output
├── package.json
└── tsconfig.json

Build & Test

# Development với auto-reload
bun run dev

# Build TypeScript
bun run build

# Type checking
bun run type-check

# Format code
bun run format

📈 Roadmap

  • Execution Engine: Tự động chạy plan steps
  • Code Review Agent: Review code trước khi commit
  • Testing Agent: Tự động generate tests
  • Documentation Agent: Auto-generate docs
  • Multi-project support: Làm việc với nhiều projects
  • Plugin system: Mở rộng tools dễ dàng
  • Web UI: Dashboard quản lý projects

🤝 Contributing

Contributions are welcome! Please follow these steps:

  • Fork the repo
  • Create feature branch (git checkout -b feature/amazing-feature)
  • Commit changes (git commit -m 'Add amazing feature')
  • Push to branch (git push origin feature/amazing-feature)
  • Open Pull Request

📄 License

MIT License - see LICENSE file for details

👨‍💻 Author

Bùi Trọng Hiếu (Kevin Bui)

🙏 Acknowledgments

  • Ink - React for CLI
  • Google Gemini - LLM orchestration
  • Ollama - Local LLM hosting
  • Bun - Fast JavaScript runtime

Keywords

ai

FAQs

Package last updated on 20 Nov 2025

Related posts