Skip to content

tencent-source/opencode-debloated

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opencode-debloated

Lightweight, optimized opencode CLI setup. Zero bloat. Clean config. Fast startup.

The stock opencode install accumulates 10+ GB of logs, unused plugin caches, and redundant config over time. This project fixes that.

What it does

  • Installs opencode CLI (official binary)
  • Applies a minimal, optimized config
  • Strips unused plugins (kilocode, oh-my-opencode cache)
  • Clears logs, caches, and backup files
  • Vacuums the SQLite session database
  • Disables telemetry and snapshots

Quick install

git clone https://github.com/aresaph/opencode-debloated.git
cd opencode-debloated
chmod +x install.sh && ./install.sh

Already have opencode installed?

Just run the cleanup:

chmod +x cleanup.sh && ./cleanup.sh

What gets cleaned

Item Typical size Action
Log files 1-15 GB Deleted
Plugin cache 100-200 MB Deleted
Config backups 1-5 MB Deleted
Kilocode plugin ~750 KB Removed
SQLite database 10-50 MB Vacuumed
Telemetry - Disabled
Snapshots - Disabled

Optimized config

The debloated opencode.json ships with sane defaults:

{
  "logLevel": "ERROR",
  "snapshot": false,
  "autoupdate": true,
  "experimental": {
    "openTelemetry": false
  }
}

No model definitions are baked in — opencode auto-discovers available models from your provider. Add your own providers to ~/.config/opencode/opencode.json as needed.

Adding providers

After install, configure your provider in ~/.config/opencode/opencode.json:

{
  "model": "provider/model-name",
  "provider": {
    "your-provider": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Provider Name",
      "options": {
        "baseURL": "https://api.example.com/v1"
      },
      "models": {
        "model-name": {
          "name": "Display Name",
          "limit": { "context": 128000, "output": 4096 }
        }
      }
    }
  }
}

Authenticate with opencode auth or set OPENCODE_API_KEY in your environment.

Periodic cleanup

Opencode regenerates logs and caches over time. Run the cleanup script periodically:

./cleanup.sh

Or add a cron job:

# Clean opencode bloat weekly (Sunday 3am)
0 3 * * 0 /path/to/opencode-debloated/cleanup.sh

Uninstall

Remove opencode and all its data completely:

chmod +x uninstall.sh && ./uninstall.sh

File layout

~/.opencode/              # Binary + core plugins
~/.config/opencode/       # Config (opencode.json)
~/.cache/opencode/        # Plugin cache (safe to delete)
~/.local/share/opencode/  # Database, logs, auth
~/.local/state/opencode/  # UI state, history

Requirements

  • macOS or Linux
  • curl (for initial install)
  • sqlite3 (optional, for database vacuum)

License

MIT

About

Lightweight, debloated opencode CLI setup. Strips 10+ GB of logs, caches, and bloat. Clean config, fast startup, zero telemetry.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages