Command Options
Galaxy CLI hỗ trợ các command options để cấu hình hành vi từ lúc khởi động.
Danh sách Options
Phần tiêu đề “Danh sách Options”--help / -h
Phần tiêu đề “--help / -h”Hiển thị thông tin help và thoát.
galaxy --helpOutput:
Galaxy CLI - AI Pair Programming Tool
Usage: galaxy [options]
Options: -h, --help Show help -v, --version Show version --test Enable test planning --review Enable code review --git Enable git operations--version / -v
Phần tiêu đề “--version / -v”Hiển thị phiên bản hiện tại.
galaxy --version# Output: 2.0.0--test
Phần tiêu đề “--test”Enable test planning step trong execution plan.
galaxy --testKhi enable:
- Planning Agent sẽ thêm step “Write unit tests”
- Galaxy tự động generate test files
- Chạy tests sau khi implement features
Example Plan:
☐ Step 1: Initialize project☐ Step 2: Implement Feature A☐ Step 3: Implement Feature B☐ Step 4: Write unit tests ← Added by --test☐ Step 5: Write integration tests ← Added by --test--review
Phần tiêu đề “--review”Enable code review step trong execution plan.
galaxy --reviewKhi enable:
- Planning Agent thêm step “Code review & refactoring”
- Galaxy review code quality
- Suggest improvements
- Refactor if needed
Example Plan:
☐ Step 1: Initialize project☐ Step 2: Implement Feature A☐ Step 3: Implement Feature B☐ Step 4: Code review & refactoring ← Added by --review--git
Phần tiêu đề “--git”Enable Git operations.
galaxy --gitKhi enable:
- Galaxy có thể sử dụng Git tools
- Auto commit sau khi complete steps
- Git diff để review changes
Kết hợp nhiều Options
Phần tiêu đề “Kết hợp nhiều Options”Bạn có thể kết hợp nhiều options:
# Enable cả test và reviewgalaxy --test --review
# Enable tất cảgalaxy --test --review --gitExample Plan với tất cả options:
☐ Step 1: Initialize project☐ Step 2: Implement Feature A☐ Step 3: Implement Feature B☐ Step 4: Write tests ← --test☐ Step 5: Code review ← --review☐ Step 6: Git commit changes ← --gitSo sánh Options vs Internal Commands
Phần tiêu đề “So sánh Options vs Internal Commands”| Setting | Command Option | Internal Command | Khi nào dùng? |
|---|---|---|---|
| Test Planning | --test | /test true | Option: Set từ đầu Command: Toggle runtime |
| Code Review | --review | /review true | Option: Set từ đầu Command: Toggle runtime |
| Git Operations | --git | /git true | Option: Set từ đầu Command: Toggle runtime |
Use Cases
Phần tiêu đề “Use Cases”Development Workflow
Phần tiêu đề “Development Workflow”# Quick prototyping (no tests, no review)galaxy
# Standard development (with tests)galaxy --test
# Production-ready (with tests & review)galaxy --test --review
# Full workflow (tests, review, auto commit)galaxy --test --review --gitLearning & Experimentation
Phần tiêu đề “Learning & Experimentation”# Học cách viết testsgalaxy --test
# Học best practices từ code reviewgalaxy --reviewTeam Projects
Phần tiêu đề “Team Projects”# Ensure code quality cho teamgalaxy --test --review --gitEnvironment Variables
Phần tiêu đề “Environment Variables”Ngoài command options, bạn có thể cấu hình qua environment variables:
# .env hoặc exportGALAXY_TEST_ENABLED=trueGALAXY_REVIEW_ENABLED=trueGALAXY_GIT_ENABLED=falsePriority:
- Command options (highest)
- Internal commands
- Environment variables
- config.json
- Default values (lowest)
# .env: GALAXY_TEST_ENABLED=falsegalaxy --test
# Result: Test ENABLED (option overrides .env)# .env: GALAXY_TEST_ENABLED=truegalaxy# Result: Test ENABLED (from .env)
# Then in session:> /test false# Result: Test DISABLED (command overrides .env)Best Practices
Phần tiêu đề “Best Practices”Troubleshooting
Phần tiêu đề “Troubleshooting”Options không hoạt động
Phần tiêu đề “Options không hoạt động”Check syntax:
# ❌ Wronggalaxy -test
# ✅ Correctgalaxy --testOptions bị ignore
Phần tiêu đề “Options bị ignore”Check option order:
# ✅ Options trước argumentsgalaxy --test --review
# ❌ Options sau arguments (có thể bị ignore)galaxy myproject --testSettings không persist
Phần tiêu đề “Settings không persist”Các bước tiếp theo
Phần tiêu đề “Các bước tiếp theo”- Commands - Tìm hiểu internal commands
- Configuration - Cấu hình nâng cao
- Quick Start - Bắt đầu sử dụng