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

@peteretelej/ai-chat

v0.1.3

Published

Chat with local AI coding agents from Telegram, powered by the OpenCode API

Readme

ai-chat

Chat with & control AI Agents via telegram, chat UI & voice.

Note: OpenCode is the first supported agent (served over its HTTP/SSE API); the adapter interface keeps other CLI agents open.

Running

  • Start the Telegram bot with go run ./cmd/ai-chat start --config ./config.json
  • Run the in-process regression suite with go run ./cmd/ai-chat test
  • Run one named regression with go run ./cmd/ai-chat test --scenario "Session switching regression"
  • Run the explicit Telegram acceptance path with go run ./cmd/ai-chat test --scenario telegram-acceptance --config ./config.json

Deployment (systemd user service)

Run ai-chat as a self-starting systemd user service (validated on ndovu). The binary is expected at ~/.local/bin/ai-chat; the unit resolves ~ to your home directory.

  1. Install the binary:

    • Build from source: ./scripts/build.sh && mkdir -p ~/.local/bin && cp ai-chat ~/.local/bin/
    • Or download a release asset from GitHub releases and place it at ~/.local/bin/ai-chat
    • Or npm install -g @peteretelej/ai-chat and copy/link the installed ai-chat binary to ~/.local/bin/ai-chat
  2. Place the config at ~/.config/ai-chat/config.json (the service reads this path by default; no --config flag needed). It holds the bot token, so restrict it: chmod 600 ~/.config/ai-chat/config.json

  3. Install and start the unit:

    mkdir -p ~/.config/systemd/user
    cp deploy/ai-chat.service ~/.config/systemd/user/
    systemctl --user daemon-reload
    systemctl --user enable --now ai-chat
  4. Keep the service running after logout: loginctl enable-linger $USER

  5. Watch logs with journalctl --user -u ai-chat -f (daily JSON log files also land in ~/.config/ai-chat/logs)

Restart after a binary or config change with systemctl --user restart ai-chat (./scripts/restart.sh does this for you when the unit is installed).

Continuity: each workspace's opencode serve port is derived deterministically, so opencode attach http://127.0.0.1:<port> URLs stay stable across service restarts; attach again with the same URL after a restart or reboot.

Validation

  • Final refactor validation is go test ./...
  • Then run ./scripts/pre-push
  • Then run one explicit telegram-acceptance pass against a real Telegram bot/chat configuration

Telegram Acceptance

  • telegram-acceptance is opt-in and is not part of normal go test or default ai-chat test runs
  • By default it uses telegram.bot_token
  • You can override the bot with telegram.acceptance_bot_token
  • You should set telegram.acceptance_chat_id to the real chat to validate
  • If you omit telegram.acceptance_chat_id, the command only falls back when telegram.allowed_users contains exactly one direct-chat user ID

Runtime Notes

  • The in-process test harness boots the same store, router, session manager, and outbound response flow used by start
  • Telegram remains a transport/rendering adapter on top of router and session-manager behavior