Skip to main content

funsecret

funsecret 是一个本地优先的加密密钥管理工具。核心引擎采用 Rust 实现(funsecret-core),同时提供:

  • 原生 CLI 二进制(funsecret):零 Python 依赖、毫秒级冷启动,内置 SQLite3 / MySQL(含 MariaDB)/ PostgreSQL 支持(兼容 SQLAlchemy 方言 URL 前缀,便于跨库迁移),通过 cargo install / apt / brew / GitHub Release 分发;
  • Python 扩展包(PyPI funsecret):基于 PyO3 + maturin 包装,零运行时依赖,兼容历史 Python API 与 ~/.secret/.funsecret.db 数据库格式;
  • Rust 核心库(funsecret-core):供 Rust 服务与工具直接调用。

适合存这些内容:

  • 账号密码
  • token / access key
  • 数据库连接信息
  • 其他不想写进代码里的敏感配置

默认把数据保存在本机 ~/.secret/.funsecret.db(权限 0600),按 2–5 级分类路径读取,例如 app prod mysql password。

安装

命令行安装(原生静态二进制,零 Python 依赖)

# APT(添加 farfarfun 源后,见 https://farfarfun.github.io/packages/funsecret/)
sudo apt install funsecret

# Homebrew
brew install farfarfun/packages/funsecret

# Cargo
cargo install funsecret

# 或直接从 GitHub Releases 下载对应平台的静态二进制 / .deb

Python 库安装(仅提供 Python API,不含命令行入口)

pip install funsecret

本地源码开发:

cargo build --release --package funsecret
maturin develop --release

命令行快速开始

写入一个 secret:

funsecret write my-password app prod mysql password

通过 stdin 安全写入(适合含 - 开头或多行内容,不暴露在进程参数中):

printf '%s' 'sk-xxxxx' | funsecret write --stdin openai prod api_key

可选指定过期时间(小于 1000000000 按相对秒数,否则按 Unix 时间戳):

funsecret write --expire 3600 temp-token app dev token

读取一个 secret(支持 --json 无损输出):

funsecret read app prod mysql password
funsecret read --json app prod mysql password

删除单条 secret:

funsecret delete app prod mysql password

查看有哪些 key(只显示路径,不显示值;支持 --json 返回时间戳元数据):

funsecret list
funsecret list --json

查看当前存储信息(支持 --json):

funsecret info
funsecret info --json

清空当前本地 secret:

funsecret clear
funsecret clear --yes

同步到/自外部数据库(支持 SQLite3 / MySQL / MariaDB / PostgreSQL,自动兼容 SQLAlchemy 方言 URL 前缀如 sqlite+pysqlite:///、mysql+pymysql://、postgresql+psycopg2://、postgres://):

# MySQL / MariaDB
funsecret save mysql+pymysql://username:password@127.0.0.1:3306/funsecret --cipher-key my-secret-key
funsecret load mysql+pymysql://username:password@127.0.0.1:3306/funsecret --cipher-key my-secret-key

# PostgreSQL
funsecret save postgresql+psycopg2://username:password@127.0.0.1:5432/funsecret --cipher-key my-secret-key
funsecret load postgresql://username:password@127.0.0.1:5432/funsecret --cipher-key my-secret-key

# SQLite3
funsecret save sqlite:///backup.db --cipher-key my-secret-key

不传 --cipher-key 时目标库以明文写入/按明文读取;省略 URL 时自动使用 funsecret db url 路径中保存的默认地址。

Python 用法

from funsecret import delete_secret, list_secret, read_secret, write_secret

write_secret("my-password", "app", "prod", "mysql", "password")
password = read_secret("app", "prod", "mysql", "password")
tree = list_secret()
delete_secret("app", "prod", "mysql", "password")

环境变量

  • FUN_SECRET_PATH:覆盖默认主目录(密钥目录为 <FUN_SECRET_PATH>/.secret)
  • FUN_SECRET_URL:直接指定数据库 URL(sqlite:///... 或 mysql://...)
  • FUN_CACHE_SECRET_PATH / FUN_CACHE_SECRET_HOME:短期缓存目录配置

快照扩展

云盘快照功能由工作区子包 extbuild/funsecret-snapshot 单独提供。


关于 farfarfun

farfarfun 是一个专注于实用工具库的开源组织,涵盖云存储、数据处理、AI、多媒体与开发工具链等方向。

本项目基于 MIT 协议开源。

Metadata

Release files for funsecret 2.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for funsecret 2.1.1
File Size Uploaded Provenance Actions
funsecret-2.1.1.tar.gz 46.8 kB Without provenance Details for funsecret-2.1.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for funsecret 2.1.1
File Actions
funsecret-2.1.1-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for funsecret-2.1.1-cp312-abi3-win_amd64.whl
funsecret-2.1.1-cp312-abi3-musllinux_1_2_x86_64.whl CPython 3.12 abi3 Linux musl 1.2+ x86-64 Details for funsecret-2.1.1-cp312-abi3-musllinux_1_2_x86_64.whl
funsecret-2.1.1-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.12 abi3 Linux glibc 2.17+ x86-64 Details for funsecret-2.1.1-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
funsecret-2.1.1-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.12 abi3 Linux glibc 2.17+ ARM64 Details for funsecret-2.1.1-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
funsecret-2.1.1-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details for funsecret-2.1.1-cp312-abi3-macosx_11_0_arm64.whl
funsecret-2.1.1-cp312-abi3-macosx_10_12_x86_64.whl CPython 3.12 abi3 macOS 10.12+ x86-64 Details for funsecret-2.1.1-cp312-abi3-macosx_10_12_x86_64.whl

Total release size: 20.7 MB

Release files / funsecret-2.1.1.tar.gz

Download URL funsecret-2.1.1.tar.gz
Size 46.8 kB
Tags Source
SHA-256 checksum
How to use checksums
227777e344ebff31b53d5af4b4dd9ddc0ff581466e65331ee7fcd162ec484ee9
BLAKE2b-256 checksum
How to use checksums
888ed626c5ac02e700ba4c0984bfabc67a63faba7a8f060247127ec1b24e1dde
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / funsecret-2.1.1-cp312-abi3-win_amd64.whl

Download URL funsecret-2.1.1-cp312-abi3-win_amd64.whl
Size 3.4 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
92ef83a9b01e6915495ddb9da83c365af5cb3227ee255acf209a5777f623fad3
BLAKE2b-256 checksum
How to use checksums
e6736b377c14e4ed18bbdf226da95f14d63951aa84c80ddc2e09b40c02231410
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / funsecret-2.1.1-cp312-abi3-musllinux_1_2_x86_64.whl

Download URL funsecret-2.1.1-cp312-abi3-musllinux_1_2_x86_64.whl
Size 3.8 MB
Tags CPython 3.12 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
a691b29051ea6cd419307806d455f74d9a0f4f2413dc8b5dd5e1839c13b9a5cd
BLAKE2b-256 checksum
How to use checksums
88fa91d97b43d62a70eb40fb5623a06808bef6b175bce8a4564bc7311544465d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / funsecret-2.1.1-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL funsecret-2.1.1-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 3.5 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
46373bc7fe84712825199155c3dd2fed2d840795c7a11ed44ca51139845fa097
BLAKE2b-256 checksum
How to use checksums
47f9aef3936003a06b6549a1b123df1cf813c77ef0852816557e0178a68e9eb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / funsecret-2.1.1-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL funsecret-2.1.1-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 3.4 MB
Tags CPython 3.12 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
b18f0f7d13dc4b5b9c756bcaac69740709c39ef6abee99fc96f321786ae3f461
BLAKE2b-256 checksum
How to use checksums
9bf6b1c5f16beaa23a83698a8ec4affddc4173ae69ccaf6ee12fe327e8536ce9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / funsecret-2.1.1-cp312-abi3-macosx_11_0_arm64.whl

Download URL funsecret-2.1.1-cp312-abi3-macosx_11_0_arm64.whl
Size 3.2 MB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
89fe9424beca2449edfe5c9bb5dfed589ccf22b01141aa0dfef19cd1b8a3e844
BLAKE2b-256 checksum
How to use checksums
75d69b0fc778fffa1afaa0fd36a8c001015559310f934deb2ff1fb7aef505851
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / funsecret-2.1.1-cp312-abi3-macosx_10_12_x86_64.whl

Download URL funsecret-2.1.1-cp312-abi3-macosx_10_12_x86_64.whl
Size 3.4 MB
Tags CPython 3.12 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
0810fde54a0769afa74a8ae1ed1cfd10dc0dfaf09fbc16f0dd4d300a22e5e811
BLAKE2b-256 checksum
How to use checksums
322fbdfd32c2c8de3c57084ce1a89695896ab222c1eb080d041326ef470aeb37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for funsecret 2.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.1.1 This release

7 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page