Bỏ qua để đến nội dung

Danh sách Tools

Galaxy CLI cung cấp 28+ tools chuyên biệt được tổ chức theo từng nhóm chức năng.

Đọc nội dung của một file.

Parameters:

{
path: string // Đường dẫn file cần đọc
}

Returns:

string // Nội dung file

Example:

const content = await file_read({
path: './src/app.tsx'
});

Ghi nội dung vào file. Tự động tạo thư mục nếu chưa tồn tại.

Parameters:

{
path: string, // Đường dẫn file
content: string // Nội dung cần ghi
}

Returns:

{
isNewFile: boolean,
oldContent?: string,
newContent: string,
linesAdded: number,
linesRemoved: number,
path: string
}

Example:

await file_write({
path: './src/components/Button.tsx',
content: 'export const Button = () => { ... }'
});

Liệt kê tất cả files trong một thư mục.

Parameters:

{
path: string, // Đường dẫn thư mục
recursive?: boolean // Liệt kê đệ quy (default: false)
}

Returns:

string[] // Danh sách đường dẫn files

Example:

const files = await file_list({
path: './src',
recursive: true
});

Tìm kiếm pattern trong files.

Parameters:

{
path: string, // Thư mục search
pattern: string // Regex pattern hoặc text
}

Returns:

Array<{
file: string,
line: number,
content: string
}>

Example:

const results = await file_search({
path: './src',
pattern: 'useState'
});

Hiển thị cây thư mục dạng tree structure.

Parameters:

{
path: string // Đường dẫn thư mục
}

Returns:

string // Tree structure formatted

Example:

const tree = await file_tree({
path: '.'
});
// Output:
// .
// ├── src/
// │ ├── components/
// │ └── utils/
// └── package.json

Xóa file hoặc thư mục.

Parameters:

{
path: string // Đường dẫn cần xóa
}

Returns:

{
success: boolean,
message: string
}

Kiểm tra git status của repository.

Parameters:

{
cwd: string // Working directory
}

Returns:

{
branch: string,
modified: string[],
untracked: string[],
staged: string[]
}

Commit changes với message.

Parameters:

{
cwd: string,
message: string
}

Returns:

{
success: boolean,
commitHash: string
}

Push commits lên remote repository.

Parameters:

{
cwd: string,
remote?: string, // Default: 'origin'
branch?: string // Default: current branch
}

Pull changes từ remote.

Parameters:

{
cwd: string,
remote?: string,
branch?: string
}

Xem git diff.

Parameters:

{
cwd: string,
file?: string // Optional: specific file
}

Returns:

string // Diff output

Chạy shell command trong working directory.

Parameters:

{
command: string,
cwd: string,
timeout?: number // Default: 60000ms
}

Returns:

{
stdout: string,
stderr: string,
exitCode: number
}

Example:

await command_run({
command: 'npm install react',
cwd: '/path/to/project'
});

Tự động detect package manager và install dependencies.

Parameters:

{
cwd: string
}

Auto-detection:

  • Tìm bun.lock → dùng bun install
  • Tìm pnpm-lock.yaml → dùng pnpm install
  • Tìm yarn.lock → dùng yarn install
  • Default → dùng npm install

Returns:

{
success: boolean,
packageManager: string,
output: string
}

Chạy tests trong project.

Parameters:

{
cwd: string,
command?: string // Custom test command
}

Auto-detection:

  • Đọc package.json → tìm scripts.test
  • Default command: npm test

Parse PDF, DOCX, hoặc XLSX files và extract text.

Parameters:

{
path: string,
type: 'pdf' | 'docx' | 'xlsx'
}

Returns:

{
text: string,
metadata?: {
pages?: number,
author?: string,
title?: string
}
}

Example:

const doc = await document_parse({
path: './requirements.pdf',
type: 'pdf'
});

Business Analysis với gpt-oss:120b-cloud.

Parameters:

{
userRequest: string,
currentContext?: ProjectContext
}

Returns:

{
projectName: string,
type: 'create_project' | 'update_project',
description: string,
coreFeatures: Feature[],
technicalStack: TechStack,
dataModels: DataModel[],
apiEndpoints: APIEndpoint[],
estimatedDevelopmentTime: string,
recommendations: string[],
questionsForUser: string[]
}

Khi nào dùng:

  • ✅ Tạo dự án MỚI
  • ✅ Thêm tính năng LỚN
  • ✅ Yêu cầu CHUNG CHUNG
  • ❌ Câu hỏi đơn giản
  • ❌ Phân tích dự án hiện tại

Feature-driven planning với qwen3-coder:480b-cloud.

Parameters:

{
userContext: string,
baAnalysis?: BAAnalysis,
systemContext?: {
testEnabled: boolean,
reviewEnabled: boolean
}
}

Returns:

{
summary: string,
steps: Array<{
step: number,
tool: string,
action: string,
featureName?: string,
featureDescription?: string,
priority?: string,
reasoning: string
}>,
estimatedTime: 'quick' | 'medium' | 'long'
}

Khi nào dùng:

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

Self-contained feature executor với qwen3-coder:480b-cloud.

Parameters:

{
step: number,
featureName: string,
featureDescription: string,
priority: string,
technicalStack: TechStack,
userStories?: string[],
dataModel?: DataModel[],
apiEndpoints?: APIEndpoint[]
}

Returns:

{
step: number,
status: 'done' | 'error',
message: string,
filesCreated: string[]
}

Integrated Tools:

  • file_write
  • file_read
  • command_run
  • file_search

Khi nào dùng:

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

📁 File Operations

6 tools để quản lý files: read, write, list, search, tree, delete

🔀 Git Operations

5 tools cho version control: status, commit, push, pull, diff

🔧 Command & Testing

3 tools cho commands: run, install deps, test

📝 Document Parsing

1 tool để parse PDF, DOCX, XLSX

🧠 AI Analysis

3 AI-powered tools: BA analyze, planning, code generation

Tools có thể được chain với nhau:

// Example: Analyze codebase và refactor
1. file_tree() // Get structure
2. file_search() // Find code patterns
3. file_read() // Read specific files
4. ba_it_analyze() // Analyze requirements
5. plan_task() // Create refactor plan
6. code_generate() // Execute refactoring
7. git_commit() // Commit changes