-
Notifications
You must be signed in to change notification settings - Fork 3
Installation Guide
This guide covers all installation methods for OpenCode Memory.
Before installing, ensure you have:
- OpenCode: Installed and configured
- Git: For source installation (optional)
Add the plugin to your OpenCode configuration file:
Location: ~/.config/opencode/opencode.json or opencode.jsonc
OpenCode will automatically download and install the plugin on next startup.
For development or contributing:
git clone https://github.com/tickernelz/opencode-mem.git
cd opencode-mem
bun install
bun run buildThen add the local path to your OpenCode config:
{
"plugins": [
"/path/to/opencode-mem"
]
}Check that the plugin is recognized by OpenCode:
opencode plugins listYou should see opencode-mem in the output.
On first run, OpenCode Memory will:
- Create configuration directory:
~/.config/opencode/ - Generate default config:
opencode-mem.jsonc - Create data directory:
~/.opencode-mem/data/ - Initialize SQLite database
- Start web server on port 4747
Open your browser to:
http://127.0.0.1:4747
You should see the OpenCode Memory web interface.
The default configuration file is created at:
~/.config/opencode/opencode-mem.jsonc
The plugin works with zero configuration, but you can customize:
{
"storagePath": "~/.opencode-mem/data",
"webServerPort": 4747,
"embeddingModel": "Xenova/nomic-embed-text-v1"
}To enable automatic memory capture, add API credentials:
{
"autoCaptureEnabled": true,
"memoryModel": "gpt-4",
"memoryApiUrl": "https://api.openai.com/v1",
"memoryApiKey": "sk-your-api-key-here"
}See Configuration Guide for all options.
After installation, you will have:
~/.config/opencode/
└── opencode-mem.jsonc # Configuration file
~/.opencode-mem/
└── data/
├── memories_shard_0.db # SQLite database
└── memories_shard_0.db-wal # Write-ahead log
OpenCode automatically updates plugins. To force an update, restart OpenCode or use:
opencode plugins updateIf installed from source:
cd opencode-mem
git pull origin main
bun install
bun run buildRemove from OpenCode configuration:
Edit: ~/.config/opencode/opencode.json or opencode.jsonc
{
"plugins": [
// Remove "opencode-mem" from this array
]
}To completely remove all data:
rm -rf ~/.opencode-mem
rm ~/.config/opencode/opencode-mem.jsoncWarning: This will delete all stored memories permanently.
If port 4747 is already in use, change it in the config:
{
"webServerPort": 4748
}If you encounter permission errors:
sudo chown -R $USER:$USER ~/.opencode-mem
sudo chown -R $USER:$USER ~/.config/opencodeIf building from source fails:
- Clear node_modules:
rm -rf node_modules - Clear cache:
bun pm cache rm - Reinstall:
bun install - Rebuild:
bun run build
Or with npm:
- Clear node_modules:
rm -rf node_modules - Clear cache:
npm cache clean --force - Reinstall:
npm install - Rebuild:
npm run build
If SQLite initialization fails:
- Check disk space:
df -h - Check permissions:
ls -la ~/.opencode-mem - Remove corrupted database:
rm ~/.opencode-mem/data/*.db - Restart OpenCode
- Quick Start - Learn basic usage
- Configuration Guide - Customize settings
- Memory Operations - Use the memory tool
{ "plugins": [ "opencode-mem" ] }