📁 File Operations
6 tools để quản lý files: read, write, list, search, tree, delete
Galaxy CLI cung cấp 28+ tools chuyên biệt được tổ chức theo từng nhóm chức năng.
file_readĐọc nội dung của một file.
Parameters:
{ path: string // Đường dẫn file cần đọc}Returns:
string // Nội dung fileExample:
const content = await file_read({ path: './src/app.tsx'});file_writeGhi 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 = () => { ... }'});file_listLiệ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 filesExample:
const files = await file_list({ path: './src', recursive: true});file_searchTì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'});file_treeHiển thị cây thư mục dạng tree structure.
Parameters:
{ path: string // Đường dẫn thư mục}Returns:
string // Tree structure formattedExample:
const tree = await file_tree({ path: '.'});// Output:// .// ├── src/// │ ├── components/// │ └── utils/// └── package.jsonfile_deleteXóa file hoặc thư mục.
Parameters:
{ path: string // Đường dẫn cần xóa}Returns:
{ success: boolean, message: string}git_statusKiểm tra git status của repository.
Parameters:
{ cwd: string // Working directory}Returns:
{ branch: string, modified: string[], untracked: string[], staged: string[]}git_commitCommit changes với message.
Parameters:
{ cwd: string, message: string}Returns:
{ success: boolean, commitHash: string}git_pushPush commits lên remote repository.
Parameters:
{ cwd: string, remote?: string, // Default: 'origin' branch?: string // Default: current branch}git_pullPull changes từ remote.
Parameters:
{ cwd: string, remote?: string, branch?: string}git_diffXem git diff.
Parameters:
{ cwd: string, file?: string // Optional: specific file}Returns:
string // Diff outputcommand_runChạ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'});install_dependenciesTự động detect package manager và install dependencies.
Parameters:
{ cwd: string}Auto-detection:
bun.lock → dùng bun installpnpm-lock.yaml → dùng pnpm installyarn.lock → dùng yarn installnpm installReturns:
{ success: boolean, packageManager: string, output: string}test_runChạy tests trong project.
Parameters:
{ cwd: string, command?: string // Custom test command}Auto-detection:
package.json → tìm scripts.testnpm testdocument_parseParse 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'});ba_it_analyzeBusiness 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:
plan_taskFeature-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:
code_generate ✨ NEWSelf-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_writefile_readcommand_runfile_searchKhi nào dùng:
📁 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à refactor1. file_tree() // Get structure2. file_search() // Find code patterns3. file_read() // Read specific files4. ba_it_analyze() // Analyze requirements5. plan_task() // Create refactor plan6. code_generate() // Execute refactoring7. git_commit() // Commit changes