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

selfagent0

v1.1.4

Published

SelfAgent — Cross-platform Autonomous AI & WhatsApp Gateway Agent. Install once, chat from your terminal or WhatsApp. Secure key storage via OS keychain (Windows DPAPI, macOS Keychain, Linux libsecret).

Readme

SelfAgent

SelfAgent Banner

The Autonomous AI Agent & Secure WhatsApp Gateway Engine

Install once, start the server, and command your AI assistant from either your CLI console or directly from WhatsApp.

npm version node engine license downloads


📖 Overview

SelfAgent is a powerful cross-platform CLI console and WhatsApp Gateway wrapper built for developers who want an autonomous, secure, and smart AI assistant on their machine.

Unlike messy CLI applications that store keys in plaintext .env files or litter your active directory with logs, SelfAgent is built to production-grade enterprise standards:

  • Secure Keychain Encrypted Secrets: Encrypts and saves your credentials (Groq, NVIDIA, GitHub, phone numbers) directly inside the OS secret store (Windows DPAPI, macOS Keychain, Linux libsecret).
  • Zero Active-Directory Clutter: All runtime configurations, authentication states, database store files, and logs are housed isolated in the user's home directory (~/.selfagent/).
  • Non-Corrupting CLI Console: Features a custom CLI REPL stdout interceptor that dynamically detects active typing lines and redrafts the prompt when background events log to the screen.

🔐 Hardware & OS Security Backends

SelfAgent secures your private tokens using the native operating system cryptography keyrings:

| OS | Native Keychain Store | Fallback Mechanism | | :--- | :--- | :--- | | Windows | DPAPI (Data Protection API) via encrypted host calls | AES-256-GCM local key store | | macOS | Keychain Services via native security wrappers | AES-256-GCM local key store | | Linux | libsecret / secret-tool package | Secure AES-256-GCM local key store |


🌟 Key Features

  • 🤖 Groq Llama 3.3 Engine: Superfast chat replies from Groq's high-performance API (with NVIDIA API fallback capabilities).
  • 📱 WhatsApp Gateway: Built on a fast WhatsApp socket connection. Scan a single terminal QR code once, and you are paired.
  • 🎙️ Voice Messages Processing: Transcribes received voice notes on WhatsApp (Whisper) and replies with a synthesised voice file (Text-to-Speech).
  • Flexible Task Reminders: Advanced parser schedules natural-language alerts (e.g. remind me in 30 seconds, tomorrow at 4 PM, or at 18:30). Auto-delivers alert notifications directly to your WhatsApp when due.
  • 🛡️ Silenced Internal Dumps: Cleaned stdout captures that automatically suppress noisy console output dumps like cryptographic sessions (Closing session).

🚀 Quick Start Guide

1. Global Installation (All OS)

Install the package globally using npm (requires Node.js ≥ 20):

npm install -g selfagent0

2. First-Time Secure Configuration

Execute the setup wizard to securely enter your keys. You will see characters in plain text so you can confirm pasted keys:

selfagent setup

Alternatively, run a non-interactive setup:

selfagent setup --GROQ_API_KEY=gsk_xxx --GITHUB_TOKEN=ghp_xxx

3. Launch the Server

selfagent

On launch, you'll be greeted with a QR code in the terminal. Scan it with WhatsApp (Settings → Linked Devices) to pair.


📦 Publishing to npm

If you want to publish your own fork or custom build of SelfAgent:

  1. Choose a Unique Name: Open your package.json and set the "name" field to a unique package name (e.g., "selfagent-custom").
  2. Authenticate with npm: Run npm login to sign in.
  3. Bypass 2FA via Classic Automation Token:
    • Go to your npm account profile $\rightarrow$ Access Tokens $\rightarrow$ Generate New Token $\rightarrow$ Classic Token.
    • Select Automation as the token type (this bypasses 2FA verification prompts during CLI publications).
    • Copy the generated token and link it to your local environment:
      npm config set //registry.npmjs.org/:_authToken "npm_your_automation_token"
  4. Publish to Registry:
    npm publish --access public

💻 CLI REPL Commands

Once the agent console is active (selfagent >), you can manage your system or query the AI:

selfagent > /help          → Show the CLI command reference shortcuts
selfagent > connect        → Display the pairing QR code
selfagent > status         → Fetch system health, RAM usage, and uptime
selfagent > resources      → Manually query developer APIs, credits & free tools
selfagent > reset          → Clear all memories, unlink WhatsApp, and purge local keys
selfagent > feed 15        → Set discovery broadcasts to WhatsApp every 15 minutes
selfagent > exit           → Gracefully stop the terminal console and gateway

Or simply type any question:

selfagent > tell me which whatsapp number is connected
⚡ SelfAgent
You are currently connected on WhatsApp phone number: 923440442160

⏰ Flexible Reminder Examples

Schedule task alerts naturally through the CLI or WhatsApp chat:

  • Relative times: remind me to check API keys in 45 seconds
  • Relative days: remind me tomorrow at 9:00 AM to read logs
  • Absolute daily times: remind me to write code at 18:30 (automatically rolls over to tomorrow if the time has already passed today).

⚙️ Configuration & Paths

All runtime state files are stored in the user's home folder:

  • JSON Config: ~/.selfagent/config/user_config.json
  • Saved Reminders Database: ~/.selfagent/config/reminders.json
  • WhatsApp Session Database: ~/.selfagent/auth/baileys/
  • Winston log streams: ~/.selfagent/logs/combined.log

🛡️ Uninstallation

Remove the package and wipe all local keys/configurations cleanly:

npm uninstall -g selfagent0
rm -rf ~/.selfagent

📄 License

Distributed under the MIT License. Created with ❤️ by SachalSumra and the SelfAgent contributors.