Files
reverse-engineering-anything/src/cli/erlangCommands.ts
T
morluto fa53f7070a refactor(cli): project view-delivery inspectors from their contracts (#10600)
* refactor(cli): project view-delivery inspectors from their contracts

* refactor(cli): project APK signature, desktop application and EVM inspectors from contracts (#10603)
2026-11-15 15:00:24 +08:00

41 lines
1.3 KiB
TypeScript

import type { Logger } from "pino";
import { CLI_COMMANDS } from "../cliCommandNames.js";
import { createBeamService } from "../composition/erlang.js";
import { ERLANG_BEAM_TOOL_CONTRACTS } from "../contracts/erlang/beamToolContracts.js";
import { contractNamed } from "./contractCliDescription.js";
import {
deliverWithService,
registerContractCommand,
} from "./contractCommand.js";
import type { CliInstance } from "./types.js";
/** Inspect operator-selected BEAM files through the same shared workflow as MCP. */
export const registerErlangCommands = (
cli: CliInstance,
logger: Logger,
): void => {
registerContractCommand(
cli,
logger,
contractNamed(ERLANG_BEAM_TOOL_CONTRACTS, "inspect_erlang_beam"),
{
command: CLI_COMMANDS.inspectErlangBeam,
description:
"Inspect Erlang BEAM atoms, exports, imports and Code header without executing bytecode",
positionals: ["path"],
callerPaths: ["path"],
evidenceDelivery: true,
viewDelivery: { invalidJson: "view must be valid JSON" },
fields: {
path: { description: "Local BEAM file" },
view: {
description:
"JSON beam view; requires --detail summary and --evidence_output",
},
},
},
deliverWithService(createBeamService, "rea-erlang-beam"),
);
};