@pretense/cli 0.4.0 → 0.6.2
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 +82 -42
- package/dist/chunk-TWMRHZGM.js +44 -0
- package/dist/ed25519-XYI7WRQL.js +551 -0
- package/dist/index.js +19283 -3552
- package/dist/postinstall.js +14 -0
- package/package.json +39 -14
- package/dist/index.d.ts +0 -2
- package/dist/index.js.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Jimmy Malhan
|
|
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,70 +1,110 @@
|
|
|
1
|
-
#
|
|
1
|
+
# pretense
|
|
2
2
|
|
|
3
|
-
AI firewall
|
|
3
|
+
Local-first AI firewall. Mutates proprietary code before it leaves your laptop.
|
|
4
|
+
|
|
5
|
+
Your `getUserPaymentMethod` becomes `_fn8a3c` on the wire to Claude, Codex, Cursor, or any OpenAI-compatible API. The reply gets reversed back to your real names. The LLM never sees your real names. Comments and strings stay byte-exact.
|
|
6
|
+
|
|
7
|
+
Think locked garage. Your car never leaves.
|
|
4
8
|
|
|
5
9
|
## Install
|
|
6
10
|
|
|
7
11
|
```bash
|
|
8
|
-
npm
|
|
12
|
+
npm i -g @pretense/cli
|
|
9
13
|
```
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
Or with pnpm:
|
|
12
16
|
|
|
13
17
|
```bash
|
|
14
|
-
|
|
18
|
+
pnpm add -g @pretense/cli
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Both install the `pretense` command — the package name is scoped, the binary is not.
|
|
22
|
+
|
|
23
|
+
Requires Node.js 20 or newer.
|
|
24
|
+
|
|
25
|
+
## First 5 minutes
|
|
26
|
+
|
|
27
|
+
1. Initialize Pretense in your repo.
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
cd your-project
|
|
15
31
|
pretense init
|
|
32
|
+
```
|
|
16
33
|
|
|
17
|
-
|
|
18
|
-
pretense login --key YOUR_KEY
|
|
34
|
+
2. Scan for secrets and identifiers.
|
|
19
35
|
|
|
20
|
-
|
|
36
|
+
```bash
|
|
37
|
+
pretense scan src
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
3. Start the proxy on port 9339.
|
|
41
|
+
|
|
42
|
+
```bash
|
|
21
43
|
pretense start
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
4. Point your AI tool at the proxy. Example for Claude Code:
|
|
22
47
|
|
|
23
|
-
|
|
48
|
+
```bash
|
|
24
49
|
export ANTHROPIC_BASE_URL=http://localhost:9339
|
|
25
|
-
|
|
50
|
+
claude
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
5. Check what got mutated.
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pretense audit --limit 20
|
|
57
|
+
```
|
|
26
58
|
|
|
27
|
-
|
|
28
|
-
pretense scan src/
|
|
59
|
+
That is it. Your code is mutated outbound and reversed inbound.
|
|
29
60
|
|
|
30
|
-
|
|
31
|
-
pretense mutate src/app.ts
|
|
61
|
+
## Supported languages
|
|
32
62
|
|
|
33
|
-
|
|
34
|
-
pretense reverse mutated-output.ts
|
|
63
|
+
TypeScript, JavaScript, Python, Go, Java, C#, Ruby, Rust.
|
|
35
64
|
|
|
36
|
-
|
|
37
|
-
pretense audit --json
|
|
65
|
+
## Supported AI tools
|
|
38
66
|
|
|
39
|
-
|
|
40
|
-
|
|
67
|
+
Anything that talks to an OpenAI-compatible API. Claude Code, Codex CLI, Cursor, Copilot CLI, Continue, Aider, custom scripts. Set the base URL to `http://localhost:9339` and you are done.
|
|
68
|
+
|
|
69
|
+
## Common commands
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
pretense init Initialize .pretense/ in current dir
|
|
73
|
+
pretense scan <file|dir> Scan for secrets and identifiers
|
|
74
|
+
pretense mutate <file> Preview a mutation
|
|
75
|
+
pretense reverse <file> Reverse a mutation using the saved map
|
|
76
|
+
pretense start Start the proxy on port 9339
|
|
77
|
+
pretense status Show plan, quota, seat usage
|
|
78
|
+
pretense audit View the audit log
|
|
79
|
+
pretense --version Print the CLI version
|
|
41
80
|
```
|
|
42
81
|
|
|
43
|
-
|
|
82
|
+
Run `pretense <command> --help` for command-specific help.
|
|
83
|
+
|
|
84
|
+
## How it works
|
|
85
|
+
|
|
86
|
+
Pretense runs a tiny proxy on `localhost:9339`. Outbound requests to LLM APIs get parsed. Identifiers (variables, functions, classes) get hashed to deterministic stand-ins like `_v8a3c`, `_fn8a3c`, `_cls8a3c`. Comments and string literals are left alone. The LLM response gets passed through a reverse map so your editor sees real names again.
|
|
87
|
+
|
|
88
|
+
No code touches our servers. Your mutation map lives in `.pretense/` in your repo. Same as `.git/`.
|
|
89
|
+
|
|
90
|
+
## Plan limits
|
|
44
91
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
| `pretense start` | Validate key, start proxy on `:9339` |
|
|
51
|
-
| `pretense scan <file\|dir>` | Scan for identifiers + secrets |
|
|
52
|
-
| `pretense mutate <file>` | Redact scanner hits (secrets/PII), mutate identifiers → stdout |
|
|
53
|
-
| `pretense reverse <file>` | Reverse using stored map |
|
|
54
|
-
| `pretense audit` | Print audit log |
|
|
55
|
-
| `pretense status` | Plan, quota, usage (`usage` is an alias) |
|
|
56
|
-
| `pretense credits` | Remaining mutation budget (`tokens` is an alias) |
|
|
57
|
-
| `pretense upgrade` | Compare plans / upgrade |
|
|
58
|
-
| `pretense version` | Print version |
|
|
92
|
+
Free: 1,000 mutations per 7-day rolling window.
|
|
93
|
+
Pro: 100,000 mutations per 7-day rolling window. $23 per seat per month billed
|
|
94
|
+
annually ($276/seat/year), or $29 per seat billed monthly.
|
|
95
|
+
Enterprise: unlimited. $79 per seat per month billed annually ($948/seat/year),
|
|
96
|
+
or $99 per seat billed monthly. Contact sales for SSO, audit export, custom rules.
|
|
59
97
|
|
|
60
|
-
|
|
98
|
+
Check what you have left with `pretense credits` (alias: `pretense tokens`), see the
|
|
99
|
+
full usage table with `pretense usage`, and compare plans with `pretense upgrade`.
|
|
61
100
|
|
|
62
|
-
##
|
|
101
|
+
## License
|
|
63
102
|
|
|
64
|
-
|
|
65
|
-
- `1` -- Error
|
|
66
|
-
- `2` -- Secrets found
|
|
103
|
+
MIT. See [LICENSE](./LICENSE).
|
|
67
104
|
|
|
68
|
-
##
|
|
105
|
+
## Links
|
|
69
106
|
|
|
70
|
-
|
|
107
|
+
- Homepage: https://pretense.ai
|
|
108
|
+
- Docs: https://pretense.ai/docs
|
|
109
|
+
- Source: https://github.com/jimmymalhan/pretense
|
|
110
|
+
- Issues: https://github.com/jimmymalhan/pretense/issues
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __esm = (fn, res) => function __init() {
|
|
9
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
10
|
+
};
|
|
11
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
12
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
+
mod
|
|
29
|
+
));
|
|
30
|
+
|
|
31
|
+
// ../node_modules/.pnpm/tsup@8.5.1_jiti@1.21.7_postcss@8.5.8_tsx@4.21.0_typescript@5.9.3_yaml@2.8.3/node_modules/tsup/assets/esm_shims.js
|
|
32
|
+
import path from "path";
|
|
33
|
+
import { fileURLToPath } from "url";
|
|
34
|
+
var init_esm_shims = __esm({
|
|
35
|
+
"../node_modules/.pnpm/tsup@8.5.1_jiti@1.21.7_postcss@8.5.8_tsx@4.21.0_typescript@5.9.3_yaml@2.8.3/node_modules/tsup/assets/esm_shims.js"() {
|
|
36
|
+
"use strict";
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export {
|
|
41
|
+
__commonJS,
|
|
42
|
+
__toESM,
|
|
43
|
+
init_esm_shims
|
|
44
|
+
};
|