How bandarlabs/clickclickclick works
Main Components
• Command-Line Interface & Entry Points:
• Files: main.py, interface.py, and the executable “clickclickclick” package.
• These components handle user-triggered actions (CLI commands, script usage, and API endpoint usage).
• API Layer:
• File: api.py.
• This module exposes an endpoint (using Uvicorn for ASGI) to receive and execute tasks based on provided configurations.
• Configuration Management:
• Directory: clickclickclick/config, containing multiple YAML files (models.yaml, prompts.yaml, function_declarations) and utility code (e.g., yaml_loader.py).
• This part handles model-specific settings and various predefined function declarations for Android, OSX, etc.
• Task Execution Components:
• Executor Module (clickclickclick/executor): Contains platform-specific modules (android.py, osx.py) that handle the actual execution of tasks.
• Task Planning & Model Interaction:
• Planner Module (clickclickclick/planner): Holds submodules for different LLM providers (openai, gemini, local_ollama) and task logic (task.py).
• Element Finding / UI Interaction:
• Finder Module (clickclickclick/finder): This includes modules for finding required UI elements or context using LLM models (e.g., openai, gemini, mlx, local_ollama).
• Utilities & Auxiliary Functions:
• Files: utils.py, clickclickclick/__init__.py, and the project-level configuration files (pyproject.toml, requirements.txt).
Relationships and Interactions
• The entry points (CLI, API, and web interface) initiate task requests.
• Input tasks are passed to the Planner module which decides which model to use and formulates the task plan.
• The Controller then uses Finder modules to locate interface elements or application-specific components (for Android or OSX).
• The Executor then carries out the plan by interacting with the respective platform’s components (through adb or desktop interactions).
• Configurations from YAML files guide both the planner (e.g., selecting which LLM to use) and the executor (e.g., choosing Android vs. OSX specifics).
Recognize Architectural Patterns and Design Principles
• Separation of Concerns: Different modules handle planning, finding, and executing tasks.
• Modular Design: Each significant function area (configuration, planning, executing, finding) is encapsulated within its own package or module.
• Extensibility: The use of configuration files (YAML) and multiple interchangeable planner/finder executors enables easy switching of models and platforms.
• Multi-Interface Support: The project supports CLI, Gradio-based web UI, and API access – highlighting a layered architecture to cater to different usage modes.
Guidance on Technologies and Frameworks
• The project relies on Python 3.11 and uses standard module structuring.
• It leverages Gradio for a web user interface.
• It uses Uvicorn (ASGI server) to run the API.
• Model integrations include OpenAI, Gemini, and local models via Ollama.
• Additionally, adb is required for Android interactions.
Elements
• Adding annotations that detail supported platforms (Android, OSX) and options for model selection (openai, gemini, ollama).
• Optionally, include deployment elements such as Uvicorn for API and Gradio for the web UI as supportive infrastructure.