MCPcopy Index your code
hub / github.com/BlockRunAI/ClawRouter / main

Function main

src/cli.ts:824–1115  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

822}
823
824async function main(): Promise<void> {
825 const args = parseArgs(process.argv.slice(2));
826
827 if (args.version) {
828 console.log(VERSION);
829 process.exit(0);
830 }
831
832 if (args.help) {
833 printHelp();
834 process.exit(0);
835 }
836
837 if (args.setup) {
838 await cmdSetup();
839 process.exit(0);
840 }
841
842 // Query commands — talk to running proxy
843 const queryPort = args.port ?? getProxyPort();
844
845 if (args.queryStatus) {
846 await cmdStatus(queryPort);
847 process.exit(0);
848 }
849 if (args.queryWallet) {
850 await cmdWallet(queryPort);
851 process.exit(0);
852 }
853 if (args.queryModels) {
854 await cmdModels(queryPort);
855 process.exit(0);
856 }
857 if (args.queryStats) {
858 await cmdStats(queryPort, args.queryStatsDays);
859 process.exit(0);
860 }
861 if (args.queryCache) {
862 await cmdCache(queryPort);
863 process.exit(0);
864 }
865
866 if (args.share) {
867 await cmdShare(queryPort, args.shareTarget, args.sharePreset, args.shareLimit, args.shareAll);
868 process.exit(0);
869 }
870
871 if (args.phone) {
872 if (!args.phoneSubcommand) {
873 console.error("✗ Usage: clawrouter phone <numbers|lookup|fraud> ...");
874 console.error(" See: clawrouter --help");
875 process.exit(1);
876 }
877 await cmdPhone(
878 queryPort,
879 args.phoneSubcommand,
880 args.phoneNumbersAction,
881 args.phoneArg,

Callers 1

cli.tsFile · 0.70

Calls 15

parseArgsFunction · 0.85
printHelpFunction · 0.85
cmdSetupFunction · 0.85
getProxyPortFunction · 0.85
cmdStatusFunction · 0.85
cmdWalletFunction · 0.85
cmdModelsFunction · 0.85
cmdStatsFunction · 0.85
cmdCacheFunction · 0.85
cmdShareFunction · 0.85
cmdPhoneFunction · 0.85
runDoctorFunction · 0.85

Tested by

no test coverage detected