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 🙏

© 2025 – Pkg Stats / Ryan Hefner

notdiamond-cli

v0.0.2

Published

A beautiful command-line interface for NotDiamond's prompt adaptation service

Readme

notdiamond-cli

Command-line interface for NotDiamond's prompt adaptation service.

Installation

npm install -g notdiamond-cli

Or use directly with npx:

npx notdiamond-cli

Quick Start

1. Configure your API key

notdiamond-cli auth

Enter your NotDiamond API key when prompted. The key will be securely stored in ~/.notdiamond/config.json.

2. Adapt a prompt

notdiamond-cli adapt \
  --origin "openai/gpt-4o-2024-11-20" \
  --target "anthropic/claude-3-5-sonnet-20241022" \
  --system "You are a helpful assistant" \
  --template "Answer this question: {question}" \
  --goldens '[{"question": "What is 2+2?", "answer": "4"}]'

3. Check adaptation status

notdiamond-cli status <run-id>

4. View results

notdiamond-cli results <run-id>

Commands

notdiamond-cli auth

Configure your NotDiamond API key.

notdiamond-cli config [setting] [value]

View or update configuration settings.

Available settings:

  • min-goldens: Minimum number of golden examples (default: 25)
  • auto-generate: Auto-generate sample goldens if needed (default: true)
  • api-url: API endpoint URL

Examples:

notdiamond-cli config                    # View all settings
notdiamond-cli config min-goldens 10     # Set minimum goldens to 10
notdiamond-cli config auto-generate false # Disable auto-generation

notdiamond-cli adapt

Adapt a prompt for optimal performance across models.

Options:

  • -o, --origin <model> - Origin model
  • -t, --target <models...> - Target models to optimize for
  • -s, --system <prompt> - System prompt
  • --template <template> - User message template
  • -f, --fields <fields...> - Template fields
  • -g, --goldens <json> - Golden examples (JSON array)
  • -m, --metric <metric> - Evaluation metric
  • --min-goldens <number> - Minimum number of golden examples (default: 25)
  • --auto-generate - Auto-generate sample goldens if needed (default: true)
  • --no-auto-generate - Disable auto-generation of sample goldens

notdiamond-cli status <runId>

Check the status of an adaptation run.

notdiamond-cli results <runId>

Get the results of a completed adaptation run.

Supported Models

Models should be specified in provider/model format:

OpenAI

  • openai/gpt-4o-2024-11-20
  • openai/gpt-4o-2024-08-06
  • openai/gpt-4o-mini-2024-07-18
  • openai/gpt-4.1-2025-04-14
  • openai/gpt-4.1-mini-2025-04-14
  • openai/gpt-4.1-nano-2025-04-14

Anthropic

  • anthropic/claude-3-5-sonnet-20241022
  • anthropic/claude-3-7-sonnet-20250219
  • anthropic/claude-sonnet-4-20250514
  • anthropic/claude-opus-4-20250514

Google

  • google/gemini-1.5-pro-latest
  • google/gemini-2.5-flash
  • google/gemini-2.5-pro

Mistral

  • mistral/mistral-large-2411

Meta Llama (via OpenRouter)

  • openrouter/llama-3.1-8b-instruct
  • openrouter/llama-3.1-70b-instruct
  • openrouter/llama-3.1-405b-instruct

Qwen (via OpenRouter)

  • openrouter/qwen3-14b
  • openrouter/qwen3-32b
  • openrouter/qwen3-235b-a22b

Evaluation Metrics

  • LLMaaJ:SQL - SQL query evaluation
  • LLMaaJ:Sem_Sim_1 - Semantic similarity (top-1)
  • LLMaaJ:Sem_Sim_3 - Semantic similarity (top-3)
  • LLMaaJ:Sem_Sim_10 - Semantic similarity (top-10)
  • LLMaaJ:Unsupervised_Correctness_1 - Unsupervised correctness evaluation
  • JSON_Match - JSON output matching

Golden Examples

The API requires at least 25 golden examples by default. You can:

  1. Provide your own goldens - Recommended for best results
  2. Auto-generate sample goldens - The CLI will generate sample data if needed (enabled by default)
  3. Reduce the minimum - Use --min-goldens flag or configure globally

Customizing Golden Requirements

# Via command flags
notdiamond-cli adapt --min-goldens 5 --no-auto-generate

# Via configuration
notdiamond-cli config min-goldens 10
notdiamond-cli config auto-generate false

# Via environment variables
export NOTDIAMOND_MIN_GOLDENS=5
export NOTDIAMOND_AUTO_GENERATE_GOLDENS=false

Examples

Basic adaptation

notdiamond-cli adapt \
  --origin "openai/gpt-4o-2024-11-20" \
  --target "anthropic/claude-3-5-sonnet-20241022" \
  --system "You are an expert Python developer" \
  --template "Write a function that {task}" \
  --fields "task" \
  --goldens '[
    {"task": "reverses a string", "answer": "def reverse_string(s): return s[::-1]"},
    {"task": "checks if a number is prime", "answer": "def is_prime(n): return n > 1 and all(n % i != 0 for i in range(2, int(n**0.5) + 1))"}
  ]' \
  --metric "LLMaaJ:Sem_Sim_1"

Multiple target models

notdiamond-cli adapt \
  --origin "openai/gpt-4o-2024-11-20" \
  --target "anthropic/claude-3-5-sonnet-20241022" \
           "google/gemini-1.5-pro-latest" \
           "mistral/mistral-large-2411" \
  --system "You are a helpful assistant" \
  --template "Explain {concept} in simple terms" \
  --goldens '[{"concept": "quantum computing", "answer": "..."}]'

Environment Variables

  • NOTDIAMOND_API_KEY - Your NotDiamond API key
  • NOTDIAMOND_API_URL - API endpoint (default: https://api.notdiamond.ai)
  • NOTDIAMOND_MIN_GOLDENS - Minimum golden examples required
  • NOTDIAMOND_AUTO_GENERATE_GOLDENS - Enable/disable auto-generation (true/false)

License

MIT