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

pastedb-cli

v0.2.0

Published

Official CLI for PasteDB

Readme

PasteDB CLI

A fast, lightweight, and modern command-line interface for PasteDB — create, read, update, delete, explore, and manage your pastes directly from your terminal.


✨ Features

  • 📤 Create pastes instantly from local files.
  • 📋 Fetch and read existing pastes in your terminal.
  • 🗑️ Delete pastes directly from the command line.
  • 🌎 Explore public pastes without opening a browser.
  • 👤 Manage your account status and user details.
  • 🔑 Provision API keys dynamically.
  • ▶️ Execute code through PasteDB's remote run service.
  • 🔍 Validate custom IDs for availability instantly.
  • 🗂️ Manage and browse your pastes interactively from the terminal

📦 Installation

Ensure you have Node.js 18+ installed on your system.

npm install -g pastedb-cli

Verify that the installation was successful:

pdb --version

🔐 Authentication

Before using API-dependent features, authenticate your terminal client.

pdb auth

You will see the following interactive prompt:

PasteDB CLI Authentication
--------------------------
PasteDB API key: 

Once entered, your configuration updates:

✓ API key saved. You can now use PasteDB CLI commands.

Storage and Environment Variables

  • Local Storage: Your token resides locally at ~/.pastedb/config.json.
  • Environment Overrides: You can export your key directly to your environment:

🚀 Commands

📤 Create a Paste

Upload a local file to PasteDB. The language syntax is automatically detected via the file extension.

pdb create app.py

Output:

Uploading app.py...
✓ Paste created! https://pastedb.netlify.app/paste/abc123

🧭 Interactive Create

Don't want to specify a file directly? Just run:

pdb create

PasteDB opens an interactive creation flow:

What do you want to upload?

❯ File
  Raw text
  First item from clipboard

📁 File

Choose File to upload a local file (Enter File name).

? Which file do you want to upload?
❯ app.py

📝 Raw Text

Choose Raw text when you want to create a paste directly from text entered in the terminal.

? Enter your raw text:

Enter your content and press Ctrl+D when you're finished.

📋 Clipboard

Selects First item from clipboard to upload the current clipboard content.

Before uploading, PasteDB shows you exactly what will be uploaded:

Clipboard content:

Example

------------------------------
print("Hello from PasteDB!")
------------------------------

Press Ctrl+D to upload this content.

Supported syntax extensions include: .js, .py, .html, .css, .json, .md, .java, .cpp, .c, .go, .rs, .php, .rb, .sh, .sql, .xml, .yaml.

📥 Get a Paste

Print the raw contents of a specific paste directly to stdout.

pdb get abc123

🗂️ Manage Pastes Interactively

Manage your PasteDB pastes directly from your terminal with the interactive paste manager.

pdb pastes

The interactive interface lets you:

📋 Browse all your pastes.

⬆️⬇️ Navigate between pastes using the arrow keys.

🌐 Open the selected paste directly in your browser.

🗑️ Delete pastes without leaving the terminal.

🔄 Refresh your paste list.

🔐 Recognizes encrypted/private pastes without displaying their encrypted content.

Controls

↑ ↓           Navigate between pastes
Enter         Open the selected paste
d             Delete the selected paste
r             Refresh the paste list
q             Quit
Ctrl+C        Exit

Example of pdb pastes:

╭──────────────────────────────────────────────────────────────╮
│                         PasteDB                              │
│                       Your Pastes                            │
╰──────────────────────────────────────────────────────────────╯

  12 pastes

  ❯ app.py
      ID:       abc123
      Language: python
      Preview:  print("Hello from PasteDB!")

    website.html
      ID:       xyz789
      Language: html
      Preview:  <!DOCTYPE html>...

    [Encrypted paste]
      ID:       private123
      Language: text
      Preview:  [Encrypted content]

──────────────────────────────────────────────────────────────
↑ ↓ Navigate   O Open   d Delete   r Refresh   q Quit

This provides a convenient way to manage your pastes without opening the PasteDB website.

✏️ Update a Paste

Overwrite an existing paste's content, language settings, and title with a local file.

pdb update abc123 app.py

Note: In the example, the abc123 is the pasteID which is to be updated and app.py is the file whose content will be replaced from the abc123.

🗑️ Delete a Paste

Remove a paste permanently from the server.

pdb delete abc123

Output:

Deleting abc123...
✓ Paste deleted.

🌎 Explore Public Pastes

Browse through trending and public feeds natively inside your terminal window.

pdb explore

👤 Account Details

Check your active profile data and current PasteDB user statistics.

pdb me

▶️ Run Code

Execute code snippets using PasteDB's remote code runtime engine.

pdb run <language> <file>

Examples:

pdb run python app.py
pdb run javascript app.js

🔍 Check Custom ID Availability

Verify if a specific vanity path string is available before publishing.

pdb check-id my-project

🔑 Manage API Keys

Create, audit, and revoke access keys for other environments.

pdb key create "my-laptop" # Create a key

pdb key list # List active keys

pdb key delete # Delete a key


📋 Quick Reference

| Command | Description | |---|---| | pdb auth | Authenticate the CLI with an API key | | pdb create | Create a new paste from a file | | pdb get | Fetch and display a paste | | pdb update | Update an existing paste | | pdb delete | Delete a paste permanently | | pdb explore | View public pastes | | pdb me | View profile and account info | | pdb run | Remotely execute code | | pdb check-id | Check if a custom ID is free | | pdb key create | Generate a new API credential | | pdb key list | Review all connected keys | | pdb key delete | Revoke an API token | | pdb help / -h | Show global help instructions | | pdb pastes | Interactively browse, open, refresh, and delete your pastes |


🔒 Security

  • Local credentials are saved with restricted file system permissions.
  • The local config path is locked to ~/.pastedb/config.json.
  • Important: Never commit your configuration directory or paste raw credentials into public repositories.

🛠️ Development

Get involved with development or build the package from source:

  1. Clone the repository:
git clone https://github.com/sorathiya903/pastedb-cli.git
  1. Navigate to the project root:
cd pastedb-cli
  1. Install the dependencies(if added in future):
npm install
  1. Run the CLI tool locally:
node main.js

📄 License

Distributed under the MIT License. See the LICENSE file for more details.