dc-ops-cli 1.1.1 → 1.1.3
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/README.md +375 -310
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,310 +1,375 @@
|
|
|
1
|
-
# ops - 1Password CLI Helper
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
#
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
#
|
|
52
|
-
ops get GITHUB_TOKEN --
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
#
|
|
95
|
-
ops
|
|
96
|
-
|
|
97
|
-
#
|
|
98
|
-
ops list --
|
|
99
|
-
|
|
100
|
-
#
|
|
101
|
-
ops list --
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
#
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
#
|
|
123
|
-
ops
|
|
124
|
-
|
|
125
|
-
#
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
#
|
|
132
|
-
ops export
|
|
133
|
-
|
|
134
|
-
#
|
|
135
|
-
ops export --
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
#
|
|
188
|
-
ops
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
#
|
|
200
|
-
ops
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
ops
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
#
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
```bash
|
|
255
|
-
#
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
#
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
```bash
|
|
295
|
-
#
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
#
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
#
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
1
|
+
# ops - 1Password CLI Helper
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/dc-ops-cli)
|
|
4
|
+
|
|
5
|
+
Easy secret retrieval from 1Password with smart fallbacks and interactive prompts.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- 🔐 **Smart retrieval** - Get secrets with automatic fallback prompts
|
|
10
|
+
- 🧠 **Smart field detection** - Auto-detects the right field based on item type (API keys use `credential`, logins use `password`)
|
|
11
|
+
- 📝 **Interactive prompts** - Create secrets on-the-fly if not found
|
|
12
|
+
- 📋 **List & search** - Browse your vault items
|
|
13
|
+
- ⭐ **Favorites** - Quick access to your most-used secrets
|
|
14
|
+
- 📤 **Export** - Generate .env files from your vault
|
|
15
|
+
- 🔍 **Inspect** - Discover available fields for any secret
|
|
16
|
+
- 🏦 **Vaults** - List and browse available vaults
|
|
17
|
+
- 💡 **Smart suggestions** - Get hints when secrets or fields aren't found
|
|
18
|
+
- 🎨 **Beautiful UI** - Colored output and progress indicators
|
|
19
|
+
- 🔒 **Secure** - Never exposes secrets in logs or chat
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# Install from npm
|
|
25
|
+
npm install -g dc-ops-cli
|
|
26
|
+
|
|
27
|
+
# Or install from source
|
|
28
|
+
git clone https://github.com/dallascrilley/op-cli-helper.git
|
|
29
|
+
cd op-cli-helper
|
|
30
|
+
npm install && npm run build && npm link
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Prerequisites
|
|
34
|
+
|
|
35
|
+
1. Install [1Password CLI](https://1password.com/downloads/command-line/)
|
|
36
|
+
2. Sign in: `op signin`
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
### Get a secret
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Get a secret (auto-detects field based on item type)
|
|
44
|
+
ops get GITHUB_TOKEN
|
|
45
|
+
|
|
46
|
+
# Smart field detection:
|
|
47
|
+
# - API_CREDENTIAL items → uses 'credential' field
|
|
48
|
+
# - LOGIN items → uses 'password' field
|
|
49
|
+
# - SECURE_NOTE items → uses 'notesPlain' field
|
|
50
|
+
|
|
51
|
+
# Specify vault and field explicitly
|
|
52
|
+
ops get GITHUB_TOKEN --vault Personal --field api-key
|
|
53
|
+
|
|
54
|
+
# Works with special characters in item names
|
|
55
|
+
ops get "NPM_TOKEN - dallasdotjs / gh_actions_publish"
|
|
56
|
+
|
|
57
|
+
# Plain output (for piping)
|
|
58
|
+
export TOKEN=$(ops get GITHUB_TOKEN --plain)
|
|
59
|
+
|
|
60
|
+
# JSON output
|
|
61
|
+
ops get GITHUB_TOKEN --json
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Store a secret
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# Interactive prompt for value
|
|
68
|
+
ops set GITHUB_TOKEN
|
|
69
|
+
|
|
70
|
+
# Pass value directly
|
|
71
|
+
ops set GITHUB_TOKEN --value "ghp_xxxxxxxxxxxx"
|
|
72
|
+
|
|
73
|
+
# Read value from file or stdin
|
|
74
|
+
ops set GITHUB_TOKEN --value-file ~/.secrets/github_token
|
|
75
|
+
cat token.txt | ops set GITHUB_TOKEN --value -
|
|
76
|
+
|
|
77
|
+
# Specify vault
|
|
78
|
+
ops set GITHUB_TOKEN --vault Work
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Copy a secret to the clipboard
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Copy and clear after 30s
|
|
85
|
+
ops copy GITHUB_TOKEN
|
|
86
|
+
|
|
87
|
+
# Custom TTL
|
|
88
|
+
ops copy GITHUB_TOKEN --ttl 10
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### List secrets
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
# List all items in default vault
|
|
95
|
+
ops list
|
|
96
|
+
|
|
97
|
+
# List from specific vault
|
|
98
|
+
ops list --vault Work
|
|
99
|
+
|
|
100
|
+
# Search items
|
|
101
|
+
ops list --search "github"
|
|
102
|
+
|
|
103
|
+
# Dedicated search command
|
|
104
|
+
ops search "github"
|
|
105
|
+
|
|
106
|
+
# JSON output
|
|
107
|
+
ops list --json
|
|
108
|
+
|
|
109
|
+
# Plain output (tab-delimited)
|
|
110
|
+
ops list --plain
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### View favorites
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# List only favorite items (⭐ markers in regular list)
|
|
117
|
+
ops favorites
|
|
118
|
+
|
|
119
|
+
# Or use the flag
|
|
120
|
+
ops list --favorites
|
|
121
|
+
|
|
122
|
+
# Favorites also show in regular list with ⭐ markers
|
|
123
|
+
ops list
|
|
124
|
+
|
|
125
|
+
# Mark items as favorites in 1Password app or web interface
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Export secrets
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
# Export as .env to stdout
|
|
132
|
+
ops export
|
|
133
|
+
|
|
134
|
+
# Export to file
|
|
135
|
+
ops export --output .env
|
|
136
|
+
|
|
137
|
+
# Export as JSON
|
|
138
|
+
ops export --format json --output secrets.json
|
|
139
|
+
|
|
140
|
+
# JSON to stdout
|
|
141
|
+
ops export --json
|
|
142
|
+
|
|
143
|
+
# From specific vault
|
|
144
|
+
ops export --vault Work --output work.env
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Import secrets
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# Import from a .env file (KEY=VALUE per line)
|
|
151
|
+
ops import .env
|
|
152
|
+
|
|
153
|
+
# Import into a specific vault
|
|
154
|
+
ops import .env --vault Work
|
|
155
|
+
|
|
156
|
+
# Preview what would be imported without making changes
|
|
157
|
+
ops import .env --dry-run
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Run a command with injected secrets
|
|
161
|
+
|
|
162
|
+
Create a `.env.ops` file that maps environment variables to secret names:
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
API_KEY=MY_API_KEY_SECRET
|
|
166
|
+
DB_PASSWORD=MY_DB_PASSWORD
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Then run:
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
ops run -- node app.js
|
|
173
|
+
|
|
174
|
+
# Or inline mappings
|
|
175
|
+
ops run --env API_KEY=MY_API_KEY_SECRET -- node app.js
|
|
176
|
+
|
|
177
|
+
# Verbose mode shows which secrets are injected
|
|
178
|
+
ops run --verbose --env API_KEY=MY_API_KEY_SECRET -- node app.js
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Resolve a share link
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
# Resolve a 1Password share link to an op:// reference
|
|
185
|
+
ops resolve "https://share.1password.com/s#..."
|
|
186
|
+
|
|
187
|
+
# JSON output for scripting
|
|
188
|
+
ops resolve "https://share.1password.com/s#..." --json
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Outputs all available fields (id/label/type) so you can pick the right `--field`.
|
|
192
|
+
|
|
193
|
+
### Inspect a secret
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
# List available fields for a secret
|
|
197
|
+
ops inspect "GitHub PAT"
|
|
198
|
+
|
|
199
|
+
# JSON output
|
|
200
|
+
ops inspect "GitHub PAT" --json
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Useful for discovering field names before using `ops get --field`.
|
|
204
|
+
|
|
205
|
+
### List vaults
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
# List all available vaults
|
|
209
|
+
ops vaults
|
|
210
|
+
|
|
211
|
+
# JSON output
|
|
212
|
+
ops vaults --json
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Smart suggestions
|
|
216
|
+
|
|
217
|
+
When a secret or field isn't found, ops provides helpful suggestions:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
# If field doesn't exist, suggests available fields
|
|
221
|
+
$ ops get "GitHub PAT" --field token
|
|
222
|
+
Error: Field "token" not found
|
|
223
|
+
Available fields: password, username, otp
|
|
224
|
+
Try: ops get "GitHub PAT" --field password
|
|
225
|
+
|
|
226
|
+
# If secret doesn't exist, suggests similar names
|
|
227
|
+
$ ops get "GutHub PAT"
|
|
228
|
+
Error: Secret "GutHub PAT" not found
|
|
229
|
+
Did you mean: GitHub PAT, GitLab PAT
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
The clipboard `copy` command also confirms when it clears the clipboard after the TTL expires.
|
|
233
|
+
|
|
234
|
+
## Contributing
|
|
235
|
+
|
|
236
|
+
We use [Conventional Commits](https://www.conventionalcommits.org/) with [semantic-release](https://semantic-release.gitbook.io/) for automated versioning.
|
|
237
|
+
|
|
238
|
+
### Commit Convention
|
|
239
|
+
|
|
240
|
+
| Type | Release | Example |
|
|
241
|
+
|------|---------|---------|
|
|
242
|
+
| `fix:` | Patch (1.0.x) | `fix: handle empty secrets correctly` |
|
|
243
|
+
| `feat:` | Minor (1.x.0) | `feat: add vault search command` |
|
|
244
|
+
| `feat!:` | Major (x.0.0) | `feat!: redesign API` |
|
|
245
|
+
| `docs:` | None | `docs: update README` |
|
|
246
|
+
| `chore:` | None | `chore: update dependencies` |
|
|
247
|
+
| `refactor:` | None | `refactor: simplify error handling` |
|
|
248
|
+
| `test:` | None | `test: add get command tests` |
|
|
249
|
+
|
|
250
|
+
### Release Process
|
|
251
|
+
|
|
252
|
+
**Fully automated** - just follow these steps:
|
|
253
|
+
|
|
254
|
+
```bash
|
|
255
|
+
# 1. Run quality gates (required before pushing)
|
|
256
|
+
npm run typecheck && npm run build && npm test
|
|
257
|
+
|
|
258
|
+
# 2. Commit with conventional format
|
|
259
|
+
git add .
|
|
260
|
+
git commit -m "feat: your new feature"
|
|
261
|
+
|
|
262
|
+
# 3. Push to master - CI handles everything
|
|
263
|
+
git push origin master
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
**What happens automatically:**
|
|
267
|
+
1. CI runs typecheck, build, and tests
|
|
268
|
+
2. semantic-release analyzes your commits
|
|
269
|
+
3. Version is bumped in package.json
|
|
270
|
+
4. CHANGELOG.md is updated
|
|
271
|
+
5. GitHub release is created
|
|
272
|
+
6. Package is published to npm
|
|
273
|
+
|
|
274
|
+
**Do NOT manually:**
|
|
275
|
+
- Edit version in package.json
|
|
276
|
+
- Edit CHANGELOG.md
|
|
277
|
+
- Create GitHub releases
|
|
278
|
+
- Publish to npm
|
|
279
|
+
|
|
280
|
+
### Quality Gates
|
|
281
|
+
|
|
282
|
+
All must pass before pushing:
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
npm run typecheck # TypeScript type checking
|
|
286
|
+
npm run build # Compile to dist/
|
|
287
|
+
npm test # Run all tests
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
## Integration with AGENTS.md Pattern
|
|
291
|
+
|
|
292
|
+
This tool follows the pattern in §13 of AGENTS.md:
|
|
293
|
+
|
|
294
|
+
```bash
|
|
295
|
+
# 1. Check 1Password first
|
|
296
|
+
ops get OPENAI_API_KEY --silent 2>/dev/null || echo "not_found"
|
|
297
|
+
|
|
298
|
+
# 2. If not found, prompt and store
|
|
299
|
+
ops set OPENAI_API_KEY
|
|
300
|
+
|
|
301
|
+
# 3. Never leave raw tokens in files
|
|
302
|
+
# Always use: ops get SERVICE_KEY --silent
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
## Common Patterns
|
|
306
|
+
|
|
307
|
+
### Development Environment Setup
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
# Generate .env from 1Password
|
|
311
|
+
ops export --vault Development --output .env
|
|
312
|
+
|
|
313
|
+
# Source it
|
|
314
|
+
source .env
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### CI/CD Integration
|
|
318
|
+
|
|
319
|
+
```bash
|
|
320
|
+
# Get secret for GitHub Actions
|
|
321
|
+
export TOKEN=$(ops get DEPLOY_TOKEN --silent)
|
|
322
|
+
|
|
323
|
+
# Or export all secrets
|
|
324
|
+
ops export --format json | jq -r 'to_entries | .[] | "\(.key)=\(.value)"' >> $GITHUB_ENV
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
### Shell Script Integration
|
|
328
|
+
|
|
329
|
+
```bash
|
|
330
|
+
#!/bin/bash
|
|
331
|
+
set -e
|
|
332
|
+
|
|
333
|
+
# Get API key with automatic prompt if missing
|
|
334
|
+
API_KEY=$(ops get MY_SERVICE_API_KEY --silent)
|
|
335
|
+
|
|
336
|
+
# Use in curl
|
|
337
|
+
curl -H "Authorization: Bearer $API_KEY" https://api.example.com
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
## Commands Reference
|
|
341
|
+
|
|
342
|
+
| Command | Description | Options |
|
|
343
|
+
|---------|-------------|---------|
|
|
344
|
+
| `get <name>` | Get a secret | `-v, --vault`, `-f, --field`, `--plain`, `--json`, `-s, --silent`, `--no-input` |
|
|
345
|
+
| `set <name>` | Store a secret | `-v, --vault`, `-f, --field`, `--value`, `--value-file`, `--force`, `--no-input` |
|
|
346
|
+
| `copy <name>` | Copy a secret to clipboard | `-v, --vault`, `-f, --field`, `--ttl`, `-q, --quiet` |
|
|
347
|
+
| `list` | List vault items | `-v, --vault`, `-s, --search`, `-j, --json`, `--plain`, `--favorites` |
|
|
348
|
+
| `search <query>` | Search items by title | `-v, --vault`, `-j, --json`, `--plain` |
|
|
349
|
+
| `favorites` | List favorite items | `-v, --vault`, `-j, --json`, `--plain` |
|
|
350
|
+
| `export` | Export to .env/JSON | `-v, --vault`, `-f, --format`, `-j, --json`, `-o, --output` |
|
|
351
|
+
| `import <file>` | Import secrets from .env | `-v, --vault`, `--dry-run` |
|
|
352
|
+
| `run` | Run a command with secrets injected | `-v, --vault`, `-f, --field`, `-e, --env`, `--env-file`, `--verbose` |
|
|
353
|
+
| `resolve <shareLink>` | Resolve share link to ops reference | `-j, --json` |
|
|
354
|
+
| `inspect <name>` | Show available fields for a secret | `-v, --vault`, `-j, --json` |
|
|
355
|
+
| `vaults` | List available vaults | `-j, --json` |
|
|
356
|
+
|
|
357
|
+
## Development
|
|
358
|
+
|
|
359
|
+
```bash
|
|
360
|
+
# Install dependencies
|
|
361
|
+
npm install
|
|
362
|
+
|
|
363
|
+
# Run in dev mode
|
|
364
|
+
npm run dev -- get GITHUB_TOKEN
|
|
365
|
+
|
|
366
|
+
# Type check
|
|
367
|
+
npm run typecheck
|
|
368
|
+
|
|
369
|
+
# Build
|
|
370
|
+
npm run build
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
## License
|
|
374
|
+
|
|
375
|
+
MIT
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from 'commander';
|
|
3
|
+
import { createRequire } from 'module';
|
|
3
4
|
import { getCommand } from './commands/get.js';
|
|
4
5
|
import { listCommand } from './commands/list.js';
|
|
5
6
|
import { setCommand } from './commands/set.js';
|
|
@@ -10,11 +11,14 @@ import { resolveCommand } from './commands/resolve.js';
|
|
|
10
11
|
import { runCommand } from './commands/run.js';
|
|
11
12
|
import { inspectCommand } from './commands/inspect.js';
|
|
12
13
|
import { vaultsCommand } from './commands/vaults.js';
|
|
14
|
+
// Dynamic version from package.json
|
|
15
|
+
const require = createRequire(import.meta.url);
|
|
16
|
+
const pkg = require('../package.json');
|
|
13
17
|
const program = new Command();
|
|
14
18
|
program
|
|
15
19
|
.name('ops')
|
|
16
20
|
.description('Easy secret retrieval from 1Password with smart fallbacks')
|
|
17
|
-
.version(
|
|
21
|
+
.version(pkg.version)
|
|
18
22
|
.addHelpCommand()
|
|
19
23
|
.showHelpAfterError()
|
|
20
24
|
.showSuggestionAfterError()
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,KAAK,CAAC;KACX,WAAW,CAAC,2DAA2D,CAAC;KACxE,OAAO,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,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AI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,KAAY,EAAE,EAAE;IAChD,OAAO,CAAC,KAAK,CAAC,mBAAmB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dc-ops-cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Easy secret retrieval from 1Password with smart fallbacks",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"scripts": {
|
|
21
21
|
"build:bin": "bun build --compile src/index.ts --outfile bin/ops",
|
|
22
22
|
"build": "tsc",
|
|
23
|
-
"dev": "ts-node src/index.ts",
|
|
23
|
+
"dev": "TS_NODE_TRANSPILE_ONLY=1 node --loader ts-node/esm src/index.ts",
|
|
24
24
|
"typecheck": "tsc --noEmit",
|
|
25
25
|
"lint": "tsc --noEmit",
|
|
26
26
|
"test": "TS_NODE_TRANSPILE_ONLY=1 node --test --loader ts-node/esm",
|