dorky 4.1.5 → 4.1.7
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/package.json +2 -1
- package/.dorky/history.json +0 -22
- package/.dorky/metadata.json +0 -14
- package/.dorkyignore +0 -0
- package/.github/workflows/publish-extension.yml +0 -46
- package/.github/workflows/publish.yml +0 -24
- package/AGENTS.md +0 -139
- package/dorky-usage-aws.svg +0 -1
- package/dorky-usage-google-drive.svg +0 -1
- package/logo.svg +0 -6
package/package.json
CHANGED
package/.dorky/history.json
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"id": "34aaf3c3",
|
|
4
|
-
"timestamp": "2026-04-22T18:30:13.819Z",
|
|
5
|
-
"files": {
|
|
6
|
-
".env": {
|
|
7
|
-
"mime-type": "application/octet-stream",
|
|
8
|
-
"hash": "ef690809a391f839b909e303e8d1f888"
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"id": "e5ecba71",
|
|
14
|
-
"timestamp": "2026-04-22T18:30:45.770Z",
|
|
15
|
-
"files": {
|
|
16
|
-
".env": {
|
|
17
|
-
"mime-type": "application/octet-stream",
|
|
18
|
-
"hash": "0f3124c0e7688e35ae2187da45f23f22"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
]
|
package/.dorky/metadata.json
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"stage-1-files": {
|
|
3
|
-
".env": {
|
|
4
|
-
"mime-type": "application/octet-stream",
|
|
5
|
-
"hash": "ef690809a391f839b909e303e8d1f888"
|
|
6
|
-
}
|
|
7
|
-
},
|
|
8
|
-
"uploaded-files": {
|
|
9
|
-
".env": {
|
|
10
|
-
"mime-type": "application/octet-stream",
|
|
11
|
-
"hash": "ef690809a391f839b909e303e8d1f888"
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
package/.dorkyignore
DELETED
|
File without changes
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
name: "🧩 Publish VSCode Extension To Marketplace"
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
paths:
|
|
8
|
-
- "extension/dorky-extension/**"
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
publish:
|
|
12
|
-
name: 🧩 publish extension
|
|
13
|
-
runs-on: ubuntu-latest
|
|
14
|
-
steps:
|
|
15
|
-
- name: Checkout
|
|
16
|
-
uses: actions/checkout@v4
|
|
17
|
-
|
|
18
|
-
- name: Setup Node
|
|
19
|
-
uses: actions/setup-node@v4
|
|
20
|
-
with:
|
|
21
|
-
node-version: "24.x"
|
|
22
|
-
|
|
23
|
-
- name: Install dependencies
|
|
24
|
-
run: npm install
|
|
25
|
-
working-directory: extension/dorky-extension
|
|
26
|
-
|
|
27
|
-
- name: Lint
|
|
28
|
-
run: npm run lint
|
|
29
|
-
working-directory: extension/dorky-extension
|
|
30
|
-
|
|
31
|
-
- name: Get extension version
|
|
32
|
-
id: pkg
|
|
33
|
-
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
|
|
34
|
-
working-directory: extension/dorky-extension
|
|
35
|
-
|
|
36
|
-
- name: Package extension
|
|
37
|
-
run: npx @vscode/vsce package
|
|
38
|
-
working-directory: extension/dorky-extension
|
|
39
|
-
|
|
40
|
-
- name: Publish to VS Code Marketplace
|
|
41
|
-
uses: HaaLeo/publish-vscode-extension@v1
|
|
42
|
-
with:
|
|
43
|
-
pat: ${{ secrets.VSCE_PAT }}
|
|
44
|
-
registryUrl: https://marketplace.visualstudio.com
|
|
45
|
-
extensionFile: extension/dorky-extension/dorky-extension-${{ steps.pkg.outputs.version }}.vsix
|
|
46
|
-
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
name: "🚀 Publish on npm"
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
release:
|
|
10
|
-
name: 🚀 release
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
steps:
|
|
13
|
-
- name: Checkout
|
|
14
|
-
uses: actions/checkout@v4
|
|
15
|
-
- name: Setup node
|
|
16
|
-
uses: actions/setup-node@v3
|
|
17
|
-
with:
|
|
18
|
-
node-version: "24.x"
|
|
19
|
-
registry-url: "https://registry.npmjs.org"
|
|
20
|
-
- run: npm install
|
|
21
|
-
- name: 🚀 publish
|
|
22
|
-
run: npm publish --access public
|
|
23
|
-
env:
|
|
24
|
-
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
|
package/AGENTS.md
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
# AGENTS.md
|
|
2
|
-
|
|
3
|
-
Context for LLMs and coding agents working in this repository.
|
|
4
|
-
|
|
5
|
-
## Project Overview
|
|
6
|
-
|
|
7
|
-
**dorky** — "DevOps Records Keeper". A CLI tool that stores sensitive project files (`.env`, configs, API keys) on remote storage (AWS S3 or Google Drive) instead of committing them to version control. Modeled loosely on `git` semantics: `add` / `rm` / `push` / `pull` / `log` / `checkout`.
|
|
8
|
-
|
|
9
|
-
- Package name: `dorky` (npm)
|
|
10
|
-
- Language: JavaScript (CommonJS, Node.js)
|
|
11
|
-
- License: ISC
|
|
12
|
-
- Homepage: https://dorky.trishantpahwa.me/
|
|
13
|
-
- Repository: https://github.com/trishantpahwa/dorky
|
|
14
|
-
|
|
15
|
-
## Repository Layout
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
dorky/
|
|
19
|
-
├── bin/
|
|
20
|
-
│ ├── index.js # Main CLI entrypoint (`dorky` binary)
|
|
21
|
-
│ └── mcp.js # MCP server entrypoint (`dorky-mcp` binary)
|
|
22
|
-
├── extension/
|
|
23
|
-
│ └── dorky-extension/ # VS Code extension (separate package, separate version)
|
|
24
|
-
├── web-app/ # Marketing/docs React site (CRA + Tailwind)
|
|
25
|
-
├── tests/
|
|
26
|
-
│ ├── e2e/cli.test.js # End-to-end CLI tests (Vitest)
|
|
27
|
-
│ └── helpers/ # Test fixtures + CLI runner helpers
|
|
28
|
-
├── .dorky/ # Local dorky state (metadata, credentials, history)
|
|
29
|
-
├── .dorkyignore # Files dorky should skip when scanning
|
|
30
|
-
├── .mcp.json # MCP server config for local dev
|
|
31
|
-
├── vitest.config.js
|
|
32
|
-
└── package.json
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
The three main artifacts (`dorky` CLI, `dorky-mcp` server, `dorky-extension`) are versioned independently — keep that in mind before bumping versions.
|
|
36
|
-
|
|
37
|
-
## Binaries / Entrypoints
|
|
38
|
-
|
|
39
|
-
| Binary | File | Purpose |
|
|
40
|
-
| ----------- | -------------- | ------------------------------------------------------ |
|
|
41
|
-
| `dorky` | `bin/index.js` | CLI tool — `yargs`-driven, handles all user commands |
|
|
42
|
-
| `dorky-mcp` | `bin/mcp.js` | MCP stdio server exposing dorky commands as MCP tools |
|
|
43
|
-
|
|
44
|
-
Both files share substantial logic (constants, helpers, S3 + Google Drive clients). Changes to one usually need mirroring in the other — there is no shared library yet.
|
|
45
|
-
|
|
46
|
-
## Key Constants (in both `bin/index.js` and `bin/mcp.js`)
|
|
47
|
-
|
|
48
|
-
- `DORKY_DIR = ".dorky"`
|
|
49
|
-
- `METADATA_PATH = .dorky/metadata.json` — tracks `stage-1-files` and `uploaded-files` (path → md5 hash)
|
|
50
|
-
- `CREDENTIALS_PATH = .dorky/credentials.json` — storage credentials, git-ignored
|
|
51
|
-
- `HISTORY_PATH = .dorky/history.json` — push commit log
|
|
52
|
-
- `GD_CREDENTIALS_PATH = ../google-drive-credentials.json` — relative to `bin/`
|
|
53
|
-
- `SCOPES = ['https://www.googleapis.com/auth/drive']`
|
|
54
|
-
|
|
55
|
-
Remote history snapshots live at `<project>/.dorky-history/<commit-id>/` in the remote bucket/folder.
|
|
56
|
-
|
|
57
|
-
## Commands (CLI)
|
|
58
|
-
|
|
59
|
-
| Flag | Alias | Purpose |
|
|
60
|
-
| -------------------- | ----- | --------------------------------------------- |
|
|
61
|
-
| `--init <provider>` | `-i` | Initialize project (`aws` or `google-drive`) |
|
|
62
|
-
| `--list [remote]` | `-l` | List local stageable / remote files |
|
|
63
|
-
| `--add <files...>` | `-a` | Stage files |
|
|
64
|
-
| `--rm <files...>` | `-r` | Unstage files |
|
|
65
|
-
| `--push` | `-ph` | Upload staged files, commit snapshot |
|
|
66
|
-
| `--pull` | `-pl` | Download all tracked files |
|
|
67
|
-
| `--log` | `-lg` | Show push history |
|
|
68
|
-
| `--checkout <id>` | `-co` | Restore files from a commit (prefix match OK) |
|
|
69
|
-
| `--migrate <target>` | `-m` | Migrate to another storage (partial) |
|
|
70
|
-
| `--destroy` | `-d` | Delete local state + remote files |
|
|
71
|
-
|
|
72
|
-
## MCP Tools (exposed by `dorky-mcp`)
|
|
73
|
-
|
|
74
|
-
`init`, `list`, `add`, `remove`, `push`, `pull`, `log`, `checkout`, `destroy` — names match CLI flags. MCP server expects storage credentials via env vars (`AWS_ACCESS_KEY`, `AWS_SECRET_KEY`, `AWS_REGION`, `BUCKET_NAME` for S3).
|
|
75
|
-
|
|
76
|
-
## Conventions
|
|
77
|
-
|
|
78
|
-
- **CommonJS only** in `bin/` — `require` / `module.exports`, no ESM there.
|
|
79
|
-
- **Vitest config is ESM** (`vitest.config.js` uses `import`/`export`).
|
|
80
|
-
- **Path normalization**: paths are stored POSIX-style in metadata/history. Use the `toPosix()` helper before writing to JSON and `normalizeKeys()` when reading.
|
|
81
|
-
- **File identity** is MD5 hash of contents (`md5` package) — used to skip unchanged files on push.
|
|
82
|
-
- **EOL**: Code uses `\r\n` on Darwin, `\n` elsewhere — see top of `bin/index.js`. Be careful when editing files dorky writes.
|
|
83
|
-
- **No TypeScript** in source despite `typescript` being a devDependency.
|
|
84
|
-
- **Error UX**: CLI uses `chalk` for colored output; MCP throws/returns structured errors instead of `process.exit`.
|
|
85
|
-
|
|
86
|
-
## Running & Testing
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
# Run CLI locally
|
|
90
|
-
node bin/index.js --help
|
|
91
|
-
# or
|
|
92
|
-
npm start
|
|
93
|
-
|
|
94
|
-
# Run MCP server
|
|
95
|
-
node bin/mcp.js
|
|
96
|
-
|
|
97
|
-
# Tests
|
|
98
|
-
npm test # vitest run
|
|
99
|
-
npm run test:watch
|
|
100
|
-
npm run test:unit
|
|
101
|
-
npm run test:e2e
|
|
102
|
-
npm run test:coverage # uses c8
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
E2E tests spawn the CLI as a subprocess via `tests/helpers/runCli.js` and use fixtures from `tests/helpers/fixtures.js`. They are slow — `testTimeout` is 60s. Vitest is configured with `threads: false` so subprocess handling stays sane.
|
|
106
|
-
|
|
107
|
-
## Environment Variables
|
|
108
|
-
|
|
109
|
-
For AWS S3 workflows (CLI, MCP, and extension all read these):
|
|
110
|
-
|
|
111
|
-
- `AWS_ACCESS_KEY`
|
|
112
|
-
- `AWS_SECRET_KEY`
|
|
113
|
-
- `AWS_REGION`
|
|
114
|
-
- `BUCKET_NAME`
|
|
115
|
-
|
|
116
|
-
For Google Drive: `google-drive-credentials.json` (OAuth client) must exist at the repo root, alongside `package.json`. Per-project user tokens are written to `.dorky/credentials.json` after `dorky --init google-drive`.
|
|
117
|
-
|
|
118
|
-
## Things to Watch Out For
|
|
119
|
-
|
|
120
|
-
- **Never commit** `.dorky/credentials.json`, `google-drive-credentials.json`, or `.env`. The CLI auto-appends these patterns to `.gitignore` on init — don't undo that.
|
|
121
|
-
- **`bin/index.js` and `bin/mcp.js` are intentionally duplicated.** Until they are refactored to share a module, mirror logic changes between them or behavior will drift.
|
|
122
|
-
- **The `extension/dorky-extension/` subproject has its own `node_modules` and its own version.** Don't bump it implicitly when bumping the root package.
|
|
123
|
-
- **Versioning history** (from recent commits): root `dorky` is at `4.1.4`, extension at `0.0.10` — they are bumped separately, often in the same commit but with separate intent.
|
|
124
|
-
- **`--migrate` is partially implemented.** Don't assume it works end-to-end.
|
|
125
|
-
- **Push is hash-aware**: if staged state matches the latest commit, push is a no-op. Tests need to account for this.
|
|
126
|
-
- **History entries** are mutated through `normalizeKeys` on read — if you bypass `readHistory()`, you risk Windows-style backslash keys leaking in.
|
|
127
|
-
|
|
128
|
-
## Out-of-Scope for Most Tasks
|
|
129
|
-
|
|
130
|
-
- `web-app/` is a separate React marketing site (CRA + Tailwind). Unrelated to the CLI; don't touch unless explicitly asked.
|
|
131
|
-
- `coverage/` is generated; never edit.
|
|
132
|
-
- `node_modules/` — never edit; reinstall instead.
|
|
133
|
-
|
|
134
|
-
## Where to Add Things
|
|
135
|
-
|
|
136
|
-
- New CLI flag → `bin/index.js` (yargs block near the top) + mirror as an MCP tool in `bin/mcp.js`.
|
|
137
|
-
- New storage provider → both `bin/index.js` and `bin/mcp.js` need provider branches; update `--init` validation and the metadata `provider` field.
|
|
138
|
-
- New tests → `tests/e2e/` (subprocess style) using helpers in `tests/helpers/`.
|
|
139
|
-
- README updates for user-facing changes; this file (AGENTS.md) for agent/dev-facing context.
|