A command line interface (CLI) for validating codebase structure and development standards. This tool helps ensure your projects follow best practices for essential files, Git configuration, and development workflows.
- Essential Files Validation: Checks for README.md, CONTRIBUTING.md
- Git Configuration: Validates .gitignore, .editorconfig, .gitattributes
- Development Standards: Enforces conventional commits and branch naming
- JSON Schema Validation: Robust configuration file validation with detailed error reporting
- Configuration Presets: Quick setup with 5 built-in templates (basic, strict, beginner, open-source, go-project)
- Multiple Output Formats: Table (styled) and JSON output
- Configurable: YAML configuration file support with schema validation
- Extensible: Modular agent architecture for easy expansion
Linux/macOS:
curl -sSL https://raw.githubusercontent.com/codebase-interface/cli/main/install.sh | bashWindows (PowerShell):
Invoke-WebRequest -Uri "https://github.com/codebase-interface/cli/releases/latest/download/codebase-interface-windows-amd64.exe" -OutFile "codebase-interface.exe"Note: Package manager distribution requires setup of Homebrew tap and Chocolatey API keys. See Package Manager Setup Guide for maintainer instructions.
Homebrew (macOS/Linux):
brew tap codebase-interface/cli
brew install codebase-interfaceChocolatey (Windows):
choco install codebase-interfaceGo Install:
go install github.com/codebase-interface/cli/cmd/codebase-interface@latestDocker:
# Run validation in current directory
docker run --rm -v $(pwd):/workspace ghcr.io/codebase-interface/cli:latest validate
# Interactive mode
docker run --rm -it -v $(pwd):/workspace ghcr.io/codebase-interface/cli:latestDownload from GitHub Releases:
- Linux:
codebase-interface-linux-amd64 - macOS Intel:
codebase-interface-darwin-amd64 - macOS Apple Silicon:
codebase-interface-darwin-arm64 - Windows:
codebase-interface-windows-amd64.exe
git clone https://github.com/codebase-interface/cli.git
cd cli
task build # Creates binary in bin/
# Install globally
task install # Installs to $GOPATH/bin# Check if installed correctly
codebase-interface version
# Or use the short alias
cbi version# Create a configuration file for your project
cbi init-config basic
# Validate your configuration
cbi validate-config
# Run validation
cbi validate# Validate current directory
cbi validate
# Validate specific path
cbi validate --path /path/to/project
# JSON output for CI/CD
cbi validate --output json
# Run specific validation agent
cbi validate --agent essential-files
# Get help
cbi --helpValidates presence of fundamental project files:
- README.md or README.rst - Project documentation
- CONTRIBUTING.md - Contribution guidelines
Validates Git configuration files:
- .gitignore - Files to ignore in Git
- .editorconfig - Consistent coding styles
- .gitattributes - Git attributes (optional)
Validates development workflow standards:
- Conventional Commits - Commit message format
- Branch Naming - Branch naming conventions
Create a configuration file with preset templates:
# Create basic configuration
codebase-interface init-config basic
# Or choose a specific template
codebase-interface init-config go-project
codebase-interface init-config open-source
codebase-interface init-config strictCreate .codebase-validation.yml in your project root:
validation:
agents:
essential-files:
enabled: true
require_readme: true
require_contributing: true
git-configuration:
enabled: true
require_gitignore: true
require_gitattributes: false # Optional
require_editorconfig: true
development-standards:
enabled: true
check_commit_history: true
commit_history_depth: 10
require_conventional_commits: true
output:
format: "table" # json, table
verbose: falseValidates configuration files against the JSON schema.
# Validate default configuration file
codebase-interface validate-config
# Validate specific file
codebase-interface validate-config my-config.yml
# Validate configuration in a specific directory
codebase-interface validate-config /path/to/projectGet the JSON schema for configuration validation and editor integration.
# Display schema to stdout
codebase-interface schema
# Save schema to file for editor integration
codebase-interface schema --output codebase-validation.schema.json
# Use shorter alias
cbi schema -o schema.jsonCreates a new configuration file with preset templates.
codebase-interface init-config [type]
# Available types: basic, strict, beginner, open-source, go-project
codebase-interface init-config basic
codebase-interface init-config --force # Overwrite existingDisplay or save the JSON schema for configuration validation.
codebase-interface schema # Display schema
codebase-interface schema -o schema.json # Save to fileValidates codebase structure and standards.
codebase-interface validate [flags]
Flags:
-a, --agent string Run specific agent (essential-files, git-configuration, development-standards)
-o, --output string Output format (json, table) (default "table")
-p, --path string Path to validate (default ".")Print version information.
codebase-interface version- Go 1.21 or later
- Task for task automation
# Setup development environment
task setup
# Build the CLI
task build
# Run tests
task test
# Run tests in watch mode
task test:watch
# Run linting
task lint
# Install locally
task install
# Validate the CLI project itself
task validate-self
# Serve documentation locally
task docs:serve
# Open documentation in browser
task docs:open
# Check documentation for issues
# Check documentation for issues\ntask docs:check\n```bashcodebase-cli/
βββ cmd/ # Cobra CLI commands
β βββ root.go # Root command
β βββ validate.go # Validation command
β βββ version.go # Version command
βββ internal/ # Internal packages
β βββ agents/ # Validation agents
β βββ config/ # Configuration handling
β βββ output/ # Output formatters
β βββ ui/ # TUI components
βββ pkg/ # Public API packages
βββ test/ # Test files and fixtures
βββ Taskfile.yml # Development tasks
βββ .codebase-validation.yml # Self-validation config- Language: Go (latest stable)
- CLI Framework: Cobra
- Styling: Lipgloss
- Configuration: YAML with yaml.v3
- Testing: Go's built-in testing with table-driven tests
- Development: Test-driven development (TDD)
We welcome contributions! See CONTRIBUTING.md for guidelines on:
- Setting up the development environment
- Code style and conventions
- Testing requirements
- Pull request process
β Essential Files Agent - PASS (Score: 1.0)
β README.md present
β CONTRIBUTING.md present
β Git Configuration Agent - PASS (Score: 1.0)
β .gitignore present
β .editorconfig present
β Development Standards Agent - PASS (Score: 1.0)
β Recent commits follow conventional format
β Branch naming follows conventions: main
Overall Score: 1.00 - PASS
β Essential Files Agent - FAIL (Score: 0.5)
β README.md present
β CONTRIBUTING.md missing
Overall Score: 0.50 - FAIL
This project is licensed under the MIT License - see the LICENSE file for details.