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

Command Options

Galaxy CLI hỗ trợ các command options để cấu hình hành vi từ lúc khởi động.

Hiển thị thông tin help và thoát.

Terminal window
galaxy --help

Output:

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

Hiển thị phiên bản hiện tại.

Terminal window
galaxy --version
# Output: 2.0.0

Enable test planning step trong execution plan.

Terminal window
galaxy --test

Khi 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

Enable code review step trong execution plan.

Terminal window
galaxy --review

Khi 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

Enable Git operations.

Terminal window
galaxy --git

Khi enable:

  • Galaxy có thể sử dụng Git tools
  • Auto commit sau khi complete steps
  • Git diff để review changes

Bạn có thể kết hợp nhiều options:

Terminal window
# Enable cả test và review
galaxy --test --review
# Enable tất cả
galaxy --test --review --git

Example 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 ← --git
SettingCommand OptionInternal CommandKhi nào dùng?
Test Planning--test/test trueOption: Set từ đầu
Command: Toggle runtime
Code Review--review/review trueOption: Set từ đầu
Command: Toggle runtime
Git Operations--git/git trueOption: Set từ đầu
Command: Toggle runtime
Terminal window
# 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 --git
Terminal window
# Học cách viết tests
galaxy --test
# Học best practices từ code review
galaxy --review
Terminal window
# Ensure code quality cho team
galaxy --test --review --git

Ngoài command options, bạn có thể cấu hình qua environment variables:

Terminal window
# .env hoặc export
GALAXY_TEST_ENABLED=true
GALAXY_REVIEW_ENABLED=true
GALAXY_GIT_ENABLED=false

Priority:

  1. Command options (highest)
  2. Internal commands
  3. Environment variables
  4. config.json
  5. Default values (lowest)
Terminal window
# .env: GALAXY_TEST_ENABLED=false
galaxy --test
# Result: Test ENABLED (option overrides .env)

Check syntax:

Terminal window
# ❌ Wrong
galaxy -test
# ✅ Correct
galaxy --test

Check option order:

Terminal window
# ✅ Options trước arguments
galaxy --test --review
# ❌ Options sau arguments (có thể bị ignore)
galaxy myproject --test