Step-by-step guide to install and configure Flask Code
Follow these steps to get Flask Code up and running on your system.
python -m pip install -r requirements.txt
copy .apikeys_example .apikeys
Edit the .apikeys file and replace placeholder values with your actual API keys from:
Add these PowerShell scripts to a folder in your PATH for convenient access:
flaskc.ps1flaskcode.ps1flck.ps1bin/launch.py (for GUI).apikeys in YAML format with specific key names.
The .apikeys file should contain three API key slots in this format:
key_1: AIabc123...
key_2: AIdef456...
key_3: AIghi789...
key_1, key_2, key_3 are provider slots that can hold any API keykey_3 is commonly used for OpenRouter as a fallbackGEMINI_API_KEY environment variable as an extra key source-! are supported and ignoredMulti-Provider Setup:
key_1: gemini_api_key_here
key_2: groq_api_key_here
key_3: openrouter_api_key_here
Single Provider (Multiple Accounts):
key_1: gemini_account_1_key
key_2: gemini_account_2_key
key_3: gemini_account_3_key
Run Flask Code in the terminal for a command-line chat interface:
python main.py
Perfect for server environments or users who prefer terminal workflows.
Launch the Tkinter graphical interface:
python user-interface.py
Requires Tkinter to be installed. Offers a polished desktop experience.
If you've added scripts to PATH, you can launch from anywhere:
flaskcode # Launch GUI
flaskc # Launch terminal
flck # Short alias for terminal
Use the chat prompt and built-in commands to control the app. Commands are prefixed with a forward slash.
| Command | Syntax | Purpose |
|---|---|---|
/register-as |
/register-as |
Create a new user account (opens popup) |
/login-as |
/login-as <name> <password> |
Log in to an existing account |
/apikey |
/apikey <1|2|3> |
Switch to API key slot 1, 2, or 3 |
/model |
/model <name> |
Change AI provider (gemini, groq, openrouter) |
/help |
/help |
Display all available commands |
/logout |
/logout |
Log out of the current account |
/exit |
/exit |
Close the application |
> /register-as
>> /login-as alice mypin
>> /model gemini
>> /apikey 2
>> What's the best Python practice for error handling?
>> /logout
>> /exit
Command: /model gemini
Strengths:
Command: /model groq
Strengths:
Command: /model openrouter
Strengths:
> /model gemini
>> How do I optimize this code?
[Gemini responds...]
>> /model groq
>> /apikey 2
>> What about performance?
[Groq responds...]
Issue: Running python user-interface.py produces no window
Solution:
python -m tkintersudo apt-get install python3-tkIssue: "FileNotFoundError" or "YAML parse error"
Solution:
copy .apikeys_example .apikeysIssue: "ModuleNotFoundError" when running
Solution:
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
Guidelines for sharing Flask Code with others or deploying to production.
.apikeys private and ensure it remains excluded by .gitignore.apikeys_example but never share the real .apikeys fileREADME.md in your repository for new usersEnsure your .gitignore includes:
.apikeys
__pycache__/
*.pyc
*.pyo
.env
venv/
Steps to prepare Flask Code for version control and team collaboration.
flask-code/
├── README.md # Project overview
├── Guide.md # This setup guide
├── main.py # Terminal entry point
├── user-interface.py # GUI entry point
├── requirements.txt # Dependencies
├── .apikeys_example # Template (safe to commit)
├── .apikeys # NEVER commit!
└── .gitignore # Include .apikeys
README.md and Guide.md to the repository root.gitignore updated with .apikeysrequirements.txt for dependency management.apikeys_example template for new userspip install -r requirements.txt
copy .apikeys_example .apikeys
# Edit .apikeys with your keys
python main.py # Terminal
python user-interface.py # GUI
flaskcode # If in PATH