@thirdfy/agent-cli 0.1.48 → 0.2.1

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +16 -1
  3. package/bin/thirdfy-agent.mjs +3 -5106
  4. package/package.json +17 -4
  5. package/scripts/validate-npm-pack.mjs +43 -0
  6. package/src/cli/errors.mjs +103 -0
  7. package/src/cli/flags.mjs +66 -0
  8. package/src/cli/help.mjs +89 -0
  9. package/src/cli/manifest.mjs +422 -0
  10. package/src/cli/options/agent.mjs +9 -0
  11. package/src/cli/options/analytics.mjs +5 -0
  12. package/src/cli/options/auth.mjs +10 -0
  13. package/src/cli/options/bootstrap.mjs +19 -0
  14. package/src/cli/options/chains.mjs +3 -0
  15. package/src/cli/options/credentials.mjs +15 -0
  16. package/src/cli/options/delegation.mjs +22 -0
  17. package/src/cli/options/execution.mjs +24 -0
  18. package/src/cli/options/global.mjs +16 -0
  19. package/src/cli/options/index.mjs +37 -0
  20. package/src/cli/options/polymarket.mjs +3 -0
  21. package/src/cli/options/tracking.mjs +18 -0
  22. package/src/cli/options/wallet.mjs +7 -0
  23. package/src/cli/program.mjs +5 -0
  24. package/src/cli/register.mjs +118 -0
  25. package/src/commands/agent.mjs +194 -0
  26. package/src/commands/bootstrap.mjs +762 -0
  27. package/src/commands/credentials.mjs +102 -0
  28. package/src/commands/delegation.mjs +355 -0
  29. package/src/commands/discovery.mjs +77 -0
  30. package/src/commands/doctor.mjs +320 -0
  31. package/src/commands/execute.mjs +255 -0
  32. package/src/commands/hyperliquid.mjs +51 -0
  33. package/src/commands/index.mjs +6 -0
  34. package/src/commands/polymarket.mjs +89 -0
  35. package/src/commands/prompt.mjs +33 -0
  36. package/src/commands/telemetry.mjs +146 -0
  37. package/src/commands/wallet.mjs +129 -0
  38. package/src/core/args.mjs +68 -0
  39. package/src/core/constants.mjs +31 -0
  40. package/src/core/context.mjs +145 -0
  41. package/src/core/envelope.mjs +20 -0
  42. package/src/core/http.mjs +77 -0
  43. package/src/core/index.mjs +6 -0
  44. package/src/core/runMode.mjs +72 -0
  45. package/src/runtime/actions/selection.mjs +339 -0
  46. package/src/runtime/agentExtract.mjs +52 -0
  47. package/src/runtime/authHelpers.mjs +53 -0
  48. package/src/runtime/bitfinexProbe.mjs +121 -0
  49. package/src/runtime/context.mjs +28 -0
  50. package/src/runtime/createThirdfyAgentRuntime.mjs +2 -0
  51. package/src/runtime/errors.mjs +3 -0
  52. package/src/runtime/execution/amounts.mjs +193 -0
  53. package/src/runtime/execution/lanes.mjs +75 -0
  54. package/src/runtime/execution/payloads.mjs +148 -0
  55. package/src/runtime/execution/runners.mjs +702 -0
  56. package/src/runtime/handlers.mjs +181 -0
  57. package/src/runtime/index.mjs +4 -0
  58. package/src/runtime/main.mjs +204 -0
  59. package/src/runtime/onboardingHints.mjs +54 -0
  60. package/src/runtime/owsSigning.mjs +118 -0
  61. package/src/runtime/providerHints.mjs +414 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thirdfy/agent-cli",
3
- "version": "0.1.48",
3
+ "version": "0.2.1",
4
4
  "description": "Thirdfy Agent CLI for onboarding, governance preflight, execute-intent, and status polling.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -8,21 +8,31 @@
8
8
  },
9
9
  "files": [
10
10
  "bin/",
11
+ "src/core/",
12
+ "src/commands/",
13
+ "src/cli/",
14
+ "src/runtime/",
11
15
  "src/utils/cli/",
12
16
  "src/contracts/cli/schemas/",
13
17
  "scripts/validate-cli-contract-schemas.mjs",
18
+ "scripts/validate-npm-pack.mjs",
14
19
  "README.md",
15
20
  "CHANGELOG.md",
16
21
  "LICENSE"
17
22
  ],
18
23
  "scripts": {
19
24
  "test": "node --test \"test/**/*.test.cjs\"",
20
- "lint": "node --check ./bin/thirdfy-agent.mjs",
25
+ "lint": "node --check ./bin/thirdfy-agent.mjs && node --check ./src/core/*.mjs && node --check ./src/commands/*.mjs && node --check ./src/cli/*.mjs && node --check ./src/cli/options/*.mjs && node --check ./src/runtime/*.mjs && node --check ./src/runtime/execution/*.mjs && node --check ./src/runtime/actions/*.mjs",
26
+ "validate:cli-manifest-handlers": "node ./scripts/validate-cli-manifest-handlers.mjs",
27
+ "validate:runtime-boundaries": "node ./scripts/validate-runtime-boundaries.mjs",
28
+ "validate:npm-pack": "node ./scripts/validate-npm-pack.mjs",
21
29
  "release:npm": "node ./scripts/release-npm.mjs",
22
30
  "publish:npm:local": "bash ./scripts/local-npm-publish.sh",
23
31
  "validate:public-docs": "node ./scripts/validate-public-docs.mjs",
24
32
  "validate:cli-contract-schemas": "node ./scripts/validate-cli-contract-schemas.mjs",
33
+ "validate:provider-parity": "node ./scripts/validate-provider-parity.mjs",
25
34
  "validate:actions": "node ./scripts/e2e/validate-actions.mjs",
35
+ "e2e:local-api:smoke": "node ./scripts/e2e/local-api-smoke.mjs",
26
36
  "e2e:base:simulate": "node ./scripts/e2e/base-simulate.mjs",
27
37
  "e2e:base:real": "node ./scripts/e2e/base-realtx.mjs",
28
38
  "e2e:delegation:discovery": "node ./scripts/e2e/delegation-discovery.mjs",
@@ -33,8 +43,10 @@
33
43
  "e2e:managed:delegation:parity": "node ./scripts/e2e/managed-custodial-lifecycle.mjs",
34
44
  "e2e:delegation:prod:certify": "node ./scripts/e2e/prod-delegation-certify.mjs",
35
45
  "e2e:report:last": "node ./scripts/e2e/report-last.mjs",
36
- "smoke:cli": "node ./bin/thirdfy-agent.mjs --help && node ./bin/thirdfy-agent.mjs --version --json",
37
- "prepublishOnly": "npm run validate:public-docs && npm run validate:cli-contract-schemas && npm run test && npm run smoke:cli"
46
+ "smoke:cli": "node ./bin/thirdfy-agent.mjs --help && node ./bin/thirdfy-agent.mjs -V && node ./bin/thirdfy-agent.mjs --version --json",
47
+ "validate:release-preflight": "npm run lint && npm run validate:public-docs && npm run validate:cli-contract-schemas && npm run validate:provider-parity && npm run validate:cli-manifest-handlers && npm run validate:runtime-boundaries && npm run test && npm run validate:npm-pack && npm run smoke:cli",
48
+ "validate:live-api-capabilities": "node ./scripts/validate-live-api-capabilities.mjs",
49
+ "prepublishOnly": "npm run validate:release-preflight"
38
50
  },
39
51
  "keywords": [
40
52
  "thirdfy",
@@ -57,6 +69,7 @@
57
69
  "homepage": "https://github.com/thirdfy/agent-cli#readme",
58
70
  "dependencies": {
59
71
  "@open-wallet-standard/core": "^1.3.0",
72
+ "commander": "^12.1.0",
60
73
  "ethers": "^6.16.0"
61
74
  }
62
75
  }
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env node
2
+ import { execSync } from 'child_process';
3
+ import fs from 'fs';
4
+ import os from 'os';
5
+ import path from 'path';
6
+ import { fileURLToPath } from 'url';
7
+
8
+ const requiredPaths = [
9
+ 'bin/thirdfy-agent.mjs',
10
+ 'src/core/index.mjs',
11
+ 'src/core/constants.mjs',
12
+ 'src/core/envelope.mjs',
13
+ 'src/utils/cli/intentNormalization.cjs',
14
+ 'src/contracts/cli/schemas/preflight.response.schema.json',
15
+ ];
16
+
17
+ const repoRoot = path.resolve(fileURLToPath(new URL('.', import.meta.url)), '..');
18
+ const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'thirdfy-agent-pack-'));
19
+
20
+ execSync('npm pack --pack-destination .', { cwd: repoRoot, stdio: 'pipe' });
21
+ const packed = fs.readdirSync(repoRoot).find((name) => name.endsWith('.tgz'));
22
+ if (!packed) {
23
+ console.error('npm pack did not produce a tarball');
24
+ process.exit(1);
25
+ }
26
+
27
+ const extractDir = path.join(tmpDir, 'package');
28
+ fs.mkdirSync(extractDir, { recursive: true });
29
+ const tarballPath = path.join(repoRoot, packed);
30
+ execSync(`tar -xzf ${JSON.stringify(tarballPath)} -C ${JSON.stringify(extractDir)}`, {
31
+ stdio: 'pipe',
32
+ });
33
+ fs.unlinkSync(tarballPath);
34
+
35
+ const packageRoot = path.join(extractDir, 'package');
36
+ const missing = requiredPaths.filter((rel) => !fs.existsSync(path.join(packageRoot, rel)));
37
+ if (missing.length) {
38
+ console.error('npm pack tarball missing required paths:');
39
+ for (const rel of missing) console.error(` - ${rel}`);
40
+ process.exit(1);
41
+ }
42
+
43
+ console.log('npm pack validation OK');
@@ -0,0 +1,103 @@
1
+ /**
2
+ * JSON-aware Commander exitOverride wiring.
3
+ */
4
+
5
+ function resolveJsonMode(program, getJsonMode) {
6
+ if (typeof getJsonMode === 'function' && getJsonMode()) return true;
7
+ if (process.argv.includes('--json')) return true;
8
+ try {
9
+ return Boolean(program.opts()?.json);
10
+ } catch {
11
+ return false;
12
+ }
13
+ }
14
+
15
+ export function configureCommanderErrors(program, deps) {
16
+ const { getJsonMode, printEnvelope, CLI_VERSION, getApiBase, collectRootFlags } = deps;
17
+
18
+ program.exitOverride((err) => {
19
+ const jsonMode = resolveJsonMode(program, getJsonMode);
20
+
21
+ if (err.code === 'commander.help' || err.code === 'commander.helpDisplayed') {
22
+ const rootFlags = typeof collectRootFlags === 'function' ? collectRootFlags(program) : {};
23
+ if (!rootFlags.version) {
24
+ program.outputHelp();
25
+ }
26
+ throw err;
27
+ }
28
+
29
+ if (err.code === 'commander.unknownCommand') {
30
+ if (jsonMode) {
31
+ printEnvelope({
32
+ success: false,
33
+ code: 'UNKNOWN_COMMAND',
34
+ message: err.message || 'Unknown command',
35
+ data: {},
36
+ meta: { version: CLI_VERSION, apiBase: getApiBase() },
37
+ });
38
+ }
39
+ throw err;
40
+ }
41
+
42
+ const optionErrors = new Set([
43
+ 'commander.unknownOption',
44
+ 'commander.optionMissingArgument',
45
+ 'commander.missingMandatoryOptionValue',
46
+ 'commander.missingArgument',
47
+ ]);
48
+
49
+ if (optionErrors.has(err.code)) {
50
+ if (jsonMode) {
51
+ printEnvelope({
52
+ success: false,
53
+ code: 'CLI_ARG_ERROR',
54
+ message: err.message || 'Invalid CLI arguments',
55
+ data: { commanderCode: err.code },
56
+ meta: { version: CLI_VERSION, apiBase: getApiBase() },
57
+ });
58
+ }
59
+ throw err;
60
+ }
61
+
62
+ throw err;
63
+ });
64
+
65
+ program.showHelpAfterError(!resolveJsonMode(program, getJsonMode));
66
+
67
+ return program;
68
+ }
69
+
70
+ /** Parse root version/json/api-base from argv without full Commander parse (avoids help noise). */
71
+ export function collectVersionFlagsFromArgv(argv = process.argv) {
72
+ const flags = {};
73
+ if (argv.includes('-V') || argv.includes('--version')) flags.version = true;
74
+ if (argv.includes('--json')) flags.json = true;
75
+ const apiIdx = argv.indexOf('--api-base');
76
+ if (apiIdx >= 0 && argv[apiIdx + 1]) flags.apiBase = argv[apiIdx + 1];
77
+ const envIdx = argv.indexOf('--env');
78
+ if (envIdx >= 0 && argv[envIdx + 1]) flags.env = argv[envIdx + 1];
79
+ return flags;
80
+ }
81
+
82
+ export async function handleRootOnlyFlows(program, deps, flagsOverride = null) {
83
+ const { collectRootFlags, prepareContextFromFlags, printEnvelope, CLI_VERSION, getApiBase } = deps;
84
+ const flags = flagsOverride || collectRootFlags(program);
85
+
86
+ if (flags.version) {
87
+ prepareContextFromFlags(flags);
88
+ if (flags.json) {
89
+ printEnvelope({
90
+ success: true,
91
+ code: 'OK',
92
+ message: 'thirdfy-agent version',
93
+ data: { version: CLI_VERSION },
94
+ meta: { apiBase: getApiBase() },
95
+ });
96
+ } else {
97
+ process.stdout.write(`${CLI_VERSION}\n`);
98
+ }
99
+ return true;
100
+ }
101
+
102
+ return false;
103
+ }
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Merge Commander opts from root + leaf command into legacy flags shape used by handlers.
3
+ */
4
+
5
+ function walkAncestors(command) {
6
+ const chain = [];
7
+ let current = command;
8
+ while (current) {
9
+ chain.unshift(current);
10
+ current = current.parent;
11
+ }
12
+ return chain;
13
+ }
14
+
15
+ function mergeOpts(commands) {
16
+ const merged = {};
17
+ for (const cmd of commands) {
18
+ Object.assign(merged, cmd.opts());
19
+ }
20
+ return merged;
21
+ }
22
+
23
+ export function collectRootFlags(program) {
24
+ return normalizeFlags(program.opts());
25
+ }
26
+
27
+ export function collectLegacyFlags(rootProgram, actionCommand, extra = {}) {
28
+ const chain = actionCommand ? walkAncestors(actionCommand) : [rootProgram];
29
+ const opts = { ...mergeOpts(chain), ...extra };
30
+ return normalizeFlags(opts);
31
+ }
32
+
33
+ function normalizeFlags(opts) {
34
+ const flags = { ...opts };
35
+
36
+ if (flags.version) flags.version = true;
37
+ if (flags.help) flags.help = true;
38
+ if (flags.json) flags.json = true;
39
+ if (flags.verbose) flags.verbose = true;
40
+ if (flags.broadcast) flags.broadcast = true;
41
+ if (flags.skipPreflight) flags.skipPreflight = true;
42
+ if (flags.allowWalletMismatch) flags.allowWalletMismatch = true;
43
+ if (flags.verify) flags.verify = true;
44
+ if (flags.includeOnchain) flags.includeOnchain = true;
45
+ if (flags.onchain) flags.includeOnchain = true;
46
+ if (flags.acceptTerms) flags.acceptTerms = true;
47
+ if (flags.all) flags.all = true;
48
+ if (flags.clearAgentKey) flags.clearAgentKey = true;
49
+ if (flags.noBootstrapAgent) flags.noBootstrapAgent = true;
50
+ if (flags.rotateAgentKey) flags.rotateAgentKey = true;
51
+ if (flags.notInteractive) flags.notInteractive = true;
52
+ if (flags.ni) flags.ni = true;
53
+
54
+ // Commander action args
55
+ if (flags.address !== undefined) {
56
+ flags.address = String(flags.address).trim();
57
+ }
58
+ if (Array.isArray(flags.query)) {
59
+ const tokens = flags.query.filter(Boolean).map(String);
60
+ flags.prompt = tokens.join(' ').trim();
61
+ } else if (flags.query !== undefined) {
62
+ flags.prompt = String(flags.query).trim();
63
+ }
64
+
65
+ return flags;
66
+ }
@@ -0,0 +1,89 @@
1
+ export function printHelp({ version }) {
2
+ const help = `
3
+ thirdfy-agent ${version}
4
+
5
+ Core commands:
6
+ thirdfy-agent profile init [--profile personal|builder|network] [--run-mode thirdfy|self|hybrid|agent_wallet] [--custody-mode managed|external] [--json]
7
+ thirdfy-agent profile use --profile <name> [--run-mode thirdfy|self|hybrid|agent_wallet] [--custody-mode managed|external] [--json]
8
+ thirdfy-agent profile show [--json]
9
+ thirdfy-agent config set --key <path> --value <value> [--json]
10
+ thirdfy-agent login [--auth-token <token> | --owner-session-token <token>] [--agent-api-key <key>] [--agent-key <key>] [--run-mode <mode>] [--custody-mode managed|external] [--wallet-address <addr>] [--json]
11
+ thirdfy-agent login email <address> [--code <otp>] [--accept-terms] [--key-name <name>] [--agent-key <key>] [--not-interactive|--ni] [--json]
12
+ thirdfy-agent logout [--all] [--clear-agent-key] [--json]
13
+ thirdfy-agent whoami [--json]
14
+ thirdfy-agent help onboarding [--json]
15
+ thirdfy-agent catalogs list [--json]
16
+ thirdfy-agent actions [--catalog <id>] [--provider <id>] [--agent-api-key <key>] [--chain-id <id>] [--run-mode <mode>] [--json]
17
+ thirdfy-agent data summary --agent-key <key> [--chain-id <id>] [--network <id>] [--category trading|yield|prediction] [--limit <n>] [--json]
18
+ thirdfy-agent analytics portfolio --agent-key <key> [--network base-mainnet] [--category trading|yield|prediction] [--json]
19
+ thirdfy-agent analytics leaderboard [--category trading|yield|prediction] [--network base-mainnet] [--window 24h|7d|30d|all] [--metric roiPct|pnlUsd|aprPct|currentValueUsd] [--json]
20
+ thirdfy-agent track actions --agent-key <key> [--limit <n>] [--json]
21
+ thirdfy-agent track events --agent-key <key> [--limit <n>] [--json]
22
+ thirdfy-agent track action --agent-api-key <key> --action <name> [--category <name>] [--source agent|external_mcp|operator|thirdfy|custom] [--provider <id>] [--protocol <id>] [--namespace <name>] [--action-type supported|custom] [--status observed|planned|skipped|submitted|confirmed|failed|blocked] [--chain-id <id>] [--params <json>] [--json]
23
+ thirdfy-agent delegation create [--auth-token <token> | --owner-session-token <token>] --agent-key <key> --owner-address <addr> --token-address <addr> --max-usd-per-day <usd> [--session-account-address <addr>] [--json]
24
+ thirdfy-agent delegation init-custodial [--auth-token <token> | --owner-session-token <token>] [--chain-id <id>] [--json]
25
+ thirdfy-agent delegation custodial-grant [--auth-token <token> | --owner-session-token <token>] --agent-key <key> --token-address <addr> --max-usd-per-day <usd> [--chain-id <id>] [--period-duration <sec>] [--expiry-seconds <sec>] [--json]
26
+ thirdfy-agent delegation activate [--auth-token <token> | --owner-session-token <token>] --agent-key <key> --wallet-address <addr> --session-account-address <addr> --delegation-manager <addr> --delegation <json> --signature <hex> [--json]
27
+ thirdfy-agent delegation status [--auth-token <token> | --owner-session-token <token>] --agent-key <key> [--verify] [--json]
28
+ thirdfy-agent delegation show [--auth-token <token> | --owner-session-token <token>] --agent-key <key> [--verify] [--json]
29
+ thirdfy-agent delegation inspect [--auth-token <token> | --owner-session-token <token>] --agent-key <key> [--verify] [--json]
30
+ thirdfy-agent delegation balance [--auth-token <token> | --owner-session-token <token>] --agent-key <key> [--chain-id <id>] [--json]
31
+ thirdfy-agent delegation revoke [--auth-token <token> | --owner-session-token <token>] --agent-key <key> [--reason <text>] [--chain-id <id>] [--json]
32
+ thirdfy-agent delegation redeem --agent-api-key <key> --action <id> --params <json> [--run-mode thirdfy|hybrid|agent_wallet] [--estimated-amount-usd <usd>] [--json]
33
+ thirdfy-agent managed wallet init [--auth-token <token> | --owner-session-token <token>] [--chain-id <id>] [--json]
34
+ thirdfy-agent managed wallet grant [--auth-token <token> | --owner-session-token <token>] --agent-key <key> --token-address <addr> --max-usd-per-day <usd> [--chain-id <id>] [--period-duration <sec>] [--expiry-seconds <sec>] [--json]
35
+ thirdfy-agent managed setup [--auth-token <token> | --owner-session-token <token>] --agent-key <key> [--run-mode thirdfy|hybrid|agent_wallet] [--token-address <addr>] [--max-usd-per-day <usd>] [--chain-id <id>] [--json]
36
+ thirdfy-agent wallet execute --agent-api-key <key> --user-did <did> --action <id> --params <json> [--chain-id <id>] [--idempotency-key <key>] [--wallet-address <expected>] [--allow-wallet-mismatch] [--json]
37
+ thirdfy-agent wallet list [--json]
38
+ thirdfy-agent polymarket status [--agent-key <key>] [--amount-pusd <n>] [--json]
39
+ thirdfy-agent polymarket setup [--agent-key <key>] [--params <json>] [--json]
40
+ thirdfy-agent polymarket dry-run --params <json> [--action place_polymarket_order] [--json]
41
+ thirdfy-agent wallet sign --agent-api-key <key> --action <id> --params <json> [--chain-id <id>] [--json]
42
+ thirdfy-agent wallet submit --signed-tx-hex <hex> [--chain-id <id>] [--rpc-url <url>] [--json]
43
+ thirdfy-agent agent run --agent-api-key <key> --action <id> --params <json> [--signer-method managed_wallet_server|byow|fanout_intent] [--strategy-intent single_wallet|fanout] [--run-mode <mode>] [--user-did <did>] [--json]
44
+ thirdfy-agent credentials upsert --auth-token <token> --venue <id> --api-key <key> --api-secret <secret> [--permission-profile funding|spot] [--credential-ref <ref>] [--verify-permissions] [--skip-permissions-probe] [--bitfinex-base-url <url>] [--json]
45
+ thirdfy-agent credentials status --auth-token <token> [--venue <id>] [--json]
46
+ thirdfy-agent agent auth challenge --agent-key <key> [--wallet-address <addr>] [--chain-id <id>] [--json]
47
+ thirdfy-agent agent auth verify --challenge-id <id> --signature <hex> --agent-key <key> [--wallet-address <addr>] [--json]
48
+ thirdfy-agent bootstrap begin --agent-key <key> [--wallet-address <addr>] [--chain-id <id>] [--json]
49
+ thirdfy-agent bootstrap complete --agent-key <key> [--proof-type session_token|wallet_signature] [--lane self|hybrid|thirdfy|agent_wallet] [--owner-session-token <token> | --auth-token <token> | --challenge-id <id> --signature <hex>] [--name <agent-name>] [--mcp-base <url>] [--json]
50
+ thirdfy-agent onboarding begin ... # alias of bootstrap begin
51
+ thirdfy-agent onboarding complete ... # alias of bootstrap complete
52
+ thirdfy-agent developer bootstrap --agent-key <key> --name <name> [--owner-session-token <token> | --challenge-id <id> --signature <hex>] [--json]
53
+ thirdfy-agent agent register --agent-key <key> --name <name> [--auth-token <token> | --owner-session-token <token>] [--json]
54
+ thirdfy-agent agent key rotate [--agent-key <key>] [--auth-token <token> | --owner-session-token <token>] [--json]
55
+ thirdfy-agent agent key revoke [--agent-key <key>] [--auth-token <token> | --owner-session-token <token>] [--json]
56
+ thirdfy-agent preflight --agent-api-key <key> --action <id> --params <json> [--run-mode <mode>] [--json]
57
+ thirdfy-agent run --agent-api-key <key> --action <id> --params <json> [--run-mode <mode>] [--broadcast] [--idempotency-key <key>] [--json]
58
+ thirdfy-agent self-exec --agent-api-key <key> --action <id> --params <json> --wallet-address <addr> --ows-wallet-name <name> [--rpc-url <url>] [--effect-check strict|relaxed|off] [--json]
59
+ thirdfy-agent doctor self [--wallet-address <addr>] [--ows-wallet-name <name>] [--rpc-url <url>] [--json]
60
+ thirdfy-agent doctor auth [--json]
61
+ thirdfy-agent jeff preflight --agent-api-key <key> --action <id> --params <json> [--run-mode <mode>] [--json]
62
+ thirdfy-agent jeff trade --agent-api-key <key> --action <id> --params <json> [--run-mode <mode>] [--json]
63
+ thirdfy-agent jeff status --intent-id <id> [--json]
64
+ thirdfy-agent prompt "<natural language prompt>" [--json]
65
+ thirdfy-agent intent-status --intent-id <id> [--json]
66
+ thirdfy-agent credits balance --auth-token <token> [--json]
67
+
68
+ Global flags:
69
+ --api-base <url> default: https://api.thirdfy.com
70
+ --mcp-base <url> default: https://mcp.thirdfy.com (bootstrap token issuance)
71
+ --run-mode <mode> thirdfy | self | hybrid | agent_wallet
72
+ --hybrid-wallet-mode <mode> self | agent_wallet (only with --run-mode hybrid)
73
+ --custody-mode <mode> managed | external
74
+ --profile <name> personal | builder | network
75
+ --env <file> load env vars from file
76
+ --timeout <ms> request timeout
77
+ --params <json> for swap: amountInRaw + tokenInDecimals, or amountInHuman + tokenInDecimals, or legacy human amountIn (decimal string)
78
+ --broadcast with run --run-mode self, sign and broadcast using OWS
79
+ --user-did <did> required for managed wallet server execution paths
80
+ --allow-wallet-mismatch bypass strict funded-wallet vs execution-wallet guard
81
+ --effect-check <mode> self-exec check mode: strict | relaxed | off (default: relaxed)
82
+ --owner-session-token <token> owner session token (or THIRDFY_OWNER_SESSION_TOKEN)
83
+ --not-interactive, --ni fail fast when required login input is missing
84
+ --json stable machine-readable output
85
+ --verbose print adapter diagnostics
86
+ --version print version
87
+ `.trim();
88
+ process.stdout.write(`${help}\n`);
89
+ }