sheenv
v1.1.0
Published
<p align="center"> <img src="./public/sheenv.png" alt="sheenv"> </p>
Downloads
416
Readme
sheenv
CLI tool for managing environment variables using Google Sheets.
Installation
npm install -g sheenv
Prerequisites
Before using sheenv, you need to:
- Create a project in Google Cloud Console
- Enable the following APIs:
- Google Sheets API
- Google Drive API
- Create OAuth 2.0 credentials (Client ID & Client Secret)
- Set up your Google Sheet with environment variables
Usage
Workspace Management
Workspaces help you organize different Google Sheets configurations.
# Create a new workspace
sheenv workspace add
# Export workspace configuration
sheenv workspace export
# Import workspace configuration
sheenv workspace import
Profile Management
Profiles allow you to manage different environment variable sets within a workspace.
# Add new profile to a workspace
sheenv profile add
Example profile structure:
workspace
└── profiles
├── .env.local
├── .env.dev
└── .env.prod
Environment Variables
# Pull environment variables from Google Sheets
sheenv env pull
# Push local environment variables to Google Sheets
sheenv env push
Command Details
workspace add
- Prompts for Google OAuth credentials
- Authenticates with Google
- Shows list of available Google Sheets
- Creates a workspace with selected sheet
workspace export
- Exports workspace configuration to Desktop
- Includes:
- Sheet ID
- OAuth credentials
- Profiles
workspace import
- Imports workspace configuration from a JSON file
- Restores all profiles and settings
profile add
- Select a workspace
- Authenticate with Google
- Select a sheet from the spreadsheet
- Configure range for environment variables
- Creates a new profile
env pull
- Select a workspace
- Select a profile
- Pulls environment variables from configured sheet
- Creates .env file with the variables
File Structure
Environment files are stored in:
~/.config/sheenv/
└── workspaces/
└── [workspace-name].json