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

@needle-ai/needlectl

v1.2.2

Published

CLI tool for syncing local files to Needle

Readme

Needle Control CLI Tool

needlectl is local client for MacOS, Windows, Linux to sync files to Needle.

Features

  • Real-time file monitoring and synchronization
  • Automatic file state management
  • Support for multiple file types
  • Recursive and non-recursive folder monitoring
  • Efficient handling of file changes, additions, and deletions

Quick Start

Install needlectl command line tool globally using your favourite package manager, we recommend using bun:

bun install -g @needle-ai/needlectl

or using NPM:

npm install -g @needle-ai/needlectl
  1. Verify installation:
needlectl --version
  1. Set your API key:
needlectl api-key set <your-needle-api-key>
  1. List your collections:
needlectl collections list

Create a local connector to sync data

needlectl connectors local create --name "My Connector" --collection-id <collection-id> --folder <folder-to-sync>

Start the Needle daemon

needlectl daemon start

Your local connector will now watch the files in the folder and sync them to Needle. Initially, it will perform a full sync of the folder. In case you want to trigger a full sync manually, you can do so by restarting the daemon:

needlectl daemon restart

To stop the daemon, run:

needlectl daemon stop

To track the updates from the daemon, you can check the logs:

needlectl daemon logs

File Synchronization

The daemon automatically:

  • Monitors specified folders for changes
  • Syncs new files to Needle platform
  • Handles file updates
  • Processes file deletions
  • Maintains file state tracking

Supported File Types

  • PDF (application/pdf)
  • Text (text/plain)
  • Word (application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
  • Excel (application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
  • PowerPoint (application/vnd.ms-powerpoint, application/vnd.openxmlformats-officedocument.presentationml.presentation)
  • CSV (text/csv)
  • HTML (text/html)
  • Calendar (text/calendar)

This list grows every day, for more up-to-date information please check Needle.

Common Issues

  1. "API key not found"

    • Solution: Set API key using needlectl api-key set <key>
  2. "Collection not found"

    • Solution: Verify collection ID using needlectl collections list
  3. "Upload failed"

    • Check API key validity
    • Verify file size limits
    • Check network connection

I'll create a comprehensive command reference based on the CLI commands shown in the code. Here's the markdown documentation:

Command Reference

needlectl is a command-line tool to sync local files to Needle.

API Key Management

  • needlectl api-key set <key> - Set the Needle API key
  • needlectl api-key delete - Delete the current API key

Device Management

  • needlectl device info - Show details of the current device

Daemon Control

  • needlectl daemon start - Start the Needle daemon
  • needlectl daemon status - Check the Needle daemon status
  • needlectl daemon logs [--tail <n>] - Show daemon logs
    • --tail <n>: Show last n lines
  • needlectl daemon stop - Stop the Needle daemon
  • needlectl daemon restart - Restart the Needle daemon
  • needlectl daemon sync - Manually run a full sync

Files Management

  • needlectl files upload -f <file...> - Upload files to Needle
    • -f, --files <file...>: Path to file(s) to upload (can specify multiple)

Collections Management

  • needlectl collections create --name <name> [--model <model>] - Create a new collection
    • --name <name>: Collection name
    • --model <model>: Model to use (basilikum-minima, mate-meta) [default: basilikum-minima]
  • needlectl collections list - List all collections
  • needlectl collections get <collection-id> - Get collection details
  • needlectl collections stats <collection-id> - Get collection statistics
  • needlectl collections search <collection-id> --text <text> [options] - Search within a collection
    • --text <text>: Text to search for
    • --max-distance <n>: Maximum distance for search
    • --top-k <n>: Number of results to return

Collection Files

  • needlectl collections files list <collection-id> - List files in a collection
  • needlectl collections files add <collection-id> --name <names...> --url <urls...> - Add files to a collection
    • --name <names...>: File names
    • --url <urls...>: File URLs

Connectors Management

  • needlectl connectors list - List all connectors

Local Connectors

  • needlectl connectors local list - List local connectors
  • needlectl connectors local get <connector-id> - Show details of a local connector
  • needlectl connectors local create [options] - Create a new local connector
    • --name <name>: Connector name
    • --collection-id <ids...>: Target collection IDs
    • -f, --folder <path...>: Folder paths to monitor (non-recursive)
    • -r, --recursive <path...>: Folder paths to monitor (recursive)
  • needlectl connectors local delete <connector-id> - Delete a local connector