opencode-ssh-logger
v0.1.7
Published
OpenCode plugin that logs SSH commands and output to text files
Maintainers
Readme
opencode-ssh-logger
An OpenCode plugin that logs all SSH commands and their output to human-readable text files.
Every time the AI agent runs an SSH command through OpenCode's bash tool, the command and its output are appended to a log file. Logs are written globally, per-host, and per-session.
Setup
Add the plugin to your opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-ssh-logger@latest"]
}No configuration required.
Command
The plugin adds an /ssh-logger command that shows where SSH logs are written.
Log files
Logs are written to $XDG_DATA_HOME/opencode/storage/plugins/opencode-ssh-logger/ (defaults to ~/.local/share/opencode/storage/plugins/opencode-ssh-logger/):
~/.local/share/opencode/storage/plugins/opencode-ssh-logger/
├── ssh-all.log # Global log, all sessions and hosts
├── hosts/ # Per-host logs
│ ├── example.com.log
│ └── 10.0.0.5.log
└── sessions/ # Per-session logs
├── ses_ABC123DEF456.log
└── ses_XYZ789GHI012.logssh-all.log— Every SSH command across all OpenCode sessions, in chronological order.hosts/<host>.log— Commands grouped by SSH host, across all sessions. File names are URL-encoded when needed.sessions/<sessionID>.log— Commands from a single OpenCode session, correlating to the session ID in the TUI.
Deploy
Release a new version to npm:
npm login
npm publish