---
title: "💭 kv - Command | Vault | HashiCorp Developer"
description: "!https://developer.hashicorp.com/vault/docs/commands/kv"
date: 2023-11-05
published: true
tags:
  - cli
  - thought
template: link
---


<div class="embed-card embed-card-external">
  <a href="https://developer.hashicorp.com/vault/docs/commands/kv" class="embed-card-link" target="_blank" rel="noopener noreferrer">
    <div class="embed-card-image">
      <img src="https://developer.hashicorp.com/og-image/vault.jpg" alt="kv - Command | Vault | HashiCorp Developer — The &#34;kv&#34; command groups subcommands for interacting with Vault&#39;s key/value
secret engine." loading="lazy">
    </div>
    <div class="embed-card-content">
      <div class="embed-card-title">kv - Command | Vault | HashiCorp Developer</div>
      <div class="embed-card-description">The &#34;kv&#34; command groups subcommands for interacting with Vault&#39;s key/value
secret engine.</div>
      <div class="embed-card-meta">kv - Command | Vault | HashiCorp Developer &middot; developer.hashicorp.com</div>
    </div>
  </a>
</div>


hashi vault lets you manage secrets right from your cli.

``` bash
# set your vault url
export VAULT_ADDR=https://myvault.mydomain
vault login

# get a secret
vault kv get secret/hvac

# put a secret
vault kv put -mount=secret creds passcode=my-long-passcode

# get it
vault kv get secret/creds

# == Secret Path ==
# secret/data/creds
# 
# ======= Metadata =======
# Key                Value
# ---                -----
# created_time       2023-11-05T02:53:40.978120001Z
# custom_metadata    <nil>
# deletion_time      n/a
# destroyed          false
# version            3
# 
# ====== Data ======
# Key         Value
# ---         -----
# bar         baz
# passcode    my-long-passcode

# get one field
vault kv get -field=passcode secret/creds

# my-long-passcode
vault kv put -mount=secret creds bar=baz

# set more keys
vault kv put -mount=secret creds passcode=my-long-passcode bar=baz

# 
# == Secret Path ==
# secret/data/creds
# 
# ======= Metadata =======
# Key                Value
# ---                -----
# created_time       2023-11-05T03:24:14.65958906Z
# custom_metadata    <nil>
# deletion_time      n/a
# destroyed          false
# version            4

vault kv get secret/creds

# == Secret Path ==
# secret/data/creds
# 
# ======= Metadata =======
# Key                Value
# ---                -----
# created_time       2023-11-05T02:53:40.978120001Z
# custom_metadata    <nil>
# deletion_time      n/a
# destroyed          false
# version            4
# 
# ====== Data ======
# Key         Value
# ---         -----
# bar         baz
# passcode    my-long-passcode

```

!!! note

    This post is a <a href="/thoughts/" class="wikilink" data-title="Thoughts" data-description="These are generally my thoughts on a web page or some sort of url, except a rare few don&#39;t have a link. These are dual published off of my..." data-date="2024-04-01">thought</a>. It's a short note that I make
    about someone else's content online <a href="/tags/thoughts/" class="hashtag-tag" data-tag="thoughts" data-count=2 data-reading-time=3 data-reading-time-text="3 minutes">#thoughts</a>
