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

@diva_permana_putra/needle-cli

v0.1.0-beta.0

Published

Needle — open-source, multi-provider AI coding CLI

Readme

Needle is an autonomous, terminal-native AI coding assistant. It integrates directly with your codebase, reads your files, executes commands, and writes code.

Designed to be lightweight and fast, Needle brings the power of Agentic AI to your command line, supporting multiple model providers.

Features

  • Agentic Loop: Think -> Plan -> Act loop for reliable code generation and problem-solving.
  • Project Memory: Maintains persistent project context at .needle/MEMORY.md.
  • Session History: Resumable conversation sessions.
  • Multi-Provider: Use OpenRouter, 9Router, OpenAI-compatible APIs, DeepSeek, or Gemini.
  • Built-in Tools: File read/write, git integration, semantic search, and shell execution.
  • Safety First: Configurable permission modes (ask, auto, dry-run) to keep you in control.

Install

# Install globally
npm install -g needle-cli

# Or use without installing
npx needle-cli init

Quickstart

  1. Initialize Needle in your project:

    needle init
  2. Set your API key (e.g., for OpenRouter):

    export OPENROUTER_API_KEY="your_openrouter_key"
  3. Ask Needle to do something:

    needle code "Refactor the authentication middleware"

Provider Setup

Needle supports multiple AI providers. Configure them via environment variables or .env.

9Router

9Router acts as a gateway. The 9Router dashboard manages your upstream provider auth. Needle does not need your upstream provider keys directly.

Use your 9Router gateway/endpoint API key for NINE_ROUTER_API_KEY. If running a local trusted 9Router, auth may be disabled depending on your gateway config.

Base URL examples:

  • local: http://localhost:20128/v1
  • remote: http://your-host:20128/v1

Model examples:

  • low
  • medium
  • high
  • free (or any combo name copied from the 9Router dashboard)

Example Setup:

needle config set provider 9router
needle config set providers.9router.baseUrl http://localhost:20128/v1
needle config set model.coder low
export NINE_ROUTER_API_KEY="your_9router_gateway_key"

OpenRouter

export OPENROUTER_API_KEY="your_openrouter_key"

OpenAI-Compatible

export OPENAI_API_KEY="your_openai_key"
export OPENAI_BASE_URL="https://api.openai.com/v1" # Customize for local models (e.g., LMStudio, Ollama)

Gemini

export GEMINI_API_KEY="your_gemini_key"

DeepSeek

export DEEPSEEK_API_KEY="your_deepseek_key"

You can select a specific model when running commands using the --model flag:

needle code "Fix the build script" --model "deepseek/deepseek-coder"

Commands

init

Initialize Needle in the current directory. Creates .needle/ configuration folder.

needle init

config

View or modify your current configuration.

needle config list

models

List available models for your configured providers.

needle models

plan

Draft an execution plan without modifying files.

needle plan "How should we implement user avatars?"

code

The main agent loop. Needle will read files, think, and write code to accomplish the task.

needle code "Add a health check endpoint to Express"

review

Review unstaged git changes and suggest improvements or catch bugs.

needle review

sessions

Manage past interaction sessions.

needle sessions list
needle sessions resume <session_id>

reflect

Analyze recent sessions and update the project memory document.

needle reflect

Memory Workflow

Needle learns about your project over time.

  • Context is stored in .needle/MEMORY.md.
  • Sessions are logged in .needle/sessions/runs.jsonl.
  • Run needle reflect periodically to distill session learnings into the core memory document.

Safety Model & Permissions

Needle can execute shell commands and modify files. To prevent unintended actions, Needle supports different permission modes:

  • --mode ask (Default): Prompts for confirmation before executing commands or writing files.
  • --mode auto: Executes safe commands automatically. Prompts for destructive actions.
  • --mode dry-run: Simulates actions and prints them to the console without applying them.

Example:

needle code "Update dependencies" --mode auto

Built-in Tools

Needle equips the LLM with a comprehensive toolset:

  • file-read / file-write / file-edit: File system manipulation.
  • shell: Command line execution.
  • glob / grep: Codebase exploration.
  • git-diff: Code review context.

Example Workflow

# 1. Initialize
needle init

# 2. Ask for a plan
needle plan "I want to add Redis caching to our API"

# 3. Execute the plan
needle code "Implement the Redis caching plan we just discussed" --mode ask

# 4. Review the changes
needle review

# 5. Commit
git commit -m "feat: add Redis caching"

# 6. Update project memory
needle reflect

Status & Roadmap

Needle is currently in beta. It is usable for terminal dogfooding, but APIs and command behavior may change before v1.0.

  • [x] Core agent loop
  • [x] Multi-provider support
  • [x] Basic memory system
  • [ ] VSCode Extension
  • [ ] Custom tool plugins
  • [ ] Multi-agent collaboration

License

MIT License. See LICENSE for details.