Visão Geral
The Gaio CLI is a command-line interface tool designed to streamline the setup and management of development environments for Gaio projects. It provides commands to automate environment setup, generate LLM documentation, and validate configurations.
🚀 Quick Start
Seção intitulada “🚀 Quick Start”After cloning the repository and running npm install, the CLI is automatically available:
npm install # Auto-setup CLI and development environmentgaio --help # See available commandsgaio status # Check current setup status📋 Available Commands
Seção intitulada “📋 Available Commands”gaio setup / gaio s
Seção intitulada “gaio setup / gaio s”Setup the development environment and generate LLM documentation with intelligent validation.
gaio setup # Smart setup (skips if already configured)gaio setup --force # Force complete re-setupgaio setup --status # Show setup status onlygaio llm / gaio l
Seção intitulada “gaio llm / gaio l”Generate LLM documentation from the docs/ directory.
gaio llmgaio status
Seção intitulada “gaio status”Show CLI setup status and configuration information.
gaio statusgaio help / gaio h
Seção intitulada “gaio help / gaio h”Show enhanced help information with examples.
gaio help⚙️ Configuration
Seção intitulada “⚙️ Configuration”The CLI automatically detects the project structure:
- Source:
docs/for LLM documentation - Entry Points:
AGENTS.mdandCLAUDE.mdsymbolic links - State:
.gaio.jsonfor setup validation (includes hash for docs change detection)
🛠️ Development
Seção intitulada “🛠️ Development”Building
Seção intitulada “Building”npm run build -w @gaio/cli # Build CLI from TypeScriptnpm run build:watch -w @gaio/cli # Watch mode for developmentDevelopment Mode
Seção intitulada “Development Mode”npm run dev -w @gaio/cli # Run CLI in development with tsxnpm run dev:watch -w @gaio/cli # Development with hot reloadTesting
Seção intitulada “Testing”npm run test -w @gaio/cli # Run CLI testsnpm run test:commands -w @gaio/cli # Test all CLI commandsType Checking
Seção intitulada “Type Checking”npm run typecheck -w @gaio/cli # TypeScript type checking🔧 How It Works
Seção intitulada “🔧 How It Works”- Installation:
npm installtriggerspostinstallscript - Setup Detection: Checks for existing setup state and files
- Project Root Finding: Intelligently locates monorepo root
- LLM Generation: Processes documentation files and creates entry points
- State Saving: Records successful setup for future validation
🎯 Best Practices
Seção intitulada “🎯 Best Practices”For Development
Seção intitulada “For Development”- Use
npm run dev -w @gaio/clifor development work - Run
gaio setupafter pulling major changes - Use
gaio statusto debug setup issues - Use
--forceflag only when necessary changes are made - Check
docs/directory structure if LLM generation fails
For CI/CD
Seção intitulada “For CI/CD”- Use
gaio setup --forcein CI environments for consistency - Validate setup with
gaio statusbefore running commands - Cache
.llm/directory to speed up builds when possible
🚨 Troubleshooting
Seção intitulada “🚨 Troubleshooting”CLI Not Found
Seção intitulada “CLI Not Found”npm install --workspace=@gaio/cli # Reinstall CLI workspacenpm run build -w @gaio/cli # Rebuild from sourcePermission Denied
Seção intitulada “Permission Denied”chmod +x tools/cli/bin/cli.js # Fix executable permissionsnpm run build -w @gaio/cli # Rebuild with proper permissionsSetup Not Working
Seção intitulada “Setup Not Working”gaio status # Check setup statusgaio setup --force # Force complete re-setuprm .gaio.json && gaio setup # Reset and re-setupProject Root Not Found
Seção intitulada “Project Root Not Found”# Ensure you're in a valid Gaio project directoryls package.json docs/ # Verify required files existgaio setup --force # Force re-detection