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

ghvars

v0.0.1

Published

Sync .env files and manage GitHub Actions secrets/variables

Readme

ghvars

Sync .env files and manage GitHub Actions secrets/variables from your .env.example template.

Features

  • Sync - Keep .env in sync with .env.example (add new vars, remove deprecated, preserve values)
  • Push - Push secrets and variables to GitHub Actions
  • Pull - Pull variables from GitHub to .env
  • Interactive - Select which items to push with a nice TUI

Installation

# In a Bun workspace
bun add ghvars

# Or install globally
bun add -g ghvars

Quick Start

# Run interactive menu
ghvars

# Or use specific commands
ghvars sync          # Sync .env with .env.example
ghvars push          # Push all secrets & variables to GitHub
ghvars pull          # Pull variables from GitHub

Configuration

Annotating Sections

ghvars reads your .env.example to determine which variables are secrets vs variables. Use annotations on section headers:

# =============================================================================
# SETTINGS @variables
# =============================================================================

APP_NAME="My App"
LOG_LEVEL="info"

# =============================================================================
# CREDENTIALS @secrets
# =============================================================================

API_KEY=""
DATABASE_URL=""

| Annotation | GitHub Target | Visibility | | ------------ | ---------------- | --------------- | | @secrets | GitHub Secrets | Hidden in logs | | @variables | GitHub Variables | Visible in logs | | (none) | Skipped | Not pushed |

Section Header Formats

These are recognized as section headers:

# === SECTION NAME ===           # Decorated with ===
# SECTION NAME                   # ALL CAPS standalone
# SECTION NAME (description)     # With parenthetical note
# SECTION NAME @secrets          # With annotation

These are NOT sections (just sub-headers/comments):

# --- Database ---               # Sub-header with ---
# Some lowercase comment         # Regular comment

Commands

ghvars (no args)

Interactive menu with all options:

? What would you like to do?
  🔄 Sync .env with .env.example
  ⬆️  Push all secrets & variables to GitHub
  🎯 Push selected items (interactive)
  ⬇️  Pull variables from GitHub

ghvars sync

Syncs .env with .env.example:

  • Adds new variables from template
  • Removes deprecated variables not in template
  • Preserves existing values
  • Updates structure (comments, sections, annotations)
ghvars sync

# Output:
# 📋 .env.example has 33 variables
#    (10 secrets, 23 variables)
#
# ✓ Added 2 new variable(s):
#    + NEW_VAR_1
#    + NEW_VAR_2
#
# 📝 Updated .env
#    31 preserved, 2 added, 0 removed

ghvars push

Push secrets and variables to GitHub Actions.

ghvars push              # Push all
ghvars push -i           # Interactive selection
ghvars push -s           # Secrets only
ghvars push -v           # Variables only

Requires GitHub CLI (gh) to be installed and authenticated.

ghvars pull

Pull variables from GitHub to .env.

ghvars pull

Note: Secrets cannot be pulled (GitHub security restriction).

ghvars init

Create a template .env.example file:

ghvars init

Example .env.example

# =============================================================================
# My App Configuration
# =============================================================================
# Use annotations on section headers:
#   @secrets   → pushed as GitHub Secrets (hidden)
#   @variables → pushed as GitHub Variables (visible)

# =============================================================================
# GENERAL @variables
# =============================================================================

APP_NAME="My App"
APP_ENV="development"
LOG_LEVEL="info"

# =============================================================================
# CREDENTIALS @secrets
# =============================================================================

# --- Database ---
DATABASE_URL=""

# --- API Keys ---
API_KEY=""
API_SECRET=""

# =============================================================================
# DEBUG @variables
# =============================================================================

DEBUG="false"

Requirements

License

MIT