Files
2026-10-02 18:25:29 +08:00

27 lines
848 B
Bash
Executable File

#!/usr/bin/env bash
# Read a secret — MASKED by default.
#
# `xop get` prints `su****【xop禁止将密钥泄漏】` (first 2 chars, same format
# as the stdout leak guard). This is deliberate: stdout of this command often
# lands in a model context / log / shell history, so the plaintext path must
# be an explicit human decision.
#
# Human visual inspection (plaintext, prints a stderr warning too):
#
# ./target/release/xop get DB_PASS -v
#
# DO NOT pipe the plaintext into another command, and never add -v from an
# AI agent session. To hand a secret to a child process use injection:
#
# xop run --secret MYSQL_PWD=DB_PASS --allow-net=db.local:3306 --deny-net='*' \
# -- mysql -h db.local -u readonly mydb
set -euo pipefail
cd "$(dirname "$0")/.."
KEY="${1:-YOUR_KEY_HERE}"
shift || true
./target/release/xop get "$KEY" "$@"