@dieulc/server-logs
v0.2.1
Published
Pi extension: inspect Docker containers and systemd services on a remote VPS over SSH, or locally. Custom tools for logs, ps, compose, and journal.
Maintainers
Readme
@dieulc/server-logs
Pi extension that lets the agent inspect Docker containers and systemd services on a remote VPS over SSH — or on the local machine.
Install
pi install npm:@dieulc/server-logs # latest
pi install npm:@dieulc/[email protected] # pinned
pi install -l npm:@dieulc/server-logs # project-local (.pi/settings.json)
pi -e npm:@dieulc/server-logs # try without installingManage it with pi list, pi update --extensions, pi remove npm:@dieulc/server-logs.
Setup
Remote VPS (SSH)
pi --ssh user@hostWith a specific remote working directory:
pi --ssh user@host:/path/to/projectRequirements:
- SSH key-based auth (no password prompts)
dockerCLI on the target (for the docker tools)systemd/journalctlon the target (for the journal tool)
Local Docker
piWorks without --ssh — tools run against your local Docker socket.
Tools
| Tool | Purpose |
| --- | --- |
| docker_logs | Fetch logs from a container (tail, since, filter, timestamps) |
| docker_ps | List containers (running or all) |
| docker_services | Fetch Docker Compose logs for a project |
| server_journal | Fetch systemd journal entries for a unit |
Examples
// List containers
docker_ps: { all: true }
// Last 100 lines from the api container
docker_logs: { container: "myproject-api-1", lines: 100 }
// Errors in the last 30 minutes
docker_logs: { container: "worker", since: "30m", filter: "ERROR" }
// Compose logs for specific services
docker_services: { project: "myproject", services: "api worker", lines: 50 }
// systemd journal
server_journal: { unit: "nginx", lines: 100, since: "1 hour ago" }Notes
- Output is capped at 50,000 characters to avoid flooding the model context. Truncation is reported.
- Secrets (Bearer tokens, API keys, passwords) are automatically redacted before reaching the model.
- If Docker isn't available on the target, the docker tools return a clear message instead of throwing.
Development
cd agent/extensions/server-logs
npm install
npm run typecheckThe extension is plain TypeScript with no build step — Pi loads index.ts directly. For a live check:
pi -e ./index.tsLicense
MIT — see LICENSE.
