@chriscode/hush

中文文档
7.5.0发布于 2026/06/16MITTypeScriptES Module构建来源已验证近 30 天下载 1831

AI-native secrets manager. Secrets stay encrypted at rest; AI agents help without seeing values.

原始使用文档
文档目录18 节
  1. Install
  2. Prerequisites
  3. Quick start
  4. 1. Bootstrap a v3 repository
  5. 2. Inspect the current config
  6. 3. Add secrets safely
  7. 4. Run your app
  8. Current v3 repository model
  9. Core commands
  10. Legacy v2 migration
  11. AI-safe workflow
  12. Example workflow
  13. Team setup
  14. Troubleshooting
  15. SOPS or age is missing
  16. The key does not match this repository
  17. You need to convert a legacy repo
  18. License

@chriscode/hush

The AI-native secrets manager. Secrets stay encrypted at rest. AI can help without seeing values.

npm Documentation

Hush - AI-native secrets manager

Hush stores project authority in encrypted v3 repository documents. The current model is simple:

  • .hush/manifest.encrypted defines identities, bundles, targets, and imports
  • .hush/files/**.encrypted stores the actual secret entries and file-level readers
  • hush run -- <command> is the normal runtime path

There are no plaintext secret files to teach an AI assistant to avoid. Hush decrypts only for the active process or materialized target, then cleans up.

Read the full documentation →

Install

pnpm add -D @chriscode/hush
# or
npm install -D @chriscode/hush

Prerequisites

brew install sops age

Quick start

1. Bootstrap a v3 repository

npx hush bootstrap

That creates the encrypted repository shell, sets up keys, and writes the first v3 files:

.hush/manifest.encrypted
.hush/files/env/project/shared.encrypted

2. Inspect the current config

npx hush config show
npx hush config active-identity

Use hush config to inspect repository state and update file readers.

3. Add secrets safely

npx hush set DATABASE_URL
npx hush set API_KEY --gui

hush set prompts for the value when needed, so the assistant never sees it.

4. Run your app

npx hush run -- npm start
npx hush run -e prod -- npm build

This is the normal runtime path. Hush decrypts to memory and passes values to the command.

Current v3 repository model

Hush v3 keeps repository authority in encrypted YAML documents under .hush/.

FilePurpose
.hush/manifest.encryptedRepository metadata, identities, bundles, targets, and imports
.hush/files/**.encryptedSecret entries plus readers for each encrypted file
.sops.yamlSOPS creation rules with the project public key

hush bootstrap creates the shell. hush config inspects or updates it. hush run is how you use it day to day.

Core commands

CommandWhat it does
hush bootstrapCreate the v3 repository shell and initial active identity
hush config show [section]Show manifest, files, identities, targets, imports, or state
hush config active-identity [name]Show or change the active identity
hush config readers <file-path> --roles <csv>Update file readers
hush set <KEY>Add or update one secret safely
hush inspectList secret names with masked values
hush has <KEY>Check whether a secret exists
hush run -- <command>Run with secrets in memory
hush pushPush a target to Cloudflare
hush keys setupVerify the local project key
hush skillInstall the AI skill

Legacy v2 migration

If a repository still uses the old v2 layout, use the migration bridge:

npx hush migrate --from v2
npx hush migrate --from v2 --cleanup

That is the supported bridge from legacy repositories to the current v3 model.

AI-safe workflow

For AI assistants, the safe loop is:

npx hush inspect
npx hush has DATABASE_URL
npx hush set DATABASE_URL
npx hush run -- npm start

You can also install the shipped skill:

npx hush skill
npx hush skill --global
npx hush skill --local

Example workflow

# bootstrap the repo once
hush bootstrap

# inspect config and identities
hush config show
hush config active-identity owner-local

# add secrets
hush set DATABASE_URL
hush set STRIPE_SECRET_KEY

# run the app
hush run -- npm start

Team setup

Copy the project age key into ~/.config/sops/age/keys/{project}.txt, then verify with:

hush config show state

Troubleshooting

SOPS or age is missing

brew install sops age

The key does not match this repository

Run:

hush keys setup

You need to convert a legacy repo

Run:

hush migrate --from v2

Add --cleanup after you validate the migrated state.

License

MIT

版本与发布记录

@chriscode/hush 共发布 57 个版本,首次发布于 2026/01/15;过去 12 个月发布了 57 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
7.5.0latest2026/06/164 个月前
7.4.02026/06/134 个月前
7.3.12026/06/134 个月前
7.3.02026/06/025 个月前
7.2.52026/05/305 个月前
7.2.42026/05/235 个月前

其他发布通道:next → 6.0.0-next.0。

关于 @chriscode/hush 的常见问题

@chriscode/hush 是什么?

AI-native secrets manager. Secrets stay encrypted at rest; AI agents help without seeing values.

如何安装 @chriscode/hush?

在项目目录运行 npm install @chriscode/hush,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 hush,可以用 npx hush 直接运行。

@chriscode/hush 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@chriscode/hush 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@chriscode/hush 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@chriscode/hush 可以商用吗?

@chriscode/hush 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@chriscode/hush 的下载量有多少?

根据 npm 官方下载统计,@chriscode/hush 在 2026/10/10 – 2026/11/08 这 30 天内被下载 1,831 次,日均约 61 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@chriscode/hush 还在维护吗?

最新版本 7.5.0 发布于 2026/06/16(4 个月前);至今共发布 57 个版本,其中过去 12 个月发布了 57 个;首次发布于 2026/01/15。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。