Skip to content

Lora Code

Enterprise-Grade AI Coding Assistant for Your Terminal

PyPI VersionPython VersionsLicenseBuild Status

FeaturesInstallationQuick StartUsageConfigurationDocumentation


Overview

Lora Code is a powerful AI-driven command-line coding assistant that seamlessly integrates into your development workflow. Built for professional developers and teams, it provides intelligent code suggestions, automated refactoring, and comprehensive project understanding directly from your terminal.

Features

Core Capabilities

FeatureDescription
🤖 AI-Powered CodingIntelligent code generation, refactoring, and explanations
🏗️ Architect ModeDesign-first approach with separate architect and editor models
📊 Context ModeAutomatic identification of relevant files for your task
💬 Ask ModeQuery your codebase without making changes
🗺️ Repository MappingIntelligent codebase understanding with customizable token limits
🔄 Git IntegrationAutomatic commits, diffs, and version control management

Advanced Features

FeatureDescription
🎤 Voice InputRecord and transcribe voice commands (WAV, MP3, WebM)
💾 CheckpointsSave and restore session states
🪝 Hooks SystemCustom automation triggers for various events
Auto-ApproveConfigurable automatic approval for different action categories
🌐 Web ScrapingFetch and analyze web content with Playwright support
🔐 AuthenticationSecure device-flow authentication with credential caching
🌍 Multi-Language UIInterface available in English and Turkish
📋 Clipboard IntegrationPaste images and text directly into chat

Developer Experience

FeatureDescription
🎨 Syntax HighlightingCustomizable code themes (One Dark, Monokai, Solarized, etc.)
⌨️ VI ModeOptional VI editing mode in terminal
📝 Multi-line InputExtended input mode with Meta-Enter submission
🔔 NotificationsTerminal bell or custom command notifications
🧪 Auto-TestingAutomatic test execution after changes
🔍 Auto-LintingAutomatic linting with configurable commands

Installation

Requirements

  • Python 3.10 or higher
  • Git (recommended)
  • FFmpeg (optional, for MP3/WebM voice recording)

Install via pip

pip install loracode

Install from Source

git clone https://github.com/Lora-Technologies/loracode.git
cd loracode
pip install -e .

Upgrade

# Upgrade to latest stable version
loracode --upgrade
# Install from main branch (development)
loracode --install-main-branch

Quick Start

1. Authentication

# Interactive login with device flow
loracode
# Then use: /auth login# Or set API key directlyexport LORA_CODE_API_KEY="your-api-key"

2. Start a Session

# Start interactive session
loracode
# Work with specific files
loracode src/main.py src/utils.py
# Use a specific model
loracode --model gpt-4
# Single message mode (non-interactive)
loracode -m "Add error handling to main.py"

Usage

Chat Modes

ModeCommandDescription
Code/codeMake code changes (default)
Architect/architectDesign changes with architect model, implement with editor
Ask/askAsk questions without making changes
Context/contextAuto-identify files needed for a task
Help/helpGet help about Lora Code usage

In-Session Commands

File Management

CommandDescription
/add <file>Add file(s) to the editable session
/drop [file]Remove file(s) from session (all if no argument)
/read-only <file>Add file(s) as read-only reference
/lsList all files in session and repository

Git Operations

CommandDescription
/commit [message]Commit pending changes
/diffShow changes since last commit
/undoUndo the last Lora Code commit
/git <command>Run any git command

Session Management

CommandDescription
/clearClear conversation history
/resetClear history and drop all files
/tokensShow token usage breakdown
/settingsDisplay current configuration

Model Configuration

CommandDescription
/model [name]Switch or display current model
/editor-model <name>Set the editor model
/weak-model <name>Set the weak model (for summaries)
/think-tokens [value]Set thinking token budget
/chat-mode <mode>Switch chat mode

Checkpoints

CommandDescription
/checkpoint-save [name]Save current session state
/checkpoint-load <name>Restore a saved session
/checkpointsList all saved checkpoints
/checkpoint delete <name>Delete a checkpoint

Automation

CommandDescription
/auto-approve <categories>Auto-approve specific action categories
/auto-reject <categories>Auto-reject specific action categories
/auto-ask <categories>Reset categories to ask mode
/auto-statusShow current auto-approval settings
/hooksList and manage automation hooks

Utilities

CommandDescription
/web <url>Fetch and add web content to chat
/voiceRecord voice input (requires OpenAI API key)
/pastePaste clipboard content (text or image)
/copyCopy last assistant message to clipboard
/copy-contextCopy current context for external use
/editorOpen external editor for input
/run <command>Execute shell command
/test [command]Run tests
/lintLint and fix files
/mapShow repository map
/reportReport an issue on GitHub
/language [code]Change UI language (en/tr)
/auth <login|logout|status>Manage authentication
/help [topic]Get help on specific topics
/quitExit Lora Code

Configuration

Configuration Files

Lora Code searches for configuration in the following order:

  1. Command line arguments (highest priority)
  2. Environment variables (prefixed with LORACODE_)
  3. .loracode.conf.yml in current directory
  4. .loracode.conf.yml in git root
  5. .loracode.conf.yml in home directory

Configuration File Example

# .loracode.conf.yml# Model Configurationmodel: gpt-4weak-model: gpt-3.5-turboeditor-model: gpt-4edit-format: architectthinking-tokens: 8096# API Settingsapi-base: https://api.loratech.dev# Git Settingsauto-commits: truedirty-commits: trueattribute-co-authored-by: truegit-commit-verify: false# UI Settingsdark-mode: truepretty: truestream: truecode-theme: one-darkvim: falsemultiline: falsenotifications: false# Repository Mapmap-tokens: 2048map-refresh: auto# Automationauto-lint: trueauto-test: falsesuggest-shell-commands: true# Languagelanguage: enchat-language: nullcommit-language: null# Voice Settingsvoice-format: wavvoice-language: en

Environment Variables

VariableDescription
LORA_CODE_API_KEYAPI key for Lora Code services
LORA_CODE_API_BASECustom API base URL
LORACODE_MODELDefault model to use
LORACODE_DARK_MODEEnable dark mode (true/false)
LORACODE_AUTO_COMMITSEnable auto-commits (true/false)

CLI Arguments Reference

Main Model Settings

--model MODEL # Main chat model
--weak-model MODEL # Model for summaries and commits
--editor-model MODEL # Model for editor tasks
--edit-format FORMAT # Edit format (diff, whole, architect, etc.)
--architect # Use architect edit format
--thinking-tokens VALUE # Thinking token budget (0 to disable)

API Settings

--api-key KEY # Lora Code API key
--api-base URL # API base URL
--timeout SECONDS # API call timeout
--verify-ssl / --no-verify-ssl # SSL verification

Cache Settings

--cache-prompts / --no-cache-prompts # Enable prompt caching
--cache-keepalive-pings N # Keep cache warm (ping count)

Repository Map

--map-tokens N # Token limit for repo map (0 to disable)
--map-refresh MODE # Refresh mode: auto, always, files, manual
--map-multiplier-no-files N # Multiplier when no files specified

Git Settings

--git / --no-git # Enable/disable git integration
--auto-commits / --no-auto-commits # Auto-commit changes
--dirty-commits / --no-dirty-commits # Commit with dirty repo
--attribute-co-authored-by / --no-attribute-co-authored-by # Co-author attribution
--commit-prompt PROMPT # Custom commit message prompt
--dry-run # Preview changes without applying

Output Settings

--dark-mode / --light-mode # Color scheme
--pretty / --no-pretty # Colorized output
--stream / --no-stream # Streaming responses
--code-theme THEME # Syntax highlighting theme
--show-diffs # Show diffs when committing

Voice Settings

--voice-format FORMAT # Audio format: wav, mp3, webm
--voice-language LANG # ISO 639-1 language code
--voice-input-device NAME # Input device name

Checkpoint Settings

--load-checkpoint NAME # Load checkpoint at startup
--save-on-exit [NAME] # Save checkpoint on exit
--checkpoint-dir DIR # Custom checkpoint directory

Automation

--auto-approve CATEGORIES # Auto-approve categories (comma-separated)
--auto-reject CATEGORIES # Auto-reject categories
--yes-always # Always confirm prompts
--lint-cmd "LANG: CMD"# Custom lint command per language
--test-cmd CMD # Test command
--auto-lint / --no-auto-lint # Auto-lint after changes
--auto-test / --no-auto-test # Auto-test after changes

Modes

-m, --message MSG # Single message mode
-f, --message-file FILE # Message from file
--gui # Browser-based interface
--copy-paste # Auto copy/paste with web UI
--watch-files # Watch for AI coding comments

Other Options

--vim # VI editing mode
--multiline # Multi-line input mode
--fancy-input / --no-fancy-input # Input with history/completion
--notifications # Enable notifications
--detect-urls # Auto-detect URLs in input
--language LANG # UI language (en, tr)
--encoding ENCODING # I/O encoding (default: utf-8)
--verbose # Verbose output
--version # Show version
--help # Show help

Hooks System

Hooks allow you to run custom commands at specific events during your Lora Code session.

Configuration

Create .loracode/settings.json in your project root:

{
"hooks": {
"BeforeTool": [
{
"name": "pre-edit-check",
"command": "python scripts/validate.py",
"description": "Validate before making changes",
"timeout": 5000
}
],
"AfterTool": [
{
"name": "post-edit-format",
"command": "black .",
"description": "Format code after changes"
}
]
}
}

Hook Events

EventTrigger
BeforeToolBefore any tool execution
AfterToolAfter tool execution

Managing Hooks

/hooks # List all hooks
/hooks enable<name># Enable a hook
/hooks disable <name># Disable a hook
/hooks test<name># Test a hook

Auto-Approval System

Control which actions require confirmation:

Categories

CategoryDescription
file_createCreating new files
file_editEditing existing files
shell_commandRunning shell commands
url_addAdding URLs to chat
lint_fixApplying lint fixes
test_fixApplying test fixes
git_repoGit operations
analyticsAnalytics collection

Usage

# Auto-approve specific categories
/auto-approve file_edit,lint_fix
# Auto-approve everything
/auto-approve all
# Auto-reject categories
/auto-reject shell_command
# Reset to ask mode
/auto-ask all
# View current settings
/auto-status

Authentication

Lora Code uses secure device-flow authentication:

# Start login process
/auth login
# Check authentication status
/auth status
# Logout
/auth logout

Credentials are securely cached locally. Use --no-cache-credentials to disable caching.

Project Structure

loracode/
├── loracode/ # Main package
│ ├── coders/ # Edit format implementations
│ ├── locales/ # i18n translations
│ ├── resources/ # Model settings and assets
│ ├── main.py # Entry point
│ ├── commands.py # In-session commands
│ ├── args.py # CLI argument parsing
│ └── ...
├── tests/ # Test suite
├── requirements/ # Dependency specifications
├── scripts/ # Utility scripts
└── docs/ # Documentation

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

# Clone the repository
git clone https://github.com/Lora-Technologies/loracode.git
cd loracode
# Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate# Install development dependencies
pip install -e ".[dev]"# Run tests
pytest
# Run linting
flake8 loracode tests

Security

For security concerns, please see our Security Policy or contact security@loratech.dev.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Support

ChannelLink
📧 Emailsupport@loratech.dev
🐛 IssuesGitHub Issues
💬 DiscussionsGitHub Discussions
📖 Documentationdocs.loratech.dev

Built with ❤️ by Lora Technologies

About

Terminal-based AI coding assistant that helps you write, edit, and debug code with LLM support

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages