From 04855db36cb732f38d81d62c59fe7430d3ee8939 Mon Sep 17 00:00:00 2001
From: Dan Lynch
Date: Thu, 26 Nov 2026 00:41:00 -0800
Subject: [PATCH 1/2] docs: lead the README with `npm install -g decryption`
An Install section right under the intro, and an npm badge (with alt text)
for the `decryption` package in the header.
Co-Authored-By: Claude Opus 5.5
Claude-Session: https://claude.ai/code/session_019wEzZBbFjjLJHLB8mXa7xL
---
README.md | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/README.md b/README.md
index c920466..6a76896 100644
--- a/README.md
+++ b/README.md
@@ -11,6 +11,9 @@
+
+
+
Dependency-light building blocks for mnemonics, envelope encryption, Shamir secret sharing and team
@@ -21,6 +24,16 @@ Constructive endpoint you name.
The primitives have been audited upstream; the formats and tools built on them here have not. See
[Audit status](#audit-status) for exactly where that line is.
+## Install
+
+```bash
+npm install -g decryption
+dcrypt --help
+```
+
+That installs the `dcrypt` command. To try it without installing, run `npx decryption --help`. For the
+libraries, install the scoped packages below, e.g. `npm install @decryption/core`.
+
## Packages
| Package | npm | Source | Description |
From 433eda57389f8887066549ed7bcad5c3c78686e7 Mon Sep 17 00:00:00 2001
From: Dan Lynch
Date: Thu, 26 Nov 2026 00:41:00 -0800
Subject: [PATCH 2/2] fix(decryption): `require('decryption')` returns the CLI
API instead of running dcrypt
index.js is both the `dcrypt` bin and the package's `main`. It now runs the
CLI only when executed as a command, and otherwise exports @decryption/cli.
Co-Authored-By: Claude Opus 5.5
Claude-Session: https://claude.ai/code/session_019wEzZBbFjjLJHLB8mXa7xL
---
packages/cli/__tests__/main.test.ts | 3 ++-
packages/decryption/index.js | 13 ++++++++++---
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/packages/cli/__tests__/main.test.ts b/packages/cli/__tests__/main.test.ts
index 8db956c..451ddd6 100644
--- a/packages/cli/__tests__/main.test.ts
+++ b/packages/cli/__tests__/main.test.ts
@@ -12,6 +12,7 @@ describe('main', () => {
it('is what the decryption package runs', () => {
const wrapper = readFileSync(join(__dirname, '../../decryption/index.js'), 'utf8');
- expect(wrapper).toContain("require('@decryption/cli').main()");
+ expect(wrapper).toContain("require('@decryption/cli')");
+ expect(wrapper).toContain('cli.main()');
});
});
diff --git a/packages/decryption/index.js b/packages/decryption/index.js
index 4d5e907..e310a9c 100755
--- a/packages/decryption/index.js
+++ b/packages/decryption/index.js
@@ -1,4 +1,11 @@
#!/usr/bin/env node
-// `npm install -g decryption` installs the `dcrypt` command from @decryption/cli.
-// This package holds no code of its own; it runs the CLI at the exact version it depends on.
-require('@decryption/cli').main();
+// `decryption` is the entry point: `npm install -g decryption` installs the `dcrypt` command, and
+// `require('decryption')` gives you the @decryption/cli API. This package holds no code of its own;
+// it runs the CLI at the exact version it depends on.
+const cli = require('@decryption/cli');
+
+if (require.main === module) {
+ cli.main();
+} else {
+ module.exports = cli;
+}