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

@agentlas/codex

v0.1.5

Published

Codex plugin for Agentlas: Tree Hole notes and knowledge extraction backed by the Agentlas MCP server.

Readme

@agentlas/codex

Codex plugin for Agentlas. Adds Tree Hole note and knowledge-extraction skills backed by the Agentlas MCP server (@agentlas/mcp).

Codex plugins use skills + MCP rather than slash commands, so users invoke this through natural language ("把这段话发到树洞 …", "总结本次 session 发到树洞").

Layout

.
├── .codex-plugin/plugin.json
├── bin/codex.js                    # install + config CLI
├── .mcp.json                       # registers the agentlas MCP server via `npx -y @agentlas/mcp@<pinned>`
├── scripts/auto-summary.cjs        # automatic Tree Hole summary runner
├── shell/                          # shell wrappers used for session-end summaries
└── skills/
    ├── agentlas-treehole/SKILL.md
    └── agentlas-knowledge-extraction/SKILL.md

Install

One-shot install + configure (recommended)

npx @agentlas/codex install \
  --base-url "https://your-agentlas-domain.com" \
  --api-key  "sk_live_xxxxxxxx"

Restart Codex. Done.

Install separately

npx @agentlas/codex install
npx @agentlas/codex config \
  --base-url "https://your-agentlas-domain.com" \
  --api-key  "sk_live_xxxxxxxx"

Restart Codex.

Already configured another Agentlas host?

Credentials live in ~/.agentlas/config.json and are shared across every Agentlas host plugin. If you ran config already (e.g. via @agentlas/claude-code), the codex installer detects this and skips the credential prompt:

npx @agentlas/codex install
# →  Installed Codex Agentlas plugin to ~/.codex/plugins/agentlas-plugins/plugins/agentlas
#    Using existing Agentlas credentials (~/.agentlas/config.json).
#    Next step: Restart Codex.

Reinstall / upgrade

npx @agentlas/codex install --force

~/.agentlas/config.json is not touched, so reinstalls and upgrades never lose your token.

Uninstall

npx @agentlas/codex uninstall

~/.agentlas/config.json is intentionally kept (other host plugins may still need it). Run npx @agentlas/codex config --unset to remove credentials too.

Configure

Credentials are stored in one user-level file shared by every Agentlas host plugin:

~/.agentlas/config.json    # chmod 0600, dir chmod 0700
{
  "apiBaseUrl": "https://your-agentlas-domain.com",
  "apiToken": "sk_live_xxxxxxxx"
}

CLI

# Set
npx @agentlas/codex config --base-url "https://..." --api-key "sk_live_..."

# Preferences
npx @agentlas/codex config --confirm-before-save true
npx @agentlas/codex config --auto-summary true --yes

# Inspect (token is masked)
npx @agentlas/codex config --show

# Remove
npx @agentlas/codex config --unset

config --show reports whether values come from env vars or the file, plus the saved Tree Hole and Codex auto-summary preferences. Codex auto-summary configuration is stored under codex.autoSummary.

Auto Summary

# Enable automatic Codex summaries
npx @agentlas/codex config --auto-summary true --yes

# Disable automatic Codex summaries
npx @agentlas/codex config --auto-summary false --yes

Enabling auto-summary installs a shell wrapper into your zsh/bash/fish rc file, copies a stable runtime to ~/.agentlas/codex-auto-summary-runtime, writes the runner at ~/.agentlas/codex-wrapper-runner.js, and merges a Codex PreCompact hook into ~/.codex/hooks.json. Session-end summaries are captured by the shell wrapper; PreCompact summaries are captured by the Codex hook. The runner fails closed when it cannot identify a single matching rollout. PreCompact matching relies on the rollout cwd being unique among active sessions.

Env-var override (CI / Docker / temporary)

AGENTLAS_API_BASE_URL=https://example.com \
AGENTLAS_API_TOKEN=sk_live_xxx \
codex

The MCP server reads env first, file second.

Custom config directory

export AGENTLAS_CONFIG_DIR="$HOME/.agentlas-staging"
npx @agentlas/codex config --base-url ... --api-key ...

What .mcp.json does

The installed .mcp.json only registers npx -y @agentlas/mcp@<exact-version> — pinned to a specific version because the MCP server is in the 0.x range and every minor release may be breaking. There is no env-var interpolation in it anymore — the MCP server reads ~/.agentlas/config.json (or env vars) on its own. This means:

  • Plugin reinstalls (install --force) cannot wipe credentials.
  • Switching hosts (codex ↔ claude-code) inherits the same credentials with zero reconfiguration.
  • The token is never written into Codex's host-level config.

Where the install actually goes

The installer copies the plugin into a local marketplace at ~/.codex/plugins/agentlas-plugins/plugins/agentlas, writes a real copy into Codex's plugin cache at ~/.codex/plugins/cache/agentlas-plugins/agentlas/<version>, and enables agentlas@agentlas-plugins in ~/.codex/config.toml.

Usage

帮我把这段话发到树洞:今天有点累,但还是把最重要的事情推进了一点

Knowledge extraction examples:

总结本次 session 发到树洞
把本轮上下文存成 memory,保留关键决策和待办
提取这次对话里可复用的知识和踩坑经验,保存到树洞

The plugin sends a POST /api/tree-hole-posts request to Agentlas with { "visibility": "private", "body": "..." }. The post author is determined by the saved API key.

Troubleshooting

  • 还没有配置 Agentlas 服务地址apiBaseUrl is missing. Run agentlas-codex config --base-url ... --api-key ....
  • 还没有配置 Agentlas API TokenapiToken is missing. Same fix.
  • Agentlas API Token 无效或已失效 — create a fresh API key in Agentlas Settings, then rerun config.
  • 树洞保存失败,请稍后再试 — the Agentlas server is unreachable or /api/tree-hole-posts is unhealthy.
  • MCP server doesn't start — check that npx -y @agentlas/mcp@<pinned> succeeds in your shell; npm registry access is required at first run.
  • Plugin doesn't appear after install — restart Codex and confirm ~/.codex/config.toml contains [plugins."agentlas@agentlas-plugins"].
  • Credentials not picked up after config — restart Codex so the MCP server is re-spawned.