@agentlogs/pi
v0.0.7
Published
AgentLogs extension for Pi - automatically captures and uploads AI coding session transcripts
Maintainers
Readme
@agentlogs/pi
AgentLogs extension for pi - automatically captures and uploads AI coding session transcripts.
Installation
npm install -g @agentlogs/pi
# or
bun add -g @agentlogs/piSetup
Add the extension to your pi configuration:
Option 1: Global settings (~/.pi/agent/settings.json)
{
"extensions": ["@agentlogs/pi"]
}Option 2: Project settings (.pi/settings.json)
{
"extensions": ["@agentlogs/pi"]
}Option 3: Package.json
{
"pi": {
"extensions": ["@agentlogs/pi"]
}
}Features
Automatic Transcript Upload
When you end a pi session (Ctrl+D), your conversation transcript is automatically uploaded to AgentLogs.
Git Commit Tracking
When the AI makes git commits, the extension:
- Adds a link to the transcript in the commit message footer
- Tracks which commits are associated with which transcripts
- Makes it easy to find the AI conversation that led to any commit
Branch-Aware Transcripts
Pi supports conversation branching via /tree. The extension handles this by:
- Generating unique transcript IDs for each branch
- Only uploading the current branch (from leaf to root)
- Preserving links to older branches when you navigate away
Configuration
Environment Variables
AGENTLOGS_CLI_PATH- Custom path to the agentlogs CLI (defaults tonpx -y agentlogs@latest)
Repository Allowlist
By default, transcripts are only uploaded for repositories you've explicitly allowed:
# Allow the current repo
agentlogs allow
# Set visibility
agentlogs allow --public
agentlogs allow --team
agentlogs allow --private
# Deny the current repo
agentlogs denyDevelopment Setup
For local development, use the setup script:
# From the repo root
./packages/pi/scripts/dev-setup.sh
# This creates a symlink and shows the CLI path to export:
export AGENTLOGS_CLI_PATH="bun /path/to/agentlogs/packages/cli/src/index.ts"
# Now run pi - the extension loads automatically
piTo remove the dev setup:
./packages/pi/scripts/dev-teardown.sh
unset AGENTLOGS_CLI_PATHDebug Logging
Debug logs are written to /tmp/agentlogs.log when not in production mode.
# Watch logs in real-time
tail -f /tmp/agentlogs.logCLI Commands
The extension uses the agentlogs CLI under the hood:
# List recent sessions
agentlogs pi upload
# Upload a specific session
agentlogs pi upload <session-id>
agentlogs pi upload /path/to/session.jsonl
# Check login status
agentlogs status
# Login to AgentLogs
agentlogs login agentlogs.aiHow It Works
- The extension registers handlers for pi's lifecycle events
- On
session_shutdown, it shells out toagentlogs pi hookwith session data - The CLI converts the pi session format to AgentLogs' unified format
- The transcript is uploaded to the AgentLogs API
License
MIT
