@oc-forge/secret 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +41 -78
- package/bin/secret +2 -0
- package/package.json +2 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 oc-forge
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,115 +1,78 @@
|
|
|
1
1
|
# @oc-forge/secret
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Infisical secret management CLI with local caching. Built for [OpenClaw](https://openclaw.ai) teams.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## 安装 / Installation
|
|
10
|
-
|
|
11
|
-
需要 [Bun](https://bun.sh) runtime(v1.0+)。
|
|
5
|
+
## Install
|
|
12
6
|
|
|
13
7
|
```bash
|
|
14
8
|
npm i -g @oc-forge/secret
|
|
15
|
-
# 或
|
|
16
|
-
bun add -g @oc-forge/secret
|
|
17
9
|
```
|
|
18
10
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## 配置 / Configuration
|
|
11
|
+
> Requires [Bun](https://bun.sh) runtime (`curl -fsSL https://bun.sh/install | bash`)
|
|
24
12
|
|
|
25
|
-
|
|
13
|
+
## Configure
|
|
26
14
|
|
|
27
|
-
|
|
15
|
+
### Option 1: Config file (recommended)
|
|
28
16
|
|
|
29
|
-
```
|
|
17
|
+
```bash
|
|
18
|
+
mkdir -p ~/.config/openclaw-fleet
|
|
19
|
+
cat > ~/.config/openclaw-fleet/config.json << 'EOF'
|
|
30
20
|
{
|
|
31
|
-
"clientId": "your-
|
|
32
|
-
"clientSecret": "your-
|
|
21
|
+
"clientId": "your-infisical-client-id",
|
|
22
|
+
"clientSecret": "your-infisical-client-secret",
|
|
33
23
|
"projectId": "your-infisical-project-id",
|
|
34
|
-
"env": "dev"
|
|
24
|
+
"env": "dev",
|
|
25
|
+
"ttlMs": 86400000
|
|
35
26
|
}
|
|
27
|
+
EOF
|
|
28
|
+
chmod 600 ~/.config/openclaw-fleet/config.json
|
|
36
29
|
```
|
|
37
30
|
|
|
38
|
-
###
|
|
31
|
+
### Option 2: Environment variables
|
|
39
32
|
|
|
40
33
|
```bash
|
|
41
|
-
export INFISICAL_CLIENT_ID="
|
|
42
|
-
export INFISICAL_CLIENT_SECRET="
|
|
43
|
-
export INFISICAL_PROJECT_ID="
|
|
44
|
-
export INFISICAL_ENV="dev"
|
|
34
|
+
export INFISICAL_CLIENT_ID="..."
|
|
35
|
+
export INFISICAL_CLIENT_SECRET="..."
|
|
36
|
+
export INFISICAL_PROJECT_ID="..."
|
|
37
|
+
export INFISICAL_ENV="dev"
|
|
45
38
|
```
|
|
46
39
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
## 命令 / Commands
|
|
40
|
+
## Usage
|
|
52
41
|
|
|
53
42
|
```bash
|
|
54
|
-
#
|
|
55
|
-
secret get <KEY>
|
|
56
|
-
secret get <KEY> --fresh
|
|
57
|
-
|
|
58
|
-
#
|
|
59
|
-
secret
|
|
60
|
-
|
|
61
|
-
# 列出所有 secret keys
|
|
62
|
-
secret list
|
|
63
|
-
secret list --show # 同时显示值
|
|
64
|
-
|
|
65
|
-
# 全量同步到本地缓存
|
|
66
|
-
secret sync
|
|
67
|
-
|
|
68
|
-
# 注入所有 secrets 为环境变量并运行命令
|
|
69
|
-
secret exec -- <command> [args...]
|
|
70
|
-
|
|
71
|
-
# 帮助
|
|
72
|
-
secret --help
|
|
43
|
+
secret list [--show] # List all secret keys (--show to reveal values)
|
|
44
|
+
secret get <KEY> # Get a secret value (cached)
|
|
45
|
+
secret get <KEY> --fresh # Get from Infisical (bypass cache)
|
|
46
|
+
secret set <KEY> <VALUE> # Create or update a secret
|
|
47
|
+
secret sync # Sync all secrets to local cache
|
|
48
|
+
secret exec -- <cmd> # Run command with secrets injected as env vars
|
|
73
49
|
```
|
|
74
50
|
|
|
75
|
-
|
|
51
|
+
## Examples
|
|
76
52
|
|
|
77
53
|
```bash
|
|
78
|
-
#
|
|
79
|
-
secret
|
|
54
|
+
# List all secrets
|
|
55
|
+
secret list
|
|
80
56
|
|
|
81
|
-
#
|
|
82
|
-
secret
|
|
57
|
+
# Get a specific secret
|
|
58
|
+
secret get GITHUB_TOKEN
|
|
83
59
|
|
|
84
|
-
#
|
|
85
|
-
secret
|
|
60
|
+
# Set a new secret
|
|
61
|
+
secret set MY_API_KEY sk-xxxxx
|
|
86
62
|
|
|
87
|
-
#
|
|
88
|
-
secret
|
|
63
|
+
# Run a command with all secrets as environment variables
|
|
64
|
+
secret exec -- node server.js
|
|
89
65
|
```
|
|
90
66
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
## 缓存 / Caching
|
|
94
|
-
|
|
95
|
-
- 缓存文件:`~/.config/openclaw-fleet/cache.json`(权限 600)
|
|
96
|
-
- 默认 TTL:24 小时
|
|
97
|
-
- `secret get` 自动使用缓存;`secret exec` 在缓存过期时自动同步
|
|
98
|
-
- 可在 config.json 中设置 `ttlMs` 自定义缓存时长
|
|
67
|
+
## Cache
|
|
99
68
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
## 认证方式 / Authentication
|
|
69
|
+
Secrets are cached locally at `~/.config/openclaw-fleet/cache.json` with a default TTL of 24 hours. Use `--fresh` to bypass cache or `secret sync` to refresh all.
|
|
103
70
|
|
|
104
|
-
|
|
71
|
+
## Source
|
|
105
72
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
2. 授予项目访问权限
|
|
109
|
-
3. 将 `clientId` 和 `clientSecret` 填入配置文件
|
|
73
|
+
- GitHub: https://github.com/shazhou-ww/secret-cli
|
|
74
|
+
- Gitee: https://gitee.com/xiaoju-neko/secret-cli
|
|
110
75
|
|
|
111
76
|
---
|
|
112
77
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
MIT © 小橘 🍊
|
|
78
|
+
Made with 🔨 by [oc-forge](https://www.npmjs.com/org/oc-forge) — 小橘 🍊
|
package/bin/secret
ADDED
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oc-forge/secret",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Infisical secret management CLI with local caching — for OpenClaw teams",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"secret": "./secret
|
|
7
|
+
"secret": "./bin/secret"
|
|
8
8
|
},
|
|
9
9
|
"files": ["secret.ts", "README.md", "LICENSE"],
|
|
10
10
|
"keywords": ["infisical", "secret", "cli", "openclaw", "oc-forge"],
|