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

nitor

v1.4.2

Published

A comprehensive CLI toolkit for automating GitLab operations, AI-powered code review, build/deploy automation, MongoDB backup/restore, and developer productivity tools

Readme

nitor

A CLI utility toolkit for automating and managing build, deploy, and status operations for projects, AI code review, AI text refactor and related components.

Features

  • Build and deploy Gitlab project
  • Check build and deployment status
  • Utility functions for parameter parsing and object cleaning
  • Extensible and scriptable for automation
  • Create git branch
  • AI Review merge request
  • AI text refactoring
  • Backup and restore MongoDB
  • Merge git branches
  • Cleanup local git branches
  • Time entry management with Zoho integration
  • GitLab activity tracking
  • Task statistics with merge request details
  • Extract Zoho task IDs from GitLab issue descriptions
  • Merge request status tracking for active tasks

Requirements

  • Node.js >= 14.x
  • npm >= 6.x
  • A properly configured .env.nu file in your ~/Desktop directory with required tokens and URLs:
    • CSRF_TOKEN - CSRF token for Gitlab (Copy from browser)
    • COOKIE - Cookie for Gitlab (Copy from browser)
    • GITLAB_URI - GitLab API URL, eg: https://gitlab.com/
    • GITLAB_TOKEN - Gitlab token
    • GITLAB_DEFAULT_PROJECT_ID - Default GitLab project ID for issue lookups
    • MR_PROMPT - Merge request prompt
    • MR_LANG - Merge request language
    • AI_API_KEY - AI API key
    • AI_MODEL - AI model
    • BACKUP_CONFIG - Backup configuration
    • RESTORE_CONFIG - Restore configuration
    • ZOHO_COOKIE - Zoho cookie for authentication
    • ZOHO_CUSTOMVIEW_ID - Zoho custom view ID
    • ZOHO_DEFAULT_PROJECT_ID - Default Zoho project ID
    • ZOHO_PORTAL_ID - Zoho portal ID
    • ZOHO_PROJECTS - Zoho projects configuration
    • ZOHO_SESSION_ID - Zoho session ID
    • ZOHO_SOURCE - Zoho source
    • ZOHO_TEAM - Zoho team ID
    • ZOHO_TOKEN - Zoho CSRF token
    • ZOHO_URI - Zoho API URL
    • ZOHO_USERID - Zoho user ID

Installation

After installing the package globally, you can enable autocomplete:

nitor completion

This will add autocomplete support to your shell. Restart your terminal or run:

source ~/.bashrc  # for bash
source ~/.zshrc   # for zsh

Usage

You can use the CLI via the nitor command:

nitor <command> [options]

Autocomplete

Once enabled, you can use Tab to autocomplete:

  • Commands (build, deploy, cleanup, etc.)
  • Options (-project, -components, etc.)
  • Values (portal, gateway, dev, qa, etc.)

Example Commands

  • Build:

    nitor build -project <project name> -components <component name> -instance <instance name>
  • Deploy:

    nitor deploy -project <project name> -components <component name> -instance <instance name>
  • Build & Deploy:

    nitor build-deploy -project <project name> -components <component name> -instance <instance name>
  • Create branch:

    nitor create-branch -task <task number> -type <feat|fix> -description <description> -repository <repository name>
  • Review:

    nitor review -project <project short name> -mergeId <merge id> -repository <repository name>
  • Refactor Text:

    nitor refactor <text>
  • MongoDB Backup & Restore:

    # Backup from Kubernetes pods and restore to local MongoDB
    nitor backup
    
    # Backup specific projects only
    nitor backup -project <project1> <project2>
    
    # Restore to Docker container (default: local MongoDB)
    nitor backup -docker <boolean>
  • Merge:

    nitor merge -source <source branch> -target <target branch>
  • Cleanup:

    nitor cleanup
  • Time Entry - Initialize:

    nitor time-init
  • Time Entry - Add:

    nitor time-add -project <project name> -sprint <sprint name> -task <task id> -date <YYYY-MM-DD> -work <work description> -duration <minutes> -remarks <remarks>
  • Time Entry - Update:

    nitor time-update -id <entry id> -task <task id> -work <work description> -duration <minutes> -remarks <remarks> -date <YYYY-MM-DD>
  • Time Entry - Delete:

    nitor time-delete -id <entry id> -date <YYYY-MM-DD>
  • Time Entry - View Entries:

    nitor time-entries -from <YYYY-MM-DD> -to <YYYY-MM-DD>
  • Time Entry - View Stats:

    nitor time-stats -from <YYYY-MM-DD> -to <YYYY-MM-DD>
  • Time Entry - Sync to Zoho:

    nitor time-zoho
  • Time Entry - GitLab Activities:

    nitor time-gitlab -from <YYYY-MM-DD> -to <YYYY-MM-DD>
  • Time Entry - Merge Request Status:

    nitor time-merge
  • Time Entry - Switch Project:

    nitor time-switch
  • Task Stats:

    nitor task-stats -task <task numbers with space>
  • Get Task (Extract Zoho Task IDs):

    nitor get-task -task <task numbers with space>

Command Reference

  • build : Build specified components
  • deploy : Deploy specified components
  • build-deploy : Build and then deploy
  • version : Show version info
  • help : Show help
  • init : Initialize configuration
  • create-branch : Create git branch
  • review : AI review specified merge request
  • refactor : AI refactor specified text
  • backup : Backup MongoDB databases from Kubernetes pods and restore to local/Docker
  • merge : Merge source branch into target branch
  • cleanup : Cleanup local git branches (checkout to master and delete all other branches)
  • time-init : Initialize time entry configuration
  • time-add : Add time entry with support for multiple tags
  • time-update : Update existing time entry
  • time-delete : Delete time entry
  • time-entries : View time entries by date range
  • time-stats : View daily statistics of time entries
  • time-zoho : Sync time entries to Zoho
  • time-gitlab : Get GitLab activities for a date range
  • time-merge : View merge request status for active tasks
  • time-switch : Switch between default projects
  • task-stats : View task statistics with GitLab merge request details
  • get-task : Extract Zoho task IDs from GitLab issue descriptions

MongoDB Backup & Restore

Overview

The MongoDB backup service provides automated backup and restore functionality for MongoDB databases running in Kubernetes pods. It supports:

  • ✅ Backup from Kubernetes pods using kubectl
  • ✅ Restore to Docker containers or local MongoDB instances
  • ✅ Cross-platform support (Windows, macOS, Linux)
  • ✅ Multi-project configuration
  • ✅ Automatic cleanup of temporary files
  • ✅ Error handling with detailed logging

Configuration

Configure your backup settings in the .env.nu file using JSON format:

BACKUP_CONFIG

Defines the source databases to backup from Kubernetes pods:

BACKUP_CONFIG={
  "project1": [
    {
      "pod": "mongodb-pod-name",
      "username": "admin",
      "password": "password123",
      "database": "mydb",
      "backupPath": "/data/backup",
      "localBackupPath": "~/backups/mongo"
    }
  ],
  "project2": [
    {
      "pod": "another-pod",
      "username": "dbuser",
      "password": "dbpass",
      "database": "anotherdb"
    }
  ]
}

Configuration Options:

  • pod (required): Name of the Kubernetes pod
  • username (required): MongoDB username
  • password (required): MongoDB password
  • database (required): Database name
  • backupPath (optional): Path inside pod for temporary backup (default: /data/backup)
  • localBackupPath (optional): Local path to store backups (default: ~/backups/mongo)

RESTORE_CONFIG

Defines where to restore the backup:

RESTORE_CONFIG={
  "mongoInDocker": false,
  "containerName": "mongodb",
  "localBackupPath": "~/backups/mongo",
  "containerBackupPath": "/data/backup"
}

Configuration Options:

  • mongoInDocker (optional): Set to true to restore to Docker container, false for local MongoDB (can be overridden with -docker flag)
  • containerName (optional): Docker container name (default: mongodb)
  • localBackupPath (optional): Path where backup is stored (default: ~/backups/mongo)
  • containerBackupPath (optional): Path inside container for temporary files (default: /data/backup)

How It Works

  1. Backup Phase:

    • Executes mongodump inside the Kubernetes pod
    • Copies backup files to your local machine using kubectl cp
    • Cleans up temporary files from the pod
    • Saves to ~/backups/mongo/<database-name> by default
  2. Restore Phase:

    • Docker Mode (-docker flag):
      • Copies backup from local machine to Docker container
      • Executes mongorestore --drop inside the container
      • Cleans up temporary files from container
    • Local Mode (default):
      • Executes mongorestore --drop directly on local machine
      • Connects to mongodb://localhost:27017/

Usage Examples

Backup all configured projects:

nitor backup

Backup specific projects:

nitor backup -project project1 project2

Backup and restore to Docker container:

nitor backup -docker

Prerequisites

  • For Backup: kubectl configured with access to your Kubernetes cluster
  • For Restore (Docker): Docker running with MongoDB container
  • For Restore (Local): MongoDB installed and running locally on port 27017
  • MongoDB tools (mongodump, mongorestore) must be available in the pod/container

Cross-Platform Support

The backup service is designed to work on Windows, macOS, and Linux:

  • Automatically detects the operating system
  • Uses appropriate shell (cmd.exe on Windows, /bin/sh on Unix)
  • Handles path normalization across platforms
  • Adjusts command flags for Windows compatibility (e.g., removes -it flags)

Error Handling

  • Non-zero exit codes from mongorestore are treated as warnings (common with duplicate keys)
  • Detailed error messages with color-coded output
  • Continues processing remaining projects even if one fails
  • Cleanup operations run even if restore encounters errors

Options

  • -project or -p : Project name (portal, gateway, phr)
  • -components or -c : Components (client, backend, etc.)
  • -instance or -i : Instance/environment (dev, qa, pilot)
  • -branch or -b : Git branch (optional)
  • -task or -t : Task number
  • -type or -ty : Type (feat, fix)
  • -description or -d : Description
  • -repository or -r : Repository name
  • -mergeId or -mId : Merge ID
  • -source or -so : Source branch name
  • -target or -ta : Target branch name

Time Entry Options

  • -project or -p : Project name
  • -sprint or -s : Sprint name (e.g., "sprint 1")
  • -task or -t : Task ID
  • -date or -dt : Date in YYYY-MM-DD format
  • -work or -w : Work description (supports multiple tags)
  • -duration or -du : Duration in minutes
  • -remarks or -r : Additional remarks
  • -id or -i : Entry ID (for update/delete operations)
  • -from or -f : Start date for filtering
  • -to or -t : End date for filtering

License

ISC

Author

Nithin V ([email protected])