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

@kloddy/kloddy-cli

v0.1.0

Published

Kloddy CLI

Readme

@kloddy/kloddy-js

Kloddy is the ultimate platform for Prompt Engineering and LLM Analytics. This SDK allows you to fetch, compile, and execute prompts directly from your Node.js or React applications.

installation

# via npm
npm install @kloddy/kloddy-js

# via yarn
yarn add @kloddy/kloddy-js

Quick Start

Basic Usage (Node.js)

import { Kloddy } from 'kloddy-js';

const kloddy = new Kloddy({
  apiKey: '<your_project_api_key>',
  apiSecret: '<your_personal_api_key>',
  host: 'https://api.kloddy.com' // Optional
});

// Fetch a prompt template
const template = await kloddy.prompts.get('customer-support-agent', {
  fallback: 'You are a helpful assistant.'
});

// Compile with variables
const systemPrompt = kloddy.prompts.compile(template, {
  userName: 'Alice',
  company: 'Acme Corp'
});

console.log(systemPrompt);

React Usage

Wrap your app with KloddyProvider. For security, it is highly recommended to generate an accessToken on your server and pass it to the frontend instead of using your apiSecret in the browser.

import { KloddyProvider, usePrompt } from '@kloddy/kloddy-js';

function MyComponent() {
  const { getPrompt, getAwnser } = usePrompt();

  const handleWelcome = async () => {
    const prompt = await getPrompt('welcome-message');
    const response = await getAwnser('welcome-message', {
      variables: { name: 'Alice' }
    });
    console.log(response.result);
  };

  return <button onClick={handleWelcome}>Say Hello</button>;
}

function App() {
  // The token should be fetched from your own API
  const [token, setToken] = useState('');

  return (
    <KloddyProvider apiKey="YOUR_PROJECT_ID" token={token}>
      <MyComponent />
    </KloddyProvider>
  );
}

Advanced Usage

Organization & Feature Context

You can set a default organization or feature ID during initialization to simplify your calls.

const kloddy = new Kloddy({
  apiKey: '...',
  defaultOrgId: 'org_123',
  defaultFeatureId: 'feat_456'
});

// These will now use the defaults automatically
const prompts = await kloddy.prompts.list();
const features = await kloddy.listFeatures();

Account Information

const user = await kloddy.whoAmI();
const orgs = await kloddy.listOrganizations();
const features = await kloddy.listFeatures(orgs[0].id);

Prompts Management

// List all prompts
const allPrompts = await kloddy.prompts.list({ pageSize: 50 });

// Update/Sync (alias for list)
const synced = await kloddy.prompts.update();

// Play (Direct Execution)
const result = await kloddy.prompts.play('my-prompt', {
  variables: { user: 'Alice' },
  model: 'gpt-4'
});

Evaluations

const evalResult = await kloddy.evaluations.evaluate({
  name: 'model-comparison',
  models: ['gpt-4', 'claude-3'],
  judge: 'gpt-4-judge',
  variables: { input: '...' },
  temperature: 0.7
});

API Reference

Kloddy Client

  • whoAmI(): Get current user details.
  • listOrganizations(): List organizations.
  • listFeatures(orgId?): List features.
  • prompts.list(filters): List prompts with pagination and filters.
  • prompts.get(name, options): Fetch a template.
  • prompts.play(name, options): Execute a prompt directly.
  • prompts.update(): Sync all prompts.
  • evaluations.evaluate(options): Run model evaluations.

React Hooks

  • usePrompt(): Returns getPrompt, getAwnser, getEvaluation, compile.

Integration with Vercel AI Gateway

You can use Kloddy to manage your prompts and Vercel AI Gateway to route your LLM calls.

const template = await kloddy.prompts.get('support-agent');
const systemPrompt = kloddy.prompts.compile(template, { user: 'Alice' });

// Use with OpenAI via Vercel AI Gateway
const openai = new OpenAI({
  baseURL: 'https://gateway.ai.cloudflare.com/v1/YOUR_ACCOUNT_ID/YOUR_GATEWAY_ID/openai'
});

License

MIT © Kloddy