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

netshift

v0.1.2

Published

NetShift is a terminal-first API client and workflow tool designed for developers who love command-line efficiency. With formatted response styling, syntax highlighting, request retries, and comprehensive HTTP customizability, NetShift brings the power of

Readme

NetShift CLI 🚀

NetShift is a terminal-first API client and workflow tool designed for developers who love command-line efficiency. With formatted response styling, syntax highlighting, request retries, and comprehensive HTTP customizability, NetShift brings the power of graphical API clients directly to your terminal.


Features

  • HTTP Requests: Perform GET, POST, PUT, PATCH, DELETE, and other HTTP requests.
  • Request Configuration:
    • Headers: Multiple headers support using the -H / --header flags (e.g., -H "Content-Type: application/json").
    • Query Params: Append parameters cleanly via -Q / --query (e.g., -Q "page=2").
    • Payloads: Send JSON or text request bodies using -d / --data.
  • Resilience & Reliability:
    • Retries: Configurable automatic retry attempts with --retry.
    • Timeouts: Define request timeouts in seconds with --timeout.
  • Formatted & High-Contrast Visuals:
    • Metadata: Clean output of status codes, elapsed time, and download sizes.
    • Headers Display: Print response headers with --show-headers.
    • Syntax Highlighting: Pretty-prints and colors JSON and HTML response bodies.
    • Truncation Toggle: Toggle truncation of large outputs using --no-truncate.
  • Output Redirection: Directly pipe responses to files using --output <file>.
  • Diagnostics: Quick status checks via the ns ping command.

Installation

From npm (Global)

Install the CLI globally on your system:

npm i netshift -g

From Source (Local Development)

  1. Clone the repository and navigate to the cli directory:
    cd cli
  2. Install dependencies:
    npm install
  3. Build the project:
    npm run build
  4. Run locally:
    • Run in development mode: npm run dev -- <method> <url>
    • Run the compiled binary: node dist/index.js <method> <url>

Command Reference

ns ping

Checks if NetShift is installed correctly and running.

$ ns ping
NetShift is alive and ready to serve! 🚀

ns <method> <url> [options]

Executes an HTTP request with the specified method and target URL.

Arguments:

  • <method>: The HTTP method (e.g., get, post, put, delete).
  • <url>: The endpoint target. Automatic normalization and prefixing (e.g., automatically prepends http:// or https:// if omitted) will be applied.

Options:

| Flag | Description | Example | | :------------------------- | :------------------------------------------------------------------- | :------------------------------------ | | -H, --header <header...> | Add a custom header in "Key: Value" format (can be repeated). | -H "Authorization: Bearer my-token" | | -Q, --query <query> | Add a query parameter in "key=value" format (can be repeated). | -Q "search=term" | | -d, --data <data> | Provide a raw body payload (e.g., a JSON string) for request bodies. | -d '{"id": 42}' | | --show-headers | Print response headers. | --show-headers | | --timeout <timeout> | Set request timeout in seconds. | --timeout 5 | | --retry <retryCount> | Set number of retry attempts for failed requests. | --retry 3 | | --no-truncate | Prevent truncation of long responses in the console. | --no-truncate | | --output <file> | Save response body directly to a specified output file path. | --output response.json |


Examples

1. Basic GET Request

Fetch data and format output with syntax highlighting:

ns get https://jsonplaceholder.typicode.com/todos/1

2. POST Request with Headers and JSON Body

Send a POST request with authentication and JSON content:

ns post https://httpbin.org/post \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer secret-token" \
  -d '{"name": "NetShift CLI", "status": "active"}'

3. GET Request with Query Parameters

Append query parameters dynamically:

ns get https://httpbin.org/get -Q "filter=active" -Q "limit=10"

4. Downloading a Response to a File

Save response output directly to a file:

ns get https://jsonplaceholder.typicode.com/posts --output posts.json

5. Custom Timeout and Retry Configurations

Set a 5-second timeout and attempt a request up to 3 times on failure:

ns get https://api.slowendpoint.com/data --timeout 5 --retry 3

Project Structure & Internal Architecture

If you are developing or extending NetShift CLI, here is the directory layout:

  • src/cli/index.ts — CLI application entry point utilizing Commander.js.
  • src/cli/commands/request.ts — Logic defining flags, options, error handling, and output compilation.
  • src/services/ — Core modules for execution logic:
    • request-service.ts — Axiomatic requests, retries, and network timing logic.
    • error-formatter.ts, headers-formatter.ts, metadata-formatter.ts, response-formatter.ts — Terminal styling services using Chalk and CLI highlighter.
  • src/storage/paths.ts — Reserved for configuration, history, and workspace files (defaults to ~/.netshift/).

License

MIT