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

dino-env-cli

v1.0.4

Published

CLI tool to switch between development and production environment files

Readme

🦕 Dino Environment CLI

A simple CLI tool to quickly switch between development and production environment files with flexible configuration options.

Installation

Local Installation

npm install
npm link

Global Installation (if publishing to npm)

npm install -g dino-env-cli

Usage

The CLI supports two modes: Configuration-based (recommended) and Direct command mode.

Configuration-based Mode (Recommended)

Create a dino-env.config.js file in your project root:

module.exports = {
  environments: {
    prod: {
      src: 'E:/dinocollab/private/partner-admin-site/.env.production',
      dest: '.env'
    },
    dev: {
      src: 'E:/dinocollab/private/partner-admin-site/.env.development',
      dest: '.env'
    },
    test: {
      src: 'E:/dinocollab/private/partner-admin-site/.env.test',
      dest: '.env'
    }
  }
}

Then use simple commands:

# Switch to development environment
dino-env-cli dev

# Switch to production environment
dino-env-cli prod

# Switch to test environment
dino-env-cli test

Direct Command Mode

Use flags to specify files directly:

# Copy with source flag
dino-env-cli --src ./config/.env.production

# Copy with custom destination
dino-env-cli --src ./config/.env.production --dest ./.env.local

# Use custom config file
dino-env-cli dev --config ./custom-config.js

Legacy Mode

For backward compatibility, the tool also supports default file names:

# Looks for .env.development.cli in current directory
dino-env-cli dev

# Looks for .env.production.cli in current directory  
dino-env-cli prod

Command Syntax

dino-env-cli <env-name>                          # Use environment from config file
dino-env-cli --src <file> [--dest <file>]        # Direct file copy
dino-env-cli <command> --config <path>           # Use custom config file

Arguments and Options

| Argument/Option | Description | |----------------|-------------| | <env-name> | Environment name from config (dev, prod, test, etc) | | --src <file> | Source file path | | --dest <file> | Destination file path (default: .env) | | --config <path> | Path to config file (default: ./dino-env.config.js) | | help | Show help information |

Configuration File

The dino-env.config.js file structure:

module.exports = {
  environments: {
    // Environment name: configuration
    prod: { 
      src: "path/to/production.env", 
      dest: ".env" 
    },
    dev: { 
      src: "path/to/development.env", 
      dest: ".env" 
    },
    test: { 
      src: "path/to/test.env", 
      dest: ".env" 
    }
    // Add more environments as needed
  }
}

Examples

Using Configuration File

# Create config file
$ cat > dino-env.config.js << EOF
module.exports = {
  environments: {
    dev: { src: './configs/.env.dev', dest: '.env' },
    prod: { src: './configs/.env.prod', dest: '.env' }
  }
}
EOF

# Switch environments
$ dino-env-cli dev
🚀 Using 'dev' environment from config file...
✅ Copied ./configs/.env.dev → .env

$ dino-env-cli prod  
🚀 Using 'prod' environment from config file...
✅ Copied ./configs/.env.prod → .env

Using Direct Commands

# Direct file copy
$ dino-env-cli --src ./configs/.env.production
🚀 Copying environment file...
✅ Copied ./configs/.env.production → .env

# Custom destination
$ dino-env-cli --src ./configs/.env.dev --dest ./.env.local
🚀 Copying environment file...
✅ Copied ./configs/.env.dev → ./.env.local

Integration with package.json

Simplify your npm scripts:

{
  "scripts": {
    "env:dev": "dino-env-cli dev",
    "env:prod": "dino-env-cli prod",
    "env:test": "dino-env-cli test"
  }
}

Benefits

  • Centralized Configuration: All environment paths in one config file
  • Simple Commands: Just dino-env-cli dev instead of long file paths
  • Flexible: Supports both config-based and direct command modes
  • Backward Compatible: Works with existing setups using default file names
  • Cross-platform: Works on Windows, macOS, and Linux