---
title: "Command: ennote secret create"
description: "ennote secret create stores a new encrypted secret in your Ennote workspace: a login and password, keys and values (for example piped from a .env file), a security note, or a 2FA key. Values can come from flags or stdin."
canonical_url: "https://docs.ennote.io/cli/commands/secret/create"
---
# Command: ennote secret create

> ennote secret create stores a new encrypted secret in your Ennote workspace: a login and password, keys and values (for example piped from a .env file), a security note, or a 2FA key. Values can come from flags or stdin.

## Usage

Create new secrets directly from the terminal. You can pass values via inline flags or pipe data through standard input (stdin) to avoid leaving secrets in your shell history.

```bash
ennote secret create <secret-name> [flags]
```

## Examples

```bash
# Create a standard login/password secret
ennote secret create "prod-db-credentials" --type LOGIN_PASSWORD --login "admin" --password "supersecret"

# Pipe a .env file directly into a KEYS_VALUES secret
cat .env | ennote secret create "stripe-keys" --type KEYS_VALUES

# Create a 2FA token
ennote secret create "github-2fa" --type TWO_FACTOR --value "JBSWY3DPEHPK3PXP"

# Create a secure note or pipe an SSH key
ennote secret create "arch-notes" --type SECURITY_NOTES --value "Critical infrastructure details"
cat id_rsa | ennote secret create "bastion ssh" --type SECURITY_NOTES
```

## Creation Flags

- **--type:** Type of secret (LOGIN_PASSWORD, KEYS_VALUES, SECURITY_NOTES, TWO_FACTOR).
- **--login:** Login username or email.
- **--password:** Password payload for the secret.
- **--value:** Payload for SECURITY_NOTES or TWO_FACTOR.
- **--labels:** Comma-separated list of labels.
- **--notes:** Optional metadata description.
- **--url:** Associated URL for the secret.

Secret types are described in [Secret Types](https://docs.ennote.io/docs/secrets/types); `TWO_FACTOR` stores the 2FA secret key used to [generate TOTP codes](https://docs.ennote.io/docs/secrets/two-factor).

Global flags: `--organization-id`, `--workspace-id` ([ennote secret](https://docs.ennote.io/cli/commands/secret#global-flags)).

## FAQ

### How do I create a secret without leaving it in my shell history?

Pipe the value through standard input instead of passing it as a flag, for example `cat .env | ennote secret create "stripe-keys" --type KEYS_VALUES`.

<need-help>



</need-help>


## Sitemap

See the full [sitemap](https://docs.ennote.io/sitemap.md) for all pages.
