MCPcopy
hub / github.com/HKUDS/DeepCode / launch_docker_cli

Function launch_docker_cli

deepcode.py:523–550  Ā·  view source on GitHub ↗

Launch DeepCode CLI inside Docker container

()

Source from the content-addressed store, hash-verified

521
522
523def launch_docker_cli():
524 """Launch DeepCode CLI inside Docker container"""
525 current_dir, compose_file, compose_args = _check_docker_prerequisites()
526
527 print("šŸ–„ļø Starting DeepCode CLI in Docker...")
528 print("=" * 50)
529
530 try:
531 # Check if image exists (auto-build on first run)
532 result = subprocess.run(
533 compose_args + ["images", "-q"], capture_output=True, text=True
534 )
535 if not result.stdout.strip():
536 print(
537 "šŸ“¦ First run detected — building Docker image (may take a few minutes)..."
538 )
539 subprocess.run(compose_args + ["build"], check=True)
540
541 # Run CLI interactively
542 subprocess.run(
543 compose_args + ["run", "--rm", "-it", "deepcode", "cli"], check=True
544 )
545
546 except subprocess.CalledProcessError as e:
547 print(f"\nāŒ Docker failed: {e}")
548 sys.exit(1)
549 except KeyboardInterrupt:
550 print("\nšŸ›‘ Cancelled")
551
552
553def launch_paper_test(paper_name: str, fast_mode: bool = False):

Callers 1

mainFunction Ā· 0.85

Calls 2

_check_docker_prerequisitesFunction Ā· 0.85
runMethod Ā· 0.80

Tested by

no test coverage detected