Skip to content

aliasgarsogiawala/storemyapi-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StoreMyAPI CLI

A command-line tool to sync your .env keys to the cloud and share them across machines and teammates.

Installation

npm install -g storemyapi

Getting started

storemyapi login
storemyapi init
storemyapi push

That's it. Your keys are in the cloud. On another machine, run storemyapi pull and you're back in business.

Commands

login

Opens a browser to authenticate. If that's not possible, use --no-browser and follow the instructions in the terminal.

storemyapi login
storemyapi login --no-browser

whoami

Shows who you're currently logged in as.

logout

Clears your local session.

projects

Lists all your projects with their key counts and roles.

init

Creates a new project and links it to your current folder. Writes a .storemyapi.json file locally.

link

Links an existing project to your current folder. Pass a name or ID directly, or pick from a list. If a project is already linked, it will ask before switching.

storemyapi link
storemyapi link my-project
storemyapi link <project-id>

push

Pushes keys from your local env file to the project. Pushes everything by default, or a single key if specified.

Auto-detection: looks for .env.local first, then falls back to .env. Use -f to target a specific file.

storemyapi push
storemyapi push API_KEY
storemyapi push -f .env.local
storemyapi push -f .env.production

pull

Pulls keys from the project into your local env file. Merges with what's already there.

Auto-detection: pulls into .env.local if it exists, otherwise .env. Use -f to target a specific file.

storemyapi pull
storemyapi pull API_KEY
storemyapi pull -f .env.local
storemyapi pull -f .env.staging

key

Work with individual keys directly — no env file involved.

storemyapi key list
storemyapi key get API_KEY
storemyapi key set API_KEY somevalue
storemyapi key delete API_KEY

key set will ask for confirmation before overwriting an existing key.

share

Collaborate with teammates on a project.

As the owner:

storemyapi share add teammate@example.com read
storemyapi share add teammate@example.com write
storemyapi share remove teammate@example.com
storemyapi share list

As the receiver:

storemyapi share invites

Lists your pending invites as a dropdown. Select one and you'll be asked to accept or decline on the spot. After accepting, run storemyapi link to connect the project to a local folder.

doctor

Checks your setup end to end — Node version, auth, API connectivity, linked project, and whether a local env file exists. Good first step when something feels off.

storemyapi doctor

audit

Compares your local env file against the cloud and shows what's out of sync. Tells you exactly what to run to fix it.

Auto-detection: checks .env.local first, then .env. Use -f to target a specific file.

storemyapi audit
storemyapi audit -f .env.local

Reports three things:

  • Keys in the cloud that are missing from your local file
  • Keys in your local file that haven't been pushed to the cloud
  • Keys that exist on both sides but have different values

vercel deploy — [BETA]

Note: This command is still under active development and may not work as expected in all cases. Use with caution in production environments.

Pushes your CLI-encrypted keys directly to a Vercel project as environment variables. Browser-encrypted keys cannot be deployed via the CLI — use the web dashboard for those.

storemyapi vercel deploy
storemyapi vercel deploy --token <vercel-token> --project <project-id>
storemyapi vercel deploy --token <vercel-token> --project <project-id> --team <team-id>
storemyapi vercel deploy --target production
storemyapi vercel deploy -k API_KEY -k STRIPE_SECRET_KEY

Options:

Flag Description
-t, --token Your Vercel API token
-p, --project Vercel project ID
--team Vercel team ID (optional, for team projects)
--target Environment target: production, preview, or development (default: production)
-k, --key Key name to deploy (repeatable). Omit to deploy all CLI-encrypted keys
-y, --yes Skip confirmation prompt

Your Vercel token is never stored — it is used only for the duration of the request.

Files

  • ~/.storemyapi/config.json — stores your auth token. Never commit this.
  • .storemyapi.json — links your folder to a project. Gitignored by default.
  • .env / .env.local — where pulled keys land and pushed keys are read from.

Requirements

Node.js 18 or higher.