JSPM

@vasudevshetty/safekey

1.2.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 10
  • Score
    100M100P100Q34157F
  • License MIT

πŸ›‘οΈ SafeKey: Secure Secrets Manager CLI - Offline-first, developer-friendly secrets management with team collaboration and cloud sync

Package Exports

  • @vasudevshetty/safekey
  • @vasudevshetty/safekey/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@vasudevshetty/safekey) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

πŸ›‘οΈ SafeKey: Secure Secrets Manager CLI

SafeKey is an offline-first, developer-friendly secrets manager CLI. Built in TypeScript, it supports advanced encryption, config injection, and a powerful extensible architecture. It is inspired by the Go-based prototype, but enhanced with modern Node.js and developer tooling.

Think of it as the "Vault meets Dotenv" β€” with CLI, TUI, and Web Dashboard phases.


βœ… 1. Product Design Philosophy

πŸ“¦ CLI (Must-Have – Phase 1)

  • Why: Devs and DevOps engineers love fast, scriptable tools.
  • Built With: TypeScript + commander.js (or oclif) + ESM support.
  • Usage: safekey init, safekey add <key>, safekey get <key>, safekey inject

πŸ–₯️ TUI (Nice-to-Have – Phase 2)

  • Why: Friendly dashboard for non-terminal folks.
  • Built With: Ink (React-like CLI UIs).
  • Features: Browse vault, edit secrets, copy to clipboard.

🌐 Web Dashboard (Optional – Phase 3+)

  • Why: Visualize vault, sync across systems.
  • Built With: Next.js 15, TailwindCSS, shadcn/ui, and optionally wrapped in Electron.

🧱 2. Architecture Overview (Clean + Scalable)

safekey/
β”œβ”€β”€ bin/                 # CLI entry (compiled JS files here)
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ cli/             # CLI commands
β”‚   β”‚   β”œβ”€β”€ init.ts
β”‚   β”‚   β”œβ”€β”€ add.ts
β”‚   β”‚   β”œβ”€β”€ get.ts
β”‚   β”‚   β”œβ”€β”€ inject.ts
β”‚   β”‚   └── utils.ts
β”‚   β”œβ”€β”€ tui/             # Ink-based terminal UI (optional)
β”‚   β”‚   └── App.tsx
β”‚   β”œβ”€β”€ core/            # Vault + secrets management
β”‚   β”‚   β”œβ”€β”€ index.ts
β”‚   β”‚   β”œβ”€β”€ vault.ts
β”‚   β”‚   β”œβ”€β”€ secrets.ts
β”‚   β”‚   └── store.ts
β”‚   β”œβ”€β”€ crypto/          # AES/GPG encryption utilities
β”‚   β”‚   β”œβ”€β”€ aes.ts
β”‚   β”‚   β”œβ”€β”€ gpg.ts
β”‚   β”‚   └── utils.ts
β”‚   β”œβ”€β”€ config/          # User config profiles
β”‚   β”‚   └── config.ts
β”‚   └── index.ts         # Main CLI entrypoint
β”œβ”€β”€ tests/
β”‚   └── vault.test.ts
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
└── README.md

βš™οΈ 3. Tech Stack & Tools

Area Stack/Library Reason
CLI Framework commander.js or oclif Structured CLI with help docs
Module Format type: module (ESM) + .mts files Future-proof, cleaner syntax
Packaging pkg, nexe, or esbuild Create native binaries
TUI Ink, React, ink-select-input Interactive terminal UI
Encryption Node.js crypto module AES-256-GCM, secure randoms
File Ops fs/promises, path, os Vault I/O and config loading
Config Store conf, cosmiconfig, or custom JSON Persistent config management
Formats Supported JSON, YAML, TOML via js-yaml Interop and export/import
Secrets Injection dotenv, child_process, .env Auto inject to env or command
Web UI Next.js 15, Tailwind, shadcn/ui Web management panel
State Mgmt (Web) Zustand, Redux Web vault syncing
Testing vitest, jest Unit + integration tests
Linting & Format eslint, prettier Dev quality & consistency
Security Audits snyk, npm audit, node-sec-check Safe dep check

πŸ“… 4. Feature Roadmap (By Phase)

πŸš€ Phase 1: CLI Core MVP

  • safekey init – initializes an AES-256 encrypted vault (JSON-backed).
  • safekey add <key> / get <key> / rm <key> – CRUD secrets.
  • safekey list – view all keys.
  • safekey export / import – move vault across machines.
  • .env generator from stored secrets.
  • ~/.safekeyrc.json for config profiles.
  • AES-GCM for confidentiality + integrity.
  • Versioning support for vault entries.

πŸ–₯️ Phase 2: Optional TUI

  • Ink-based terminal interface with panels and navigation.
  • Display secrets, profiles, and vault metadata.
  • Copy to clipboard, toggle reveal/hide secrets.

πŸ” Phase 3: Inject Secrets into Shell/Commands

  • safekey inject -- <cmd>:
    • Inject stored secrets as env vars.
    • Automatically wrap any npm run, python, etc.
    • Output .env file or execute inline with process.env.

🌍 Phase 4: Vault Sync & GitOps (Optional)

  • safekey push: Encrypt + commit vault to Git repo (GPG/AES).
  • safekey pull: Decrypt remote vault + restore.
  • GitHub/GitLab integration for secrets-as-code workflows.

πŸ§‘β€πŸ’» Phase 5: Web Dashboard

  • Built with Next.js 15 + Tailwind CSS + Zustand.
  • View/edit vault from local or synced file.
  • Optional: Electron desktop wrapper.
  • Secure local access with vault password (no cloud).

πŸ“ 5. Modular Folder Structure (Scalable)

Everything is TypeScript + ESM (type: module in package.json).

safekey/
β”œβ”€β”€ bin/                 β†’ Compiled binaries
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ cli/             β†’ All command line logic
β”‚   β”œβ”€β”€ core/            β†’ Vault core encryption logic
β”‚   β”œβ”€β”€ crypto/          β†’ AES + GPG handling
β”‚   β”œβ”€β”€ tui/             β†’ Optional Ink-based terminal UI
β”‚   β”œβ”€β”€ config/          β†’ Profile & vault config parsing
β”‚   └── index.ts         β†’ Entrypoint
β”œβ”€β”€ tests/               β†’ Unit + integration tests
β”œβ”€β”€ package.json         β†’ Scripts + dependencies
β”œβ”€β”€ tsconfig.json        β†’ ESM + strict TS options
└── README.md

πŸŽ“ 6. Skills You’ll Master Along the Way

Area Skills
TypeScript Advanced types, module systems (ESM)
CLI Dev Commander/Oclif, Ink (TUI)
Cryptography AES, GPG, nonce, IV, secure randomness
File Systems Cross-platform, os.homedir(), etc.
Testing vitest, mocking fs, vault logic
Config Mgmt JSON schemas, validation, profiles
Web Dev (Later) TailwindCSS, Zustand, UI UX
Security Permissions, vault integrity checks
DevOps Ready NPM packaging, CLI release, CI/CD
OSS Publishing GitHub actions, releases, README

🧠 Next Steps to Start:

  1. πŸ”§ Setup basic ESM Node.js CLI (commander.js + tsconfig.json)
  2. πŸ” Implement vault.ts using AES-GCM encryption
  3. πŸ’Ύ Add file storage support (versioned JSON in ~/.safekey-vault.json)
  4. βœ… Build core commands: init, add, get, list
  5. πŸ§ͺ Add unit tests with vitest
  6. πŸ–₯️ (Optional): Start building TUI in Ink after CLI is stable
  7. πŸš€ Package with pkg or nexe, publish to GitHub/NPM

Let me know when you’re ready to build the first file!