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

wiadro

v0.1.7

Published

Wiadro Agent CLI - Connect machines to Wiadro server

Readme

Wiadro Agent

The Wiadro Agent is a CLI tool that runs on machines you want to manage via the Wiadro server. It maintains a persistent connection to the cloud server and manages the local OpenCode instance.

Installation

# Install globally
npm install -g wiadro

# Or from source
git clone https://github.com/your-org/wiadro.dev.git
cd wiadro.dev/packages/agent
npm install
npm run build
npm link

Quick Start

# Get your agent token from the Wiadro dashboard
# (Machines -> Add Machine -> Copy Token)

# Connect to your server
wiadro connect https://your-server.com YOUR_AGENT_TOKEN --daemon

# Check status
wiadro status

# View logs
wiadro logs

Commands

Connection Management

# Connect to server (foreground)
wiadro connect <serverUrl> <agentToken>

# Connect as background daemon
wiadro connect <serverUrl> <agentToken> --daemon

# Options:
#   -p, --port <port>   OpenCode port (default: 4096)
#   --auto-start        Auto-start OpenCode on connect
#   -d, --daemon        Run in background

# Disconnect and remove config
wiadro disconnect

Daemon Control

# Start daemon (requires prior connect)
wiadro up

# Stop daemon
wiadro down

# Check status
wiadro status

# Restart agent
wiadro restart --agent

OpenCode Control

# Start OpenCode server
wiadro start

# Stop OpenCode server
wiadro stop

# Restart OpenCode server
wiadro restart

Logs

# View last 50 lines
wiadro logs

# View last N lines
wiadro logs -n 100

# Clear logs
wiadro logs --clear

Configuration

The agent stores its configuration in ~/.wiadro/:

| File | Description | | ----------------- | -------------------------------- | | config.json | Server URL, token, port settings | | agent.pid | PID file for daemon | | agent.log | Standard output | | agent.error.log | Error output |

config.json

{
  "serverUrl": "https://your-server.com",
  "agentToken": "your-agent-token",
  "opencodePort": 4096,
  "autoStart": false
}

Running as a System Service

systemd (Linux)

Create /etc/systemd/system/wiadro-agent.service:

[Unit]
Description=Wiadro Agent
After=network.target

[Service]
Type=simple
User=your-user
WorkingDirectory=/home/your-user
ExecStart=/usr/local/bin/wiadro run
Restart=always
RestartSec=10
Environment=NODE_ENV=production

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable wiadro-agent
sudo systemctl start wiadro-agent

launchd (macOS)

Create ~/Library/LaunchAgents/com.wiadro.agent.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.wiadro.agent</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/bin/wiadro</string>
        <string>run</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <true/>
</dict>
</plist>
launchctl load ~/Library/LaunchAgents/com.wiadro.agent.plist

How It Works

  1. Connection: Agent establishes an SSE (Server-Sent Events) connection to the Wiadro server
  2. Heartbeat: Every 30 seconds, agent sends status + OS info to server
  3. Commands: Server can send commands (START, STOP, RESTART) via SSE
  4. Status Updates: Agent reports OpenCode status changes back to server
  5. Reconnection: Auto-reconnects with exponential backoff on disconnect

Requirements

  • Node.js 20+
  • OpenCode CLI installed (npm install -g opencode)
  • Network access to Wiadro server

Troubleshooting

Agent won't connect

# Check logs
wiadro logs

# Verify config
wiadro status

# Try foreground mode to see errors
wiadro down
wiadro run

OpenCode won't start

# Check OpenCode is installed
opencode --version

# Check port availability
lsof -i :4096

# Try starting manually
opencode serve --port 4096

Permission denied

# Make sure the binary is executable
chmod +x $(which wiadro)

# Check npm global bin is in PATH
npm bin -g

Development

cd packages/agent
npm install
npm run dev    # Watch mode
npm run build  # Build

License

MIT