troxy-cli 1.30.13 → 1.30.15
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/README.md +1 -1
- package/bin/troxy.js +17 -107
- package/package.json +2 -2
- package/src/mcps.js +2 -3
- package/src/simulate.js +5 -7
- package/src/tests/proxy-wiring.test.js +0 -6
package/README.md
CHANGED
package/bin/troxy.js
CHANGED
|
@@ -5,7 +5,6 @@ import { runMcp } from '../src/mcp-server.js';
|
|
|
5
5
|
import { runPause, runResume } from '../src/pause.js';
|
|
6
6
|
import { runLogin, clearSession, requireKey, requireJwt, loadSession, getKeySource } from '../src/auth.js';
|
|
7
7
|
import { loadConfig } from '../src/config.js';
|
|
8
|
-
import { runPolicies } from '../src/policies.js';
|
|
9
8
|
import { runMcps } from '../src/mcps.js';
|
|
10
9
|
import { runActivity } from '../src/activity.js';
|
|
11
10
|
import { runSettings } from '../src/settings.js';
|
|
@@ -307,7 +306,7 @@ switch (command) {
|
|
|
307
306
|
troxy pay --merchant <name> --amount <n> [options]
|
|
308
307
|
|
|
309
308
|
Simulates a payment evaluation request, identical to what your AI agent sends.
|
|
310
|
-
|
|
309
|
+
Login required.
|
|
311
310
|
|
|
312
311
|
By default, payments that come back ALLOW or NOTIFY are auto-confirmed as
|
|
313
312
|
successful charges, so rows land on their final badge in the dashboard
|
|
@@ -403,10 +402,6 @@ switch (command) {
|
|
|
403
402
|
break;
|
|
404
403
|
|
|
405
404
|
// ── Resources (read-only: --key or saved config; write: login) ─
|
|
406
|
-
case 'policies':
|
|
407
|
-
await runPolicies(positional, flags, multiFlags);
|
|
408
|
-
break;
|
|
409
|
-
|
|
410
405
|
case 'mcps':
|
|
411
406
|
await runMcps(positional, flags);
|
|
412
407
|
break;
|
|
@@ -516,12 +511,11 @@ switch (command) {
|
|
|
516
511
|
|
|
517
512
|
// ── Shorthand: troxy list [resource] ──────────────────────────
|
|
518
513
|
case 'list':
|
|
519
|
-
if (!sub || sub === 'policies') { await runPolicies(['list'], flags); break; }
|
|
520
514
|
if (sub === 'mcps') { await runMcps(['list'], flags); break; }
|
|
521
515
|
if (sub === 'activity') { await runActivity(flags); break; }
|
|
522
516
|
if (sub === 'approvals') { await runApprovals(['list'], flags); break; }
|
|
523
517
|
if (sub === 'secrets') { await runSecrets(['list'], flags); break; }
|
|
524
|
-
console.error(` Unknown resource: ${sub}. Try:
|
|
518
|
+
console.error(` Unknown resource: ${sub}. Try: mcps, activity, approvals, secrets\n`);
|
|
525
519
|
process.exit(1);
|
|
526
520
|
|
|
527
521
|
// ── Status ────────────────────────────────────────────────────
|
|
@@ -570,14 +564,13 @@ switch (command) {
|
|
|
570
564
|
const { account } = data;
|
|
571
565
|
console.log(`
|
|
572
566
|
Account
|
|
573
|
-
Active policies: ${account.active_policies}
|
|
574
567
|
MCPs total: ${account.total_mcps} (${account.connected_mcps} connected)
|
|
575
568
|
Requests 24h: ${account.requests_24h}
|
|
576
569
|
Default action: ${account.default_action}
|
|
577
570
|
`);
|
|
578
571
|
} catch { console.log(); }
|
|
579
572
|
} else {
|
|
580
|
-
console.log(' Account: not signed in. Run `troxy login` to
|
|
573
|
+
console.log(' Account: not signed in. Run `troxy login` to view usage and activity from the CLI.\n');
|
|
581
574
|
}
|
|
582
575
|
|
|
583
576
|
// Version check
|
|
@@ -771,106 +764,23 @@ switch (command) {
|
|
|
771
764
|
default:
|
|
772
765
|
if (command) console.error(` Unknown command: ${command}\n`);
|
|
773
766
|
console.log(`
|
|
774
|
-
Troxy:
|
|
775
|
-
|
|
776
|
-
This CLI has two parts:
|
|
777
|
-
- Commands below (policies, mcps, activity, ...) are for YOU to run and manage your account.
|
|
778
|
-
- "troxy mcp" starts the MCP server an AI agent connects to. You don't run it by hand;
|
|
779
|
-
MCP clients (Claude Desktop, etc.) launch it after "troxy init" configures them.
|
|
780
|
-
|
|
781
|
-
First time? Run these two commands in order:
|
|
782
|
-
1) npx troxy-cli init --key txy-... (get key from https://dash.troxy.io)
|
|
783
|
-
2) troxy login (start a 12h CLI session)
|
|
784
|
-
|
|
785
|
-
MCP setup (once per machine): troxy init --key <api-key>
|
|
786
|
-
Login for CLI commands (12h): troxy login
|
|
787
|
-
|
|
788
|
-
Setup (one time, API key required)
|
|
789
|
-
troxy init --key <api-key> Connect this machine as an MCP + save key
|
|
790
|
-
troxy init --key <api-key> --name "My Agent" Same, no interactive prompt
|
|
791
|
-
(for cloud/scripted agents that can't answer stdin)
|
|
792
|
-
troxy tools Scan for AI tools + report them to the dashboard
|
|
793
|
-
troxy restart Restart the MCP background service
|
|
794
|
-
troxy uninstall Remove Troxy from this machine
|
|
795
|
-
troxy status API health + MCP status (no login needed)
|
|
796
|
-
troxy update Update to the latest version
|
|
767
|
+
Troxy: make your Claude usage go further
|
|
797
768
|
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
connection above)
|
|
801
|
-
troxy proxy status Show whether it's on, and cert/interceptor health
|
|
802
|
-
troxy proxy enable --experimental Turn it on (installs a local CA cert)
|
|
803
|
-
troxy proxy disable Turn it off - removes the settings.json patch
|
|
804
|
-
|
|
805
|
-
Everything else requires: troxy login
|
|
806
|
-
|
|
807
|
-
MCP
|
|
808
|
-
troxy pause Pause this MCP (blocks all checkpoints)
|
|
809
|
-
troxy resume Resume this MCP
|
|
810
|
-
troxy mcps list All MCPs in your account
|
|
811
|
-
troxy mcps rename --name "x" Rename this machine's MCP
|
|
812
|
-
troxy mcps create --name "x" Create a key for another agent/machine
|
|
813
|
-
troxy mcps revoke --mcp "x" Revoke an MCP's key
|
|
814
|
-
troxy mcps pause/resume --mcp "x" Pause/resume any MCP (not just this one)
|
|
815
|
-
troxy mcps budget --mcp "x" --currency USD --limit 500
|
|
816
|
-
troxy mcps set-default-action --mcp "x" --action BLOCK
|
|
817
|
-
|
|
818
|
-
Keys
|
|
819
|
-
troxy rotate-key Rotate MCP key (revokes old, saves new locally)
|
|
820
|
-
|
|
821
|
-
Policies (all six checkpoints: payment, comms, access, destructive, model, secrets)
|
|
822
|
-
Admin-only: every write below requires --org. Personal and per-MCP policies
|
|
823
|
-
no longer exist - a policy is always org-wide or space-wide, and org acts as
|
|
824
|
-
a ceiling a space policy can never be looser than. list/describe/test need
|
|
825
|
-
no --org and show every org + space policy that applies to you.
|
|
826
|
-
troxy policies list / list --org
|
|
827
|
-
troxy policies describe --name "Block Amazon"
|
|
828
|
-
troxy policies templates (browse the built-in library)
|
|
829
|
-
troxy policies fields --domain secrets (see what each checkpoint supports)
|
|
830
|
-
troxy policies create --describe "block Amazon purchases over $200" --org (AI builder, payment/comms only)
|
|
831
|
-
troxy policies create --name "X" --template "Block a secret going somewhere public" --org
|
|
832
|
-
troxy policies create --name "X" --action BLOCK --domain payment --field amount --operator gte --value 500 --org
|
|
833
|
-
troxy policies create --name "X" --action BLOCK --domain access --field login_action --operator eq --value signup --org
|
|
834
|
-
troxy policies create --name "X" --action BLOCK --domain comms --or "field=recipient_domain,operator=contains,value=gmail.com" --org
|
|
835
|
-
troxy policies create --name "X" --action BLOCK --domain secrets --field has_api_key --operator eq --value true --org
|
|
836
|
-
troxy policies test --domain payment --field amount --operator gt --value 100 --example '{"amount": 150}'
|
|
837
|
-
troxy policies set-priority --name "X" --priority 10 --org
|
|
838
|
-
troxy policies pause --name "X" --org
|
|
839
|
-
troxy policies resume --name "X" --org
|
|
840
|
-
troxy policies delete --name "X" --org
|
|
841
|
-
(--org needs admin access; run 'troxy policies create --help' for the full condition syntax)
|
|
842
|
-
|
|
843
|
-
Approvals (ESCALATE holds)
|
|
844
|
-
troxy approvals list
|
|
845
|
-
troxy approvals approve --id <id>
|
|
846
|
-
troxy approvals decline --id <id>
|
|
847
|
-
|
|
848
|
-
Settings
|
|
849
|
-
troxy settings show
|
|
850
|
-
troxy settings set --default-action BLOCK --approval-timeout 4
|
|
851
|
-
|
|
852
|
-
LLM provider keys
|
|
853
|
-
troxy secrets list
|
|
854
|
-
troxy secrets set --name "OpenAI"
|
|
855
|
-
troxy secrets delete --name "OpenAI"
|
|
769
|
+
First time? Create a key at https://dash.troxy.io, then run:
|
|
770
|
+
npx troxy-cli init --key txy-...
|
|
856
771
|
|
|
857
|
-
|
|
858
|
-
troxy
|
|
859
|
-
troxy
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
troxy
|
|
863
|
-
troxy
|
|
864
|
-
troxy
|
|
772
|
+
Commands
|
|
773
|
+
troxy init --key <api-key> Connect this machine (add --name "My Mac" to skip the prompt)
|
|
774
|
+
troxy status Health and connection status
|
|
775
|
+
troxy update Update to the latest version
|
|
776
|
+
troxy uninstall Remove Troxy from this machine
|
|
777
|
+
troxy login Start a 12h CLI session for the commands below
|
|
778
|
+
troxy usage-bar [--period 7] Your usage and what Troxy saved
|
|
779
|
+
troxy activity [--limit 50] Recent requests
|
|
780
|
+
troxy insights [--period 7] Trends
|
|
865
781
|
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
troxy pay --merchant "Google" --amount 300 --category software
|
|
869
|
-
troxy send --recipient jane@gmail.com --body "the password is hunter2"
|
|
870
|
-
troxy signin --site coinbase.com --type signup
|
|
871
|
-
troxy action --verb delete --resource "prod users table" --items 500
|
|
872
|
-
troxy model-call --model claude-opus-5 --provider anthropic --cost 4.50
|
|
873
|
-
troxy scan --content "AWS_SECRET_ACCESS_KEY=..." --destination public --do push
|
|
782
|
+
In Claude Code: /troxy status, /troxy off, /troxy on
|
|
783
|
+
Help: https://docs.troxy.io or support@troxy.io
|
|
874
784
|
`);
|
|
875
785
|
process.exit(command ? 1 : 0);
|
|
876
786
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "troxy-cli",
|
|
3
|
-
"version": "1.30.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.30.15",
|
|
4
|
+
"description": "Make your Claude Code usage go further: lighter requests, less usage, less money",
|
|
5
5
|
"homepage": "https://troxy.io",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"email": "support@troxy.io"
|
package/src/mcps.js
CHANGED
|
@@ -49,18 +49,17 @@ export async function runMcps([sub, ...args], flags) {
|
|
|
49
49
|
if (!mcps.length) { console.log('\n No MCP connections yet.\n'); return; }
|
|
50
50
|
console.log();
|
|
51
51
|
table(
|
|
52
|
-
['Name', 'Prefix', 'Status', 'Last Seen', '
|
|
52
|
+
['Name', 'Prefix', 'Status', 'Last Seen', 'Default Action', 'Me'],
|
|
53
53
|
mcps.map(m => [
|
|
54
54
|
m.name,
|
|
55
55
|
m.token_prefix,
|
|
56
56
|
m.connected ? '● connected' : '○ offline',
|
|
57
57
|
m.last_seen,
|
|
58
|
-
m.policies_assigned,
|
|
59
58
|
m.default_action,
|
|
60
59
|
m.is_me ? '← you' : '',
|
|
61
60
|
]),
|
|
62
61
|
);
|
|
63
|
-
console.log(
|
|
62
|
+
console.log();
|
|
64
63
|
break;
|
|
65
64
|
}
|
|
66
65
|
|
package/src/simulate.js
CHANGED
|
@@ -47,7 +47,7 @@ const HELP = {
|
|
|
47
47
|
|
|
48
48
|
Simulates a message evaluation (/evaluate/email) - the checkpoint an agent
|
|
49
49
|
calls before sending on any channel: email, WhatsApp, Telegram, Slack,
|
|
50
|
-
Teams, Discord, SMS.
|
|
50
|
+
Teams, Discord, SMS. Login required.
|
|
51
51
|
|
|
52
52
|
Required:
|
|
53
53
|
--recipient <address> Who it's going to (address, phone, handle, or channel name)
|
|
@@ -65,8 +65,7 @@ const HELP = {
|
|
|
65
65
|
`,
|
|
66
66
|
signin: ` troxy signin --site <domain> [--type login|signup]
|
|
67
67
|
|
|
68
|
-
Simulates a login/signup evaluation (/evaluate/login).
|
|
69
|
-
Access & privacy policies. Login required.
|
|
68
|
+
Simulates a login/signup evaluation (/evaluate/login). Login required.
|
|
70
69
|
|
|
71
70
|
Required:
|
|
72
71
|
--site <domain> Site the agent is signing into (e.g. "coinbase.com")
|
|
@@ -82,7 +81,7 @@ const HELP = {
|
|
|
82
81
|
|
|
83
82
|
Simulates a consequential-action evaluation (/evaluate/action) - deletes,
|
|
84
83
|
drops, overwrites, force-pushes, grants, exports, and other actions with
|
|
85
|
-
real consequences.
|
|
84
|
+
real consequences. Login required.
|
|
86
85
|
|
|
87
86
|
Required:
|
|
88
87
|
--verb <verb> delete, drop, destroy, overwrite, force_push, share,
|
|
@@ -104,8 +103,7 @@ const HELP = {
|
|
|
104
103
|
'model-call': ` troxy model-call --model <id> --provider <name> [options]
|
|
105
104
|
|
|
106
105
|
Simulates a model-usage evaluation (/evaluate/model) - what an agent calls
|
|
107
|
-
before starting a run on a given model.
|
|
108
|
-
policies. Login required.
|
|
106
|
+
before starting a run on a given model. Login required.
|
|
109
107
|
|
|
110
108
|
Required:
|
|
111
109
|
--model <id> Model id, e.g. claude-opus-5
|
|
@@ -125,7 +123,7 @@ const HELP = {
|
|
|
125
123
|
Simulates a sensitive-data evaluation (/evaluate/secrets) - the checkpoint
|
|
126
124
|
an agent calls before sending, writing, or publishing content that might
|
|
127
125
|
contain a secret. Content is scanned server-side; you don't pre-classify it.
|
|
128
|
-
|
|
126
|
+
Login required.
|
|
129
127
|
|
|
130
128
|
Required:
|
|
131
129
|
--content <text> The text/code/data about to be sent or written
|
|
@@ -89,12 +89,6 @@ describe('bin/troxy.js: proxy subcommand wiring', () => {
|
|
|
89
89
|
assert.match(proxyBlock, /runProxyDisable/);
|
|
90
90
|
assert.match(proxyBlock, /runProxyStatus/);
|
|
91
91
|
});
|
|
92
|
-
|
|
93
|
-
it('is listed in the default help banner - init already enables it for real users', () => {
|
|
94
|
-
const helpBannerStart = binSrc.indexOf("Troxy: a secure control layer for AI agents");
|
|
95
|
-
const helpBanner = binSrc.slice(helpBannerStart);
|
|
96
|
-
assert.ok(helpBanner.includes('troxy proxy '), 'troxy proxy should appear in the printed help banner');
|
|
97
|
-
});
|
|
98
92
|
});
|
|
99
93
|
|
|
100
94
|
describe('uninstall.js: settings.json symmetry (fail-open layer 6)', () => {
|