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

@cdmbase/cdecli-agent-client

v0.2.0

Published

TypeScript client for cdecli-agent (POST /v1/cdecli/exec). Ships alongside the Go agent server.

Readme

@cdmbase/cdecli-agent-client

npm

TypeScript client for the cdecli-agent Go HTTP server.

Ships in the same repo as the agent server (src/serve/cdecli_exec.go) so the wire protocol and client move together — every protocol change lands as one PR.

Install

yarn add @cdmbase/cdecli-agent-client
# optional: enable HTTP keep-alive on Node
yarn add undici

Why

A thin, dependency-light wrapper around the cdecli-agent wire protocol (POST /v1/cdecli/exec). Owns the sentinel parser, auth header logic, and credential-key picker so callers don't re-implement them.

Layers

CdecliAgentClient       ← transport (fetch + headers + JSON)
    │
    ├─ CdecliConnectorClient    ← cdecli connector run/install/list/actions
    ├─ CdecliAgentRunnerClient  ← cdecli agent -m … (CDE-Agent)
    └─ CdecliSearchClient       ← cdecli connector search …

Usage

import {
    CdecliAgentClient,
    CdecliConnectorClient,
} from '@cdmbase/cdecli-agent-client';

const transport = new CdecliAgentClient({
    endpoint: process.env.CDECLI_AGENT_ENDPOINT ?? 'https://your-cdecli-agent.example.com',
});
const connectors = new CdecliConnectorClient(transport);

const result = await connectors.runAction({
    userToken: userJwt,            // bearer for per-user $HOME isolation
    connector: 'github',
    action: 'GITHUB_LIST_ISSUES',
    params: { repo: 'owner/repo' },
    credentialId: 'fb-cred-id',    // optional vault lookup
});

if (result.successful) {
    console.log(result.data);
} else {
    console.error(result.error);
}

Wire contract

Matches src/serve/cdecli_exec.go::ExecRequest in this repo. Accepts either args (argv) or shell_command (POSIX line). Response shape is { stdout, stderr, exit_code, error? }.

Drift policy: every change to the Go ExecRequest / ExecResponse struct in src/serve/cdecli_exec.go must update src/types.ts in the same PR.

HTTP keep-alive

On Node, the default fetchImpl uses a process-wide undici.Agent (connections: 128, keepAliveTimeout: 30s) shared across all tenants. JWTs and session ids live in per-request headers, so pooling is safe.

Disable with CDECLI_AGENT_KEEPALIVE=0.

Development

cd packages/cdecli-agent-client
yarn install
yarn build
yarn test

This package is standalone — not part of any workspace. It pulls its own node_modules and is published independently of the Go binary.