MCPcopy Index your code
hub / github.com/OpenOSINT/OpenOSINT / _async_main

Function _async_main

openosint/cli.py:676–737  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

674
675
676async def _async_main() -> None:
677 parser = _build_parser()
678 args = parser.parse_args()
679 _configure_logging(args.verbose)
680
681 # No subcommand or explicit 'shell' → launch REPL.
682 # Await directly — run_repl() is a sync wrapper that calls asyncio.run()
683 # internally, which raises RuntimeError when called from a running event loop.
684 if args.command in (None, "shell"):
685 from openosint.repl import OpenOSINTRepl
686
687 repl = OpenOSINTRepl(
688 api_key=getattr(args, "api_key", None),
689 provider=getattr(args, "provider", "anthropic"),
690 ollama_model=getattr(args, "ollama_model", "llama3.2"),
691 ollama_host=getattr(args, "ollama_host", "http://localhost:11434"),
692 is_pdf_disabled=getattr(args, "is_pdf_disabled", False),
693 )
694 await repl.run()
695 return
696
697 is_parallel = getattr(args, "is_parallel", False)
698 json_output = getattr(args, "json_output", False)
699 is_pdf_disabled = getattr(args, "is_pdf_disabled", False)
700
701 if args.command == "email":
702 await _handle_email(
703 args.target, args.timeout, is_parallel=is_parallel, json_output=json_output
704 )
705 elif args.command == "username":
706 await _handle_username(
707 args.target, args.timeout, is_parallel=is_parallel, json_output=json_output
708 )
709 elif args.command == "shodan":
710 await _handle_shodan(args.query, args.timeout, json_output=json_output)
711 elif args.command == "virustotal":
712 await _handle_virustotal(args.target, args.timeout, json_output=json_output)
713 elif args.command == "censys":
714 await _handle_censys(args.target, args.timeout, json_output=json_output)
715 elif args.command == "github":
716 await _handle_github(args.query, args.timeout, json_output=json_output)
717 elif args.command == "dns":
718 await _handle_dns(args.domain, args.timeout, json_output=json_output)
719 elif args.command == "abuseipdb":
720 await _handle_abuseipdb(args.ip, args.timeout, json_output=json_output)
721 elif args.command == "ip2location":
722 await _handle_ip2location(args.ip, args.timeout, json_output=json_output)
723 elif args.command == "multi":
724 await _handle_multi(
725 args.targets, api_key=getattr(args, "api_key", None), is_pdf_disabled=is_pdf_disabled
726 )
727 elif args.command == "web":
728 await _handle_web(
729 host=getattr(args, "host", "0.0.0.0"),
730 port=getattr(args, "port", 8080),
731 no_browser=getattr(args, "no_browser", False),
732 )
733 elif args.command == "history":

Callers 1

mainFunction · 0.85

Calls 15

runMethod · 0.95
OpenOSINTReplClass · 0.90
_build_parserFunction · 0.85
_configure_loggingFunction · 0.85
_handle_emailFunction · 0.85
_handle_usernameFunction · 0.85
_handle_shodanFunction · 0.85
_handle_virustotalFunction · 0.85
_handle_censysFunction · 0.85
_handle_githubFunction · 0.85
_handle_dnsFunction · 0.85
_handle_abuseipdbFunction · 0.85

Tested by

no test coverage detected