@pretense/cli 0.5.0 → 0.6.4

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 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
- # @pretense/cli
2
-
3
- AI firewall CLI that mutates proprietary code identifiers before sending to LLM APIs. Your code hits AI naked -- Pretense fixes that.
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm install -g @pretense/cli
9
- ```
10
-
11
- ## Quickstart
12
-
13
- ```bash
14
- # Initialize config in your project
15
- pretense init
16
-
17
- # Save a dashboard API key (read_write for mutation via proxy), or set PRETENSE_API_KEY
18
- pretense login --key YOUR_KEY
19
-
20
- # Start the proxy (default port 9339) — validates key before binding
21
- pretense start
22
-
23
- # Point your AI tools at the proxy
24
- export ANTHROPIC_BASE_URL=http://localhost:9339
25
- export OPENAI_BASE_URL=http://localhost:9339/v1
26
-
27
- # Scan a file for identifiers and secrets
28
- pretense scan src/
29
-
30
- # Mutate a file and print to stdout
31
- pretense mutate src/app.ts
32
-
33
- # Reverse mutations using stored map
34
- pretense reverse mutated-output.ts
35
-
36
- # View audit log
37
- pretense audit --json
38
-
39
- # Plan / quota (live when backend reachable; falls back offline)
40
- pretense status
41
- ```
42
-
43
- ## Commands
44
-
45
- | Command | Description |
46
- | --------------------------- | -------------------------------------------------------------- |
47
- | `pretense init` | Scan cwd, create `.pretense/` config |
48
- | `pretense login [--key …]` | Save dashboard API key to `~/.pretense/config.json` |
49
- | `pretense logout` | Remove saved dashboard API key |
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 |
59
-
60
- Env: **`PRETENSE_API_KEY`**, **`PRETENSE_API_URL`**, **`PRETENSE_API_TIMEOUT_MS`** (backend HTTP timeout, default 15s).
61
-
62
- ## Exit Codes
63
-
64
- - `0` -- Success
65
- - `1` -- Error
66
- - `2` -- Secrets found
67
-
68
- ## Learn More
69
-
70
- Visit [pretense.ai](https://pretense.ai) for documentation and enterprise features.
1
+ # pretense
2
+
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.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ npm i -g @pretense/cli
13
+ ```
14
+
15
+ Or with pnpm:
16
+
17
+ ```bash
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
31
+ pretense init
32
+ ```
33
+
34
+ 2. Scan for secrets and identifiers.
35
+
36
+ ```bash
37
+ pretense scan src
38
+ ```
39
+
40
+ 3. Start the proxy on port 9339.
41
+
42
+ ```bash
43
+ pretense start
44
+ ```
45
+
46
+ 4. Point your AI tool at the proxy. Example for Claude Code:
47
+
48
+ ```bash
49
+ export ANTHROPIC_BASE_URL=http://localhost:9339
50
+ claude
51
+ ```
52
+
53
+ 5. Check what got mutated.
54
+
55
+ ```bash
56
+ pretense audit --limit 20
57
+ ```
58
+
59
+ That is it. Your code is mutated outbound and reversed inbound.
60
+
61
+ ## Supported languages
62
+
63
+ TypeScript, JavaScript, Python, Go, Java, C#, Ruby, Rust.
64
+
65
+ ## Supported AI tools
66
+
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
80
+ ```
81
+
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
91
+
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.
97
+
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`.
100
+
101
+ ## License
102
+
103
+ MIT. See [LICENSE](./LICENSE).
104
+
105
+ ## Links
106
+
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
+ };