API Reference
This directory contains the complete API reference for goLLM, including core functionality, CLI commands, and extension points.
Table of Contents
- Core API - Main classes and functions
- CLI Reference - Command-line interface documentation
- Extensions - Creating custom rules, commands, and formatters
Quick Start
Core API Example
from gollm import GollmCore
# Initialize
gollm = GollmCore()
# Validate code
result = gollm.validate_file("myfile.py")
print(f"Code quality score: {result['score']}")
CLI Example
# Validate code
gollm validate src/
# Generate code
gollm generate "Create a Flask web server" -o app.py
Core Concepts
GollmCore
The main entry point for programmatic access to goLLM functionality.
Code Validation
- Rule-based code validation
- Custom rule support
- Quality scoring
LLM Integration
- Multiple LLM provider support
- Code generation
- Chat interface
Extension Points
- Rules: Add custom validation rules
- Commands: Add new CLI commands
- Formatters: Customize output formatting
- Hooks: Run code at specific points
- Events: Listen for and react to events
Best Practices
- Error Handling: Always handle exceptions
- Logging: Use the built-in logging system
- Testing: Write tests for your code
- Documentation: Document your API usage