OpenCLI plugin that automatically records every command execution to a local audit log using the lifecycle hooks API.
Once installed, this plugin silently logs every opencli command you run to ~/.opencli/audit.jsonl. Each entry records:
- command — the
site/namethat was executed - args — the arguments passed
- timestamp — ISO 8601 execution time
- durationMs — how long the command took
- rowCount — number of result rows (if applicable)
opencli plugin install github:ByteYue/opencli-plugin-audit-logAfter installation, all commands are automatically logged. No configuration needed.
To view recent audit entries:
opencli audit-log show # last 20 entries
opencli audit-log show --limit 50 # last 50 entriesThis plugin uses opencli's lifecycle hooks API:
onBeforeExecute— records the start timestamp before each commandonAfterExecute— writes the audit entry after the command completes
The hooks are registered in audit-hooks.ts and fire automatically for every command across the entire opencli runtime.
- opencli >= 1.3.0 (lifecycle hooks support)
One JSON object per line (JSONL):
{"command":"hackernews/top","args":{"limit":5},"timestamp":"2026-03-24T13:30:00.000Z","durationMs":2340,"rowCount":5}
{"command":"twitter/timeline","args":{"type":"following","limit":10},"timestamp":"2026-03-24T13:31:05.000Z","durationMs":5120,"rowCount":10}