MCPcopy Create free account
hub / github.com/JaredStewart/coderlm / cmd_exec

Function cmd_exec

plugin/skills/coderlm/scripts/coderlm_cli.py:503–528  ·  view source on GitHub ↗

Execute Python code with helper functions in scope.

(args: argparse.Namespace)

Source from the content-addressed store, hash-verified

501
502
503def cmd_exec(args: argparse.Namespace) -> None:
504 """Execute Python code with helper functions in scope."""
505 code = args.code
506 if not code:
507 print("ERROR: --code argument is required", file=sys.stderr)
508 sys.exit(1)
509
510 exec_globals = {
511 "__builtins__": __builtins__,
512 "search": search,
513 "impl_": impl_,
514 "callers": callers,
515 "tests": tests,
516 "grep": grep,
517 "symbols": symbols,
518 "peek_file": peek_file,
519 "structure": structure,
520 "variables_list": variables_list,
521 "json": json,
522 }
523
524 try:
525 exec(code, exec_globals)
526 except Exception as e:
527 print(f"ERROR: {type(e).__name__}: {e}", file=sys.stderr)
528 sys.exit(1)
529
530
531# ── Parser ────────────────────────────────────────────────────────────

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected