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

@kud/gpuswitch-cli

v0.1.0

Published

Switch between integrated, discrete, and auto GPU on Intel Macs via pmset

Readme

 ██████╗ ██████╗ ██╗   ██╗
██╔════╝ ██╔══██╗██║   ██║
██║  ███╗██████╔╝██║   ██║
██║   ██║██╔═══╝ ██║   ██║
╚██████╔╝██║     ╚██████╔╝
 ╚═════╝ ╚═╝      ╚═════╝

███████╗██╗    ██╗██╗████████╗ ██████╗██╗  ██╗
██╔════╝██║    ██║██║╚══██╔══╝██╔════╝██║  ██║
███████╗██║ █╗ ██║██║   ██║   ██║     ███████║
╚════██║██║███╗██║██║   ██║   ██║     ██╔══██║
███████║╚███╔███╔╝██║   ██║   ╚██████╗██║  ██║
╚══════╝ ╚══╝╚══╝ ╚═╝   ╚═╝    ╚═════╝╚═╝  ╚═╝

TypeScript Node.js npm Licence

Switch between integrated, discrete, and auto GPU on Intel Macs via pmset

FeaturesQuick StartCLI ReferenceDevelopment


🌟 Features

  • 🖥 Integrated GPU Mode — force the Intel iGPU for maximum battery life on long unplugged sessions
  • Discrete GPU Mode — activate the dedicated dGPU for full graphics performance when you need it
  • 🤖 Auto Mode — restore macOS default behaviour, letting the system switch GPUs dynamically
  • 🎨 Interactive TUI — arrow-key picker built with Ink/React, shows your current mode at a glance
  • 🔋 Headless Subcommands — scriptable integrated|discrete|auto|status for shell scripts and Raycast
  • 🛠 Zero Config — thin wrapper around pmset, no daemons, no background processes, no setup
  • 📦 Typed & Modern — strict TypeScript, ESM-only, built with tsup

🚀 Quick Start

Prerequisites

  • Node.js 20+
  • macOS on an Intel Mac with both integrated and discrete GPU (e.g. MacBook Pro 2019 or earlier)

1. Install

npm install -g @kud/gpuswitch-cli

2. Use it

# Interactive TUI — pick a mode with arrow keys
gpuswitch

# Or go straight to a mode
gpuswitch integrated   # save battery
gpuswitch discrete     # full power
gpuswitch auto         # let macOS decide
gpuswitch status       # see what's active

Switching GPU mode requires sudo — you will be prompted for your password.


📖 CLI Reference

| Command | Description | | ---------------------- | -------------------------------------- | | gpuswitch | Open interactive TUI mode (↑↓ + enter) | | gpuswitch integrated | Switch to integrated GPU only | | gpuswitch discrete | Switch to discrete GPU only | | gpuswitch auto | Let macOS manage GPU switching | | gpuswitch status | Print the current GPU mode | | gpuswitch --help | Show usage |


🔧 Development

Project Structure

gpuswitch-cli/
├── src/
│   ├── gpu.ts        ← pmset read/write logic
│   ├── app.tsx       ← Ink interactive TUI
│   └── index.tsx     ← entry point (headless or TUI)
├── dist/
├── package.json
├── tsconfig.json
└── eslint.config.js

Scripts

| Script | Description | | --------------------- | ----------------------------- | | npm run dev | Run from source with tsx | | npm run build | Compile TypeScript to dist/ | | npm run build:watch | Watch mode with auto-rebuild | | npm run typecheck | Type-check without emitting | | npm run lint | Run ESLint | | npm run format | Format with Prettier |

Workflow

git clone https://github.com/kud/gpuswitch-cli.git
cd gpuswitch-cli
npm install
npm run build
node dist/index.js

🏗 Tech Stack

| Component | Details | | ----------- | -------------------------- | | Runtime | Node.js ≥ 20 | | Language | TypeScript 5.x (ESM) | | TUI | Ink 7.x + React 19 | | Build | tsup | | Linting | ESLint + Prettier | | GPU control | pmset (macOS built-in) | | Package | npm · @kud/gpuswitch-cli |


MIT © kud — Made with ❤️ for Intel Mac users

⭐ Star this repo if it saves your battery · ↑ Back to top