Skip to content

Commit 515b434

Browse files
dylanpulverclaude
andcommitted
polish: --version, Makefile (test/lint/install), CONTRIBUTING
CONTRIBUTING frames the Linux zenity/kdialog port as the good-first-issue and codifies the no-new-dependencies / tests-stay-headless rules. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ALLd6FVagpVcJwtwgKH91a
1 parent e77da27 commit 515b434

3 files changed

Lines changed: 57 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Contributing to keypop
2+
3+
keypop is deliberately tiny — one shell script, no dependencies, no build step. Keep it that way.
4+
5+
## Ground rules
6+
7+
- **No new runtime dependencies.** It must stay a single `bash` + `osascript` script that runs
8+
on a stock Mac. A dependency is a much bigger ask than a feature.
9+
- **Every change stays shellcheck-clean** (`make lint`) and keeps the tests green (`make test`).
10+
- **Non-trivial logic ships with a test.** The parser is covered by `test-parse.sh`; the
11+
write/check-first/import logic by `test-behavior.sh`. Both run headless (dialogs are stubbed),
12+
so add cases there rather than requiring a human to click.
13+
- **Secrets never get logged, echoed, or written anywhere but the vault / an explicit `--env`
14+
target.** Reports show names and character counts only, never values.
15+
16+
## Running it locally
17+
18+
```bash
19+
make lint # shellcheck
20+
make test # both suites
21+
make install # symlink into /usr/local/bin (override with PREFIX=~/.local)
22+
```
23+
24+
## Good first issue: a Linux port
25+
26+
The one real limitation is that keypop is macOS-only (it uses `osascript` for the dialog). A
27+
Linux port would roughly triple the audience. The clean shape:
28+
29+
- Detect the platform and pick a dialog backend: `zenity` or `kdialog` on Linux, `osascript`
30+
on macOS.
31+
- The backend only has to do two things: a masked text prompt with a Reveal/Hide toggle, and a
32+
names-only confirmation dialog. Everything else (parsing, vault writes, check-first) is already
33+
platform-independent.
34+
- Keep it behind a small `ask_masked` / confirm abstraction so the rest of the script doesn't
35+
branch on OS.
36+
37+
If you pick this up, open an issue first so we can agree on the backend detection before you build.

Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
PREFIX ?= /usr/local
2+
3+
.PHONY: test lint install uninstall
4+
5+
test:
6+
./test-parse.sh
7+
./test-behavior.sh
8+
9+
lint:
10+
shellcheck --severity=warning keypop test-parse.sh test-behavior.sh
11+
12+
install:
13+
install -d "$(PREFIX)/bin"
14+
ln -sf "$(CURDIR)/keypop" "$(PREFIX)/bin/keypop"
15+
@echo "linked keypop -> $(PREFIX)/bin/keypop"
16+
17+
uninstall:
18+
rm -f "$(PREFIX)/bin/keypop"

keypop

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
# Vault location: $VAULT_FILE, default ~/.keypop/vault.env (chmod 600).
2222
# macOS only (uses osascript). Linux zenity/kdialog port welcome — see README.
2323
set -uo pipefail
24+
KEYPOP_VERSION="0.1.0"
2425
VAULT="${VAULT_FILE:-$HOME/.keypop/vault.env}"
2526

2627
usage() {
@@ -231,6 +232,7 @@ if [ "${BASH_SOURCE[0]}" = "$0" ]; then
231232
touch "$VAULT" && chmod 600 "$VAULT"
232233
case "${1:-}" in
233234
-h|--help) usage; exit 0 ;;
235+
-v|--version) echo "keypop $KEYPOP_VERSION"; exit 0 ;;
234236
-p|--paste) paste_mode ;;
235237
-i|--import) shift; import_mode "$@" ;;
236238
"") usage; exit 1 ;;

0 commit comments

Comments
 (0)