Skip to content
/ ngm Public

A modern TUI-based Node.js global packages manager that works across multiple Node version managers (fnm, nvm, n, and local installations).

License

Notifications You must be signed in to change notification settings

Way-To-AGI/ngm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

NGM - Node Global Packages Manager

Go Version License Build Status

A modern TUI-based Node.js global packages manager that works across multiple Node version managers (fnm, nvm, n, and local installations).

โœจ Features

  • ๐ŸŽฏ Multi-Manager Support: Works seamlessly with fnm, nvm, n, and local Node installations
  • ๐ŸŽจ Beautiful TUI: Modern terminal UI with mouse support, keyboard navigation, and intuitive focus management
  • ๐Ÿ“ฆ Package Management: List, update, uninstall global npm packages across different Node versions
  • ๐Ÿ”„ Automatic Refresh: Packages list automatically refreshes after updates/uninstalls
  • ๐ŸŒ Internationalization: Built-in support for English and Chinese (auto-detects system locale)
  • ๐Ÿ–ฑ๏ธ Mouse Support: Click to switch focus panels, scroll with mouse wheel
  • ๐Ÿ“Š Outdated Detection: Shows which packages need updates with version comparison
  • โšก Fast Search: Filter packages and Node versions instantly
  • ๐ŸŽญ IME Friendly: Handles Chinese input methods properly without interruption

๐Ÿš€ Quick Start

Installation

๐Ÿš€ Quick Install (Recommended)

curl -fsSL https://raw.githubusercontent.com/Way-To-AGI/ngm/main/install.sh | bash

๐Ÿ“ฆ Download Binary

Download the appropriate binary for your system from the Releases page:

Linux/macOS:

# Download and extract (example for Linux AMD64)
curl -L https://github.com/Way-To-AGI/ngm/releases/latest/download/ngm-linux-amd64.tar.gz | tar xz
sudo mv ngm /usr/local/bin/

Windows:

# Download and extract
Invoke-WebRequest -Uri "https://github.com/Way-To-AGI/ngm/releases/latest/download/ngm-windows-amd64.exe.zip" -OutFile "ngm.zip"
Expand-Archive -Path "ngm.zip" -DestinationPath "."

From Source

git clone https://github.com/Way-To-AGI/ngm.git
cd ngm
go build -o ngm ./cmd/ngm
sudo mv ngm /usr/local/bin/  # or add to your PATH

Requirements

  • Go 1.22 or later
  • Node.js with npm
  • One of the following Node version managers (optional):

Basic Usage

Launch TUI

ngm
# or with specific language
ngm --lang zh-CN  # Chinese
ngm --lang en     # English

CLI Commands

# List detected Node version managers and versions
ngm versions

# List global packages for current Node
ngm list

# List outdated packages
ngm outdated

# Update packages
ngm update package1 package2

# Uninstall packages
ngm uninstall package1

# Export/Import package lists
ngm export > packages.txt
ngm import < packages.txt

๐ŸŽฎ TUI Controls

Navigation

  • โ†/โ†’ or h/l: Switch focus between panels (Nodes/Packages/Outdated)
  • Tab: Cycle focus forward (Nodes โ†’ Packages โ†’ Outdated โ†’ Nodes)
  • Shift+Tab: Cycle focus backward
  • Mouse Click: Click on any panel to focus it
  • Mouse Wheel: Scroll within focused panel

Actions

  • Space: Select/deselect current package
  • a: Select/deselect all visible packages
  • u: Update selected packages
  • d: Uninstall selected packages (only in Packages panel)
  • r: Refresh package lists
  • /: Search/filter current list
  • Enter: Switch Node version (in Nodes panel)
  • q: Quit

๐Ÿ“– Screenshots

Main Interface

โฌก ngm  [nvm v20.18.1]

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ โ–ธ nvm              โ”‚ โ— Packages                  โ”‚ โ— Outdated                   โ”‚
โ”‚    โ— v20.18.1      โ”‚ [ ] @anthropic-ai/claude-codeโ”‚ [ ] @anthropic-ai/claude-codeโ”‚
โ”‚    v22.15.0        โ”‚ [ ] npm                      โ”‚   2.0.76 -> 2.0.77           โ”‚
โ”‚    v22.11.0        โ”‚ [ ] typescript               โ”‚ [ ] npm                       โ”‚
โ”‚    v18.20.5        โ”‚ [ ] yarn                     โ”‚   10.9.0 -> 10.9.1           โ”‚
โ”‚    v16.20.2        โ”‚ [x] eslint                  โ”‚ [ ] yarn                      โ”‚
โ”‚    v14.21.3        โ”‚ [x] prettier                 โ”‚   1.22.22 -> 1.22.23         โ”‚
โ”‚    v10.24.1        โ”‚ [ ] webpack                  โ”‚                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ โ— Logs                              โ”‚ โ— Details                     โ”‚
โ”‚ update: done                        โ”‚ @anthropic-ai/claude-code     โ”‚
โ”‚ loaded 32 packages                  โ”‚                               โ”‚
โ”‚ loaded 6 outdated                    โ”‚ Current: 2.0.76               โ”‚
โ”‚                                    โ”‚ Latest: 2.0.77                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โ†/โ†’ or h/l switch panel  tab cycle  / search  space select  a all  u update  d uninstall  r refresh  q quit

๐Ÿ”ง Configuration

NGM can be configured via ~/.config/ngm/config.yaml:

lang: auto                    # auto, zh-CN, en
max_concurrent_tasks: 3       # Max concurrent update/uninstall tasks
cache_ttl_seconds: 600        # Cache duration
cache_dir: ""                 # Custom cache directory (default: ~/.cache/ngm)

Environment Variables

  • NGM_LANG: Override language detection
  • NVM_DIR: nvm directory (default: ~/.nvm)

๐ŸŒ Internationalization

NGM supports multiple languages and automatically detects your system locale:

  • English (default)
  • Chinese (Simplified) - Auto-detected on macOS/Linux systems

You can override the language:

ngm --lang zh-CN  # Force Chinese
ngm --lang en     # Force English
export NGM_LANG=zh-CN  # Environment variable

๐Ÿ—๏ธ Architecture

ngm/
โ”œโ”€โ”€ cmd/ngm/           # CLI entry point
โ”œโ”€โ”€ internal/
โ”‚   โ”œโ”€โ”€ cli/           # CLI commands
โ”‚   โ”œโ”€โ”€ tui/           # Terminal UI
โ”‚   โ”œโ”€โ”€ npm/           # npm client
โ”‚   โ”œโ”€โ”€ runners/       # Node version managers (fnm, nvm, n, local)
โ”‚   โ”œโ”€โ”€ i18n/          # Internationalization
โ”‚   โ”œโ”€โ”€ config/        # Configuration management
โ”‚   โ”œโ”€โ”€ cache/         # Caching layer
โ”‚   โ””โ”€โ”€ task/          # Task scheduler
โ””โ”€โ”€ docs/              # Documentation

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Development Setup

git clone https://github.com/Way-To-AGI/ngm.git
cd ngm
go mod tidy
go build -o ngm ./cmd/ngm
./ngm

Running Tests

go test ./...

Code Style

  • Follow Go conventions
  • Use meaningful variable names
  • Add comments for public functions
  • Keep functions small and focused

๐Ÿ“ Roadmap

  • Package version locking
  • Bulk operations with progress bars
  • Package dependency visualization
  • Configuration GUI
  • Plugin system for custom runners
  • Package installation from specific registries
  • Global package audit and security scanning

๐Ÿ› Troubleshooting

Common Issues

"No Node versions found"

  • Ensure your Node version manager is installed and in PATH
  • For nvm, check that ~/.nvm/nvm.sh exists
  • Try running ngm versions to debug detection

"Permission denied"

  • Make sure ngm has permission to access npm global directories
  • On some systems, you may need to run with sudo for certain operations

Chinese input issues

  • NGM handles IME input automatically
  • If issues persist, try switching to English input mode

Debug Mode

Set environment variable for debug output:

NGM_DEBUG=1 ngm

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Bubble Tea - Amazing TUI framework
  • Lip Gloss - Style definitions
  • Cobra - CLI framework
  • Node.js community for the excellent package managers

๐Ÿ“ž Support


Made with โค๏ธ by Way-To-AGI

If you find this tool helpful, please give it a โญ on GitHub!

About

A modern TUI-based Node.js global packages manager that works across multiple Node version managers (fnm, nvm, n, and local installations).

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published