一键导入
opencode-db-inspect
Inspect local OpenCode session data safely with the `opencode db` command
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Inspect local OpenCode session data safely with the `opencode db` command
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Draft and create pull requests using the repository's conventions and template
Write documentation consumed by LLM agents — AGENTS.md, skill files, .ai/ plans, and agent instructions
Write documentation for human readers — READMEs, design docs, protocol specs, ADRs, runbooks, and API guides
Iterate on Grafana dashboard JSON files. Use when the user wants to create, modify, or fix Grafana dashboards — including panel layout, queries, colors, variables, and styling.
Keep DESIGN.md and plan docs synchronized with implementation decisions across repositories
Apply a rigorous distributed-systems lens for design, debugging, and implementation
| name | opencode-db-inspect |
| description | Inspect local OpenCode session data safely with the `opencode db` command |
opencode dbopencode db path to discover the active database path instead of hardcoding ~/.local/share/opencode/opencode.db.opencode db "<sql>" --format json over the interactive shell.sqlite_master and pragma table_info(...) before assuming schema details.data columns as JSON and use json_extract(...) for summaries.opencode db migrate unless the user explicitly asks for database migration work.insert, update, delete, alter, drop, or pragma settings that mutate state.opencode db path
opencode db "select name, type from sqlite_master where type in ('table', 'index') order by type, name;"
opencode db "pragma table_info(session);"
opencode db "pragma table_info(message);"
opencode db "pragma table_info(part);"
opencode db "select id, title, directory, time_created from session order by time_created desc limit 20;" --format json
opencode db "
select
s.id,
s.title,
s.directory,
p.worktree,
w.name as workspace_name,
s.time_created
from session s
join project p on p.id = s.project_id
left join workspace w on w.id = s.workspace_id
order by s.time_created desc
limit 20;
" --format json
opencode db "
select
id,
json_extract(data, '$.role') as role,
json_extract(data, '$.model') as model,
time_created
from message
where session_id = 'SESSION_ID'
order by time_created, id;
" --format json
opencode db "
select
id,
message_id,
json_extract(data, '$.type') as type,
time_created
from part
where session_id = 'SESSION_ID'
order by time_created, id;
" --format json
opencode db "
select
s.id,
count(distinct m.id) as messages,
count(distinct p.id) as parts
from session s
left join message m on m.session_id = s.id
left join part p on p.session_id = s.id
where s.id = 'SESSION_ID'
group by s.id;
" --format json
--format json is best when the result will be summarized by an agent.--format tsv is useful for quick terminal inspection.opencode db shell only for ad hoc exploration that does not fit a one-shot query.opencode db --help.opencode/skills/opencode-config/SKILL.md