npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@agentlogs/opencode

v0.0.1

Published

AgentLogs plugin for OpenCode - automatically captures and uploads AI coding session transcripts

Readme

@agentlogs/opencode

OpenCode plugin for AgentLogs - automatically capture and upload AI coding session transcripts.

Features

  • Automatic transcript capture: Uploads session transcripts when OpenCode becomes idle
  • Git commit enhancement: Automatically adds transcript links to git commit messages
  • Token & cost tracking: Calculates and tracks token usage and costs
  • Git context preservation: Captures repository, branch, and working directory context

Installation

From npm

npm install -g @agentlogs/opencode
# or
bun add -g @agentlogs/opencode

Configure OpenCode

Add the plugin to your opencode.json config file:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["@agentlogs/opencode"]
}

Or for local development:

{
  "plugin": [".opencode/plugin/agentlogs.ts"]
}

Configuration

Environment Variables

| Variable | Required | Description | | --------------- | -------- | -------------------------------------------- | | VI_AUTH_TOKEN | Yes | Your AgentLogs authentication token | | VI_SERVER_URL | No | Server URL (default: https://agentlogs.ai) |

Alternative variable names are also supported:

  • VIBEINSIGHTS_AUTH_TOKEN (alias for VI_AUTH_TOKEN)
  • VIBEINSIGHTS_BASE_URL (alias for VI_SERVER_URL)

Getting an Auth Token

  1. Visit agentlogs.ai
  2. Sign in with GitHub
  3. Go to Settings → API Tokens
  4. Generate a new token

How It Works

Transcript Capture

The plugin listens to OpenCode events and maintains a record of the current session:

  1. session.created: Initializes tracking for a new session
  2. message.updated: Collects messages as they're added/updated
  3. session.idle: Uploads the complete transcript when the session becomes idle

Git Commit Enhancement

When you make a git commit during a session, the plugin:

  1. Intercepts the tool.execute.before event for shell commands
  2. Detects git commit commands
  3. Uploads the current transcript (if not already uploaded)
  4. Appends a transcript link to the commit message

Example enhanced commit:

feat: add user authentication

Transcript: https://agentlogs.ai/app/logs/abc123

Plugin Events

The plugin responds to these OpenCode events:

| Event | Action | | ----------------- | -------------------------- | | session.created | Start tracking new session | | session.updated | Update session metadata | | message.updated | Collect message content | | session.idle | Upload transcript | | session.deleted | Clear session state |

API

Exports

import {
  agentLogsPlugin, // Main plugin function
  extractGitContext, // Extract git repo/branch info
  isGitCommitCommand, // Check if command is git commit
  uploadOpenCodeTranscript, // Manual transcript upload
  buildTranscriptUrl, // Build transcript URL from ID
} from "@agentlogs/opencode";

Manual Upload

You can also upload transcripts programmatically:

import { uploadOpenCodeTranscript } from "@agentlogs/opencode";

const result = await uploadOpenCodeTranscript({
  session: { id: "...", createdAt: "...", ... },
  messages: [...],
  gitContext: { repo: "...", branch: "...", relativeCwd: "..." },
  cwd: "/path/to/project",
});

if (result.success) {
  console.log(`Transcript: ${result.transcriptUrl}`);
}

Troubleshooting

Transcript not uploading

  1. Check that VI_AUTH_TOKEN is set correctly
  2. Verify network connectivity to agentlogs.ai
  3. Check plugin logs for errors (look for [agentlogs] prefix)

Commit message not enhanced

  1. Ensure a transcript was uploaded successfully first
  2. Check that the commit command uses -m flag
  3. Verify the plugin is loaded (check OpenCode startup logs)

Development

Local Setup

# Clone the repo
git clone https://github.com/agentlogs/agentlogs.git
cd agentlogs

# Install dependencies
bun install

# Link the plugin locally
cd packages/opencode
bun link

Testing

# Run type checking
bun run check

# Build
bun run build

License

MIT