INNER CODE UNIT · Python

run_interactive

tomtommyyuan/spmind · spmind/cli.py:195

def run_interactive(agent, initial_prompt: str | None = None, verbose: bool = False):
    """Run interactive mode like Claude Code."""
    import shutil
    from spmind.version import __version__

    # Get terminal width
    term_width = shutil.get_terminal_size().columns

    # Print welcome banner
    print()
    print(f"\033[1;36m╭{'─' * (term_width - 2)}╮\033[0m")
    print(f"\033[1;36m│\033[0m{' ' * (term_width - 2)}\033[1;36m│\033[0m")
    title = f"🧬 SP-Mind v{__version__}"
    padding = (term_width - 2 - len(title) + 2) // 2  # +2 for emoji width
    print(f"\033[1;36m│\033[0m{' ' * padding}\033[1m{title}\033[0m{' ' * (term_width - 2 - padding - len(title) + 2)}\033[1;36m│\033[0m")
    subtitle = "Spatial Proteomics AI Agent (Claude Agent SDK)"
    padding2 = (term_width - 2 - len(subtitle)) // 2
    print(f"\033[1;36m│\033[0m{' ' * padding2}\033[90m{subtitle}\033[0m{' ' * (term_width - 2 - padding2 - len(subtitle))}\033[1;36m│\033[0m")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…