Glimx Configuration Guide
This guide explains how to configure Glimx CLI to customize its behavior, models, permissions, and integrations.
Configuration File Locations
Glimx looks for configuration files in the following locations (in order of precedence):
--configCLI flagOPENCODE_CONFIGenvironment variable./opencode.jsoncor./opencode.json(current project)~/.opencode/opencode.jsoncor~/.opencode/opencode.json(user home)~/.opencode/config.json(user home, legacy)
Configuration Schema
You can reference the JSON schema for autocompletion and validation:
{
"$schema": "https://codelabs-poliwangi.github.io/glimx-cli/config.json"
}
Basic Configuration
Here's a basic configuration example:
{
"$schema": "https://codelabs-poliwangi.github.io/glimx-cli/config.json",
"model": "groq/qwen-32b",
"theme": "glimx",
"username": "your-username"
}
Model Configuration
Setting Default Model
{
"model": "groq/qwen-32b"
}
Custom Provider Configuration
Configure custom providers and models:
{
"provider": {
"groq": {
"api": "https://api.groq.com/openai/v1",
"models": {
"qwen-32b": {
"id": "qwen/qwen3-32b",
"cost": { "input": 0, "output": 0 },
"limit": { "context": 32768, "output": 8192 }
}
}
},
"openrouter": {
"api": "https://openrouter.ai/api/v1",
"models": {
"deepseek-chat": {
"id": "deepseek/deepseek-chat-v3.1",
"cost": { "input": 0, "output": 0 },
"limit": { "context": 64000, "output": 8000 }
}
}
}
}
}
API Keys
Set API keys in your environment:
export GROQ_API_KEY="your-key-here"
export OPENROUTER_API_KEY="your-key-here"
Permission System
Glimx includes a smart permission system that validates commands before execution.
Default Permissions
By default, Glimx uses these safe permissions:
{
"permission": {
"bash": {
"cat *": "allow",
"cd *": "allow",
"chmod *": "ask",
"cp *": "ask",
"curl *": "ask",
"diff *": "allow",
"echo *": "allow",
"find *": "allow",
"git add *": "ask",
"git commit *": "ask",
"git push *": "ask",
"git pull *": "ask",
"git status *": "allow",
"git diff *": "allow",
"git log *": "allow",
"grep *": "allow",
"head *": "allow",
"ls *": "allow",
"mkdir *": "ask",
"mv *": "ask",
"npm install *": "ask",
"npm run *": "ask",
"pwd *": "allow",
"rm *": "ask",
"tail *": "allow",
"touch *": "ask",
"wc *": "allow",
"wget *": "ask",
"*": "ask"
},
"edit": "ask",
"write": "ask",
"webfetch": "allow"
}
}
Permission Levels
allow- Auto-execute without askingask- Require user approval (default for most operations)deny- Block completely
Customizing Permissions
Override default permissions:
{
"permission": {
"bash": {
"git push *": "ask",
"rm -rf *": "deny",
"npm install *": "ask",
"ls *": "allow",
"*": "ask"
},
"edit": "ask",
"write": "ask"
}
}
MCP Server Configuration
Glimx includes 5 default MCP servers that are auto-enabled:
Default MCP Servers
{
"mcp": {
"filesystem": {
"type": "local",
"command": ["npx", "-y", "@modelcontextprotocol/server-filesystem", "~"],
"enabled": true,
"timeout": 5000
},
"git": {
"type": "local",
"command": ["uvx", "mcp-server-git", "--repository", "."],
"enabled": true,
"timeout": 5000
},
"sequential-thinking": {
"type": "local",
"command": ["uvx", "mcp-server-sequential-thinking"],
"enabled": true,
"timeout": 5000
},
"fetch": {
"type": "local",
"command": ["uvx", "mcp-server-fetch"],
"enabled": true,
"timeout": 5000
},
"memory": {
"type": "local",
"command": ["npx", "-y", "@modelcontextprotocol/server-memory"],
"enabled": true,
"timeout": 5000
}
}
}
Custom MCP Servers
Add your own MCP servers:
{
"mcp": {
"my-custom-server": {
"type": "local",
"command": ["my-mcp-server", "--port", "3000"],
"enabled": true,
"timeout": 10000
}
}
}
Agent Configuration
Configure agents for specific tasks:
{
"agent": {
"plan": {
"model": "groq/qwen-32b",
"description": "Planning agent for breaking down complex tasks",
"permission": {
"bash": "ask"
}
},
"build": {
"model": "groq/llama-3.3-70b",
"description": "Build agent for implementation tasks",
"permission": {
"bash": {
"npm install *": "ask",
"npm run build": "allow",
"*": "ask"
}
}
}
}
}
Command Configuration
Define custom commands:
{
"command": {
"test": {
"template": "Run all tests in the project",
"agent": "build",
"model": "groq/qwen-32b"
}
}
}
Theme Configuration
Customize the terminal interface:
{
"theme": "glimx"
}
Keybinds Configuration
Customize keyboard shortcuts:
{
"keybinds": {
"leader": "ctrl+x",
"app_exit": "ctrl+c,ctrl+d,<leader>q",
"editor_open": "<leader>e",
"theme_list": "<leader>t"
}
}
LSP Configuration
Configure Language Server Protocol integration:
{
"lsp": {
"typescript": {
"command": ["typescript-language-server", "--stdio"],
"extensions": [".ts", ".tsx"]
}
}
}
Formatter Configuration
Set up code formatters:
{
"formatter": {
"typescript": {
"command": ["prettier", "--stdin-filepath", "{filename}"],
"extensions": [".ts", ".tsx", ".js", ".jsx"]
}
}
}
Sharing Configuration
Control session sharing behavior:
{
"share": "manual" // or "auto" or "disabled"
}
Experimental Features
Enable experimental features:
{
"experimental": {
"chatMaxRetries": 3,
"disable_paste_summary": false
}
}
Environment Variables
Glimx supports several environment variables for configuration:
OPENCODE_CONFIG- Path to custom config fileOPENCODE_CONFIG_DIR- Additional config directoryGROQ_API_KEY- Groq API keyOPENROUTER_API_KEY- OpenRouter API keyCEREBRAS_API_KEY- Cerebras API key
Configuration Examples
Minimal Configuration
{
"$schema": "https://codelabs-poliwangi.github.io/glimx-cli/config.json",
"model": "groq/qwen-32b"
}
Advanced Configuration
{
"$schema": "https://codelabs-poliwangi.github.io/glimx-cli/config.json",
"model": "groq/qwen-32b",
"theme": "glimx",
"username": "developer",
"permission": {
"bash": {
"git push *": "ask",
"rm *": "ask",
"*": "ask"
}
},
"mcp": {
"filesystem": { "enabled": true },
"git": { "enabled": true },
"sequential-thinking": { "enabled": true },
"fetch": { "enabled": true },
"memory": { "enabled": true }
},
"agent": {
"plan": {
"model": "groq/qwen-32b",
"description": "Planning agent"
},
"build": {
"model": "groq/llama-3.3-70b",
"description": "Build agent"
}
},
"provider": {
"groq": {
"api": "https://api.groq.com/openai/v1"
}
}
}
Troubleshooting Configuration
Invalid Configuration
If you have an invalid configuration, Glimx will show detailed error messages:
ConfigInvalidError: Invalid configuration at ~/.opencode/opencode.json
- Issues:
- Unrecognized key 'invalid_key' at root
- Expected string for 'model', got number
Schema Validation
Use the JSON schema for validation and autocompletion in your editor:
{
"$schema": "https://codelabs-poliwangi.github.io/glimx-cli/config.json"
// Your configuration here
}
Next Steps
- Free Models Guide - Learn about free AI models
- MCP Servers - Detailed MCP server documentation
- Permissions System - Advanced permission configuration