Catalog npm
Back to packageRELEASE DETAILS

1.0.5

npm

1password-dot-env-sync

Sync secrets between .env and 1Password vault

.env1 password1password1password .env sync1password dot env syncdotenvenvone passwordonepasswordsecretssync
Published13 Aug 2024
Direct dependencies13
Transitive dependenciesNot calculated

README

Current package documentation

1password .dot env sync

npm version

Overview

1password-dot-env-sync is a command-line tool that synchronizes secrets between .env files and 1Password vaults. This tool allows you to keep your environment variables secure by leveraging 1Password's vault management and syncing capabilities.

Features

  • Sync Secrets: Easily sync your .env files with 1Password vaults, ensuring all secrets are stored securely.
  • 1Password SDK Integration: Utilizes the official 1Password SDK to interact with vaults.
  • CLI Commands: Intuitive command-line interface for syncing and managing your secrets.
  • Modular Management: Handles the configuration, environment, and 1Password interactions in a modular way.

Roadmap

  1. Support for Multiple .env Files:

    • Future releases will support syncing across multiple environment files (e.g., local, prod, dev).
  2. Support sub directory .env files:

    • Future releases will support the ability to sync .env files that are in subdirectories within the project root.
  3. Vault Creation:

    • When the 1Password SDK supports it, we will add the ability to create new vaults directly from the CLI.
  4. Extended CLI Commands with Flags:

    • We plan to extend the CLI with more commands and flags to enhance the flexibility and usability of the tool.

Getting Started - Local Development

Prerequisites

  • Node.js (version >= 18.0.0)
  • NPM or Yarn

Installation

Clone the repository and navigate to the project directory:

git clone https://github.com/yourusername/1password-env-sync.git
cd 1password-env-sync

Install the dependencies:

npm install

Local Development Setup

To start developing or modifying the tool locally, follow these steps:

  1. Build the Project: Compile the TypeScript files.

    npm run build
    
  2. Watch for Changes: Automatically rebuild the project when files change.

    npm run watch
    
  3. Start the Application: Run the CLI tool.

    npm start
    

Usage

To start using the tool and to sync your .env file with a 1Password vault, simply run the following command:

npx 1password-env-sync init

This will initiate the setup of the tool and prompt you to configure the 1Password service account connection (if you don't know how to create 1password token you can find the instructions on the following Link).

After the setup is complete, you can sync your .env file with the 1Password vault by running:

npx 1password-env-sync sync

This will read the default .env file in the root directory and sync the variables with the specified 1Password vault configured in your setup.

CLI Commands

  • sync: Syncs the default .env file with the 1Password vault.
  • diff: Compares secrets between the .env file and the 1Password vault.
  • help: Displays help for a command.

Configuration

The tool uses a configuration file to manage settings. By default, it looks for a config.yaml file in the root directory.

Project Structure

  • src/: Contains the TypeScript source files.
  • dist/: Compiled JavaScript files.
  • envManager.ts: Handles loading and parsing .env files.
  • onePasswordManager.ts: Interfaces with the 1Password SDK.
  • syncManager.ts: Coordinates the syncing process between .env files and 1Password vaults.
  • cli.ts: Defines the command-line interface and commands.
  • configManager.ts: Manages application configurations.
  • logger.ts: Provides logging functionality across the application.
  • utils.ts: Utility functions used throughout the application.

How to contribute

This project is actively looking for maintainers, so feel free to reach out to me if you want to contribute to it.

E-mail: contact@tomislavbalabanov.me

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Tomislav Balabanov


Downloads & popularity

3downloads
7-day window · source-reported counts20 Oct 2026
31.50
2026-10-20: 3 · observed 2026-10-20T23:20:51.4615115Z
20 Oct20 Oct

npm · 1 observations shown. Missing days are unknown.

View observed values
Date / source periodValueObserved at
2026-10-2032026-10-20T23:20:51.4615115Z

Declared dependencies 13

Native requirements
13 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
@1password/sdk
Environment
{
  "local_name": "@1password/sdk",
  "alias": false,
  "peer_metadata": null
}
^0.1.1runtime
@inquirer/prompts
Environment
{
  "local_name": "@inquirer/prompts",
  "alias": false,
  "peer_metadata": null
}
^5.3.8runtime
commander
Environment
{
  "local_name": "commander",
  "alias": false,
  "peer_metadata": null
}
^12.1.0runtime
diff
Environment
{
  "local_name": "diff",
  "alias": false,
  "peer_metadata": null
}
^5.2.0runtime
dotenv
Environment
{
  "local_name": "dotenv",
  "alias": false,
  "peer_metadata": null
}
^16.4.5runtime
js-yaml
Environment
{
  "local_name": "js-yaml",
  "alias": false,
  "peer_metadata": null
}
^4.1.0runtime
kleur
Environment
{
  "local_name": "kleur",
  "alias": false,
  "peer_metadata": null
}
^4.1.5runtime
@changesets/cli
Environment
{
  "local_name": "@changesets/cli",
  "alias": false,
  "peer_metadata": null
}
^2.27.7development
@types/diff
Environment
{
  "local_name": "@types/diff",
  "alias": false,
  "peer_metadata": null
}
^5.2.1development
@types/js-yaml
Environment
{
  "local_name": "@types/js-yaml",
  "alias": false,
  "peer_metadata": null
}
^4.0.9development
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
^22.2.0development
tsup
Environment
{
  "local_name": "tsup",
  "alias": false,
  "peer_metadata": null
}
^8.2.4development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^5.5.4development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-yfFly6vV7XlIOpyaJxx2SB9vHLhXdz/4ybo3YzrF+P35KaHWGIozQdCj9CzO0xEGPAhEgvdhoaZD8pODJalVIQ==",
  "shasum": "38fc768e7d546a6835f30eca81880deda5371b8e",
  "tarball": "https://registry.npmjs.org/1password-dot-env-sync/-/1password-dot-env-sync-1.0.5.tgz",
  "fileCount": 27,
  "unpackedSize": 82111,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEYCIQDjdWto4SpYPlOcyTsZrNXK0KNErpe9ZADI2e5j5xxoewIhAIl58Ck+ZpShWhZtNgCwOIDVEKqMSxydUkzT6voLpVW9"
    }
  ]
}

Repository

PENDING
tomasbal/1password-dot-env-sync

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 18:35 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:75cadfcdaf2fd426bd3a0b800206efd90243a15a422e908ed8f12e1f88da9721

Other collected versions

1.0.412 Aug1.0.212 Aug2.0.112 Aug1.0.112 AugView all collected versions →