Skip to main content
Glama
AIDC-AI

pixelle-mcp-Image-generation

by AIDC-AI
menu.pyโ€ข4.49 kB
# Copyright (C) 2025 AIDC-AI # This project is licensed under the MIT License (SPDX-License-identifier: MIT). """Main menu for interactive mode.""" import questionary from pathlib import Path from rich.console import Console from rich.panel import Panel from pixelle.cli.utils.display import show_header_info, show_current_config, show_enhanced_help from pixelle.cli.utils.server_utils import start_pixelle_server, check_service_status from pixelle.cli.interactive.wizard import run_fresh_setup_wizard console = Console() def show_main_menu(): """Show main menu""" # Show header information show_header_info() console.print("\n๐Ÿ“‹ [bold]Current configuration status[/bold]") show_current_config() action = questionary.select( "Please select the action to perform:", choices=[ questionary.Choice("๐Ÿš€ [start] Start Pixelle MCP", "start"), questionary.Choice("๐Ÿ”„ [init] Initialize/reconfigure Pixelle MCP", "init"), questionary.Choice("๐Ÿ“ [edit] Edit configuration", "edit"), questionary.Choice("๐Ÿ”ง [workflow] View workflow information", "workflow"), questionary.Choice("๐Ÿ› [dev] Development & system status", "dev"), questionary.Choice("โ“ [help] Help", "help"), questionary.Choice("โŒ Exit", "exit") ] ).ask() if action == "start": start_pixelle_server() elif action == "init": run_fresh_setup_wizard() elif action == "edit": guide_edit_config() elif action == "workflow": from pixelle.cli.commands.workflow import workflow_command workflow_command() elif action == "dev": from pixelle.cli.commands.dev import dev_command dev_command() elif action == "help": show_enhanced_help() elif action == "exit": console.print("๐Ÿ‘‹ Goodbye!") else: console.print(f"Feature {action} is under development...") def guide_edit_config(): """Guide user to edit configuration""" console.print(Panel( "โœ๏ธ [bold]Manual edit configuration[/bold]\n\n" "Configuration file contains detailed comments, you can directly edit to customize the configuration.\n" "Configuration file location: .env\n\n" "", title="Manual configuration guide", border_style="green" )) # Show current configuration file path from pixelle.utils.os_util import get_pixelle_root_path pixelle_root = get_pixelle_root_path() env_path = Path(pixelle_root) / ".env" console.print(f"๐Ÿ“ Configuration file path: {env_path.absolute()}") if not env_path.exists(): console.print("\nโš ๏ธ Configuration file does not exist!") return # Provide some common editors suggestions console.print("\n๐Ÿ’ก Recommended editors:") console.print("โ€ข VS Code: [bold cyan]code .env[/bold cyan]") console.print("โ€ข Nano: [bold cyan]nano .env[/bold cyan]") console.print("โ€ข Vim: [bold cyan]vim .env[/bold cyan]") console.print("โ€ข Or any text editor") console.print("\n๐Ÿ“ Common configuration modifications:") console.print("โ€ข Change port: modify PORT=9004") console.print("โ€ข Add new LLM: configure the corresponding API_KEY") console.print("โ€ข Disable LLM: delete or clear the corresponding API_KEY") console.print("โ€ข Change ComfyUI: modify COMFYUI_BASE_URL") # Ask if open file if questionary.confirm("Open configuration file in default editor?", default=True, instruction="(Y/n)").ask(): try: import subprocess import platform if platform.system() == "Darwin": # macOS subprocess.run(["open", str(env_path)]) elif platform.system() == "Windows": subprocess.run(["notepad", str(env_path)]) else: # Linux subprocess.run(["xdg-open", str(env_path)]) console.print("โœ… Configuration file opened in default editor") except Exception as e: console.print(f"โŒ Cannot open automatically: {e}") console.print("๐Ÿ’ก Please manually edit the file") console.print("\n๐Ÿ“‹ After configuration, rerun [bold cyan]pixelle[/bold cyan] to apply the configuration") console.print("๐Ÿ—‘๏ธ If you need to completely reconfigure, delete the .env file and rerun [bold cyan]pixelle[/bold cyan]")

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AIDC-AI/Pixelle-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server