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

palmier

v0.2.0

Published

Palmier agent CLI - provisions, executes tasks, and serves NATS RPC

Downloads

1,146

Readme

Palmier Agent

A Node.js CLI that runs on your machine as a persistent agent. It manages tasks, communicates with the Palmier platform via NATS, and executes Claude Code autonomously.

Prerequisites

  • Node.js 20+
  • Claude Code CLI installed and authenticated
  • Linux with systemd (the agent installs as a systemd user service)

Installation

npm install -g palmier

CLI Commands

| Command | Description | |---|---| | palmier init --token <token> | Provision the agent with a token from the dashboard | | palmier serve | Run the persistent NATS RPC handler (default command) | | palmier run <task-id> | Execute a specific task |

Setup

  1. Install the agent: npm install -g palmier
  2. Register on the Palmier PWA and click Add Agent.
  3. Copy the provisioning token.
  4. Run palmier init --token <token> in your project directory.

The init command:

  • Saves agent configuration to ~/.config/palmier/agent.json
  • Installs a systemd user service for the agent

Verifying the Service

After palmier init, verify the agent is running:

# Check service status
systemctl --user status palmier-agent.service

# View recent logs
journalctl --user -u palmier-agent.service -n 50 --no-pager

# Follow logs in real time
journalctl --user -u palmier-agent.service -f

You should see Active: active (running) and log output showing a NATS connection. If the service failed:

# Restart manually
systemctl --user restart palmier-agent.service

# Check config is valid
cat ~/.config/palmier/agent.json

How It Works

  • The agent runs as a systemd user service, staying alive in the background.
  • The persistent process (palmier serve) is a NATS RPC handler. It derives the RPC method from the NATS subject (e.g., ...rpc.task.createtask.create) and treats the message body as request parameters.
  • Task IDs are generated by the agent as UUIDs.
  • All RPC responses (task.list, task.create, task.update) return flat task objects — frontmatter fields at the top level, not nested under a frontmatter key.
  • Tasks have no separate name field — the user_prompt is the primary identifier and display label.
  • Plan generation is optional — if no plan body is present, the agent uses only user_prompt as the prompt.
  • Triggers can be enabled/disabled via the triggers_enabled frontmatter field (default true). When disabled, systemd timers are removed; when re-enabled, they are reinstalled. Tasks can still be run manually regardless.
  • Incoming tasks are stored as TASK.md files in a local tasks/ directory.
  • Task execution spawns Claude Code as a background process with -p --dangerously-skip-permissions, running non-interactively. Task lifecycle events (start, finish, abort, fail) are tracked via a NATS JetStream KV bucket (task-event), keyed by <agent_id>.<task_id>.
  • Task confirmation — tasks with requires_confirmation: true write a pending entry to the pending-confirmation KV bucket before execution. The Web Server and PWA watch this bucket to show confirmation prompts. The task waits until the user confirms or aborts via the PWA or push notification.

Project Structure

src/
  index.ts            # CLI entrypoint (commander setup)
  config.ts           # Agent configuration (read/write ~/.config/palmier)
  nats-client.ts      # NATS connection and messaging
  systemd.ts          # systemd service installation
  task.ts             # Task file management
  types.ts            # Shared type definitions
  commands/
    init.ts           # Provisioning logic
    serve.ts          # Persistent NATS RPC handler
    run.ts            # Single task execution

Removing an Agent

To fully remove an agent from a machine:

  1. Delete the agent from the PWA dashboard (this removes it from the server database).

  2. Stop and remove the systemd service:

    systemctl --user stop palmier-agent.service
    systemctl --user disable palmier-agent.service
    rm ~/.config/systemd/user/palmier-agent.service
  3. Remove any task timers and services:

    systemctl --user stop palmier-task-*.timer palmier-task-*.service 2>/dev/null
    systemctl --user disable palmier-task-*.timer 2>/dev/null
    rm -f ~/.config/systemd/user/palmier-task-*.timer ~/.config/systemd/user/palmier-task-*.service
  4. Reload systemd:

    systemctl --user daemon-reload
  5. Remove the agent configuration:

    rm -rf ~/.config/palmier
  6. Remove the tasks directory from your project root:

    rm -rf tasks/
  7. (Optional) Disable login lingering if no other user services need it:

    loginctl disable-linger

Related

See the palmier repo for the server, API, and PWA.