Add executionModel feature and refactor CLI into modular commands (#150)

* Add executionModel feature and refactor CLI into modular commands

- Add executionModel config option to memory plugin for specifying AI provider/model
- Refactor monolithic CLI into modular commands: export, import, list, stats, cleanup
- Add model selector UI with connected providers and recent models
- Add showClear prop to Combobox component
- Update documentation and bump version to 0.0.10

* Update execution model placeholder text

* Update docs with new CLI commands and ocm-mem binary usage

* Bump version to v0.9.06

* Add executionModel field to default config
This commit is contained in:
Chris Scott authored and GitHub committed 2026-03-03 20:08:36 -05:00
1 parent e5b2cab9d9
commit c15e53fb98
22 files changed
+1719 -783

No files matched your search

+67 -1
View File
@@ -61,7 +61,8 @@ The file is only created if it does not already exist. The config is validated o
"inlinePlanning": true,
"maxContextTokens": 4000,
"snapshotToKV": true
}
},
"executionModel": ""
}
```
@@ -105,6 +106,7 @@ Set `baseUrl` to point at any OpenAI-compatible self-hosted service (vLLM, Ollam
| `compaction.inlinePlanning` | Include planning state in compaction context | `true` |
| `compaction.maxContextTokens` | Max tokens for injected memory context | `4000` |
| `compaction.snapshotToKV` | Save pre-compaction snapshot for recovery | `true` |
| `executionModel` | Model override for plan execution sessions (`provider/model`). Falls back to OpenCode's default model. | — |
---
@@ -364,6 +366,8 @@ Create a new Code session and send an implementation plan as the first prompt. D
Saves planning state (objective, phases, findings) for the Architect session, creates a new session via the OpenCode API, then sends the plan as the first message to the Code agent. Returns the session ID and title. Only the Architect agent has access to this tool — it is excluded from Code and Memory agents.
The model used for the new Code session is determined by `executionModel` in the plugin config (format: `provider/model`, e.g. `anthropic/claude-sonnet-4-20250514`). If not set, OpenCode's default model resolution is used — typically the `model` field from `opencode.json`.
---
## Planning State
@@ -564,6 +568,68 @@ The cleanup function is idempotent — calling it multiple times is safe.
---
## CLI
The plugin includes the `ocm-mem` CLI for managing memories outside of OpenCode sessions. The CLI auto-detects the project ID from git and resolves the database path automatically.
```bash
ocm-mem <command> [options]
```
### Global Options
| Flag | Description |
|------|-------------|
| `--db-path <path>` | Path to memory database |
| `--project, -p <name>` | Project name or SHA (auto-detected from git) |
| `--dir, -d <path>` | Git repo path for project detection |
| `--help, -h` | Show help |
### Commands
| Command | Description |
|---------|-------------|
| `export` | Export memories to file (JSON or Markdown) |
| `import` | Import memories from file |
| `list` | List projects with memory and session state counts |
| `stats` | Show memory statistics for a project |
| `cleanup` | Delete memories or session states by criteria |
### Usage Examples
```bash
# Export all memories as markdown
ocm-mem export --format markdown --output memories.md
# Export filtered by scope
ocm-mem export --project my-project --scope convention
# Import from JSON
ocm-mem import memories.json --project my-project
# Import from Markdown, skip duplicate detection
ocm-mem import memories.md --project my-project --force
# List all projects
ocm-mem list
# Show stats for current project
ocm-mem stats
# Preview cleanup of old memories (dry run)
ocm-mem cleanup --older-than 90 --dry-run
# Delete specific memories
ocm-mem cleanup --ids 1,2,3 --force
# Clean up expired session states
ocm-mem cleanup --sessions --older-than 30
```
Run `ocm-mem <command> --help` for full options on each command.
---
## Troubleshooting
### Plugin shows "degraded" status