Now let’s get the tool running on your machine. This module is practical and step-by-step: what to install first, how to get the two free API keys, two ways to install (automatic and manual), where to paste the keys, and how to confirm everything worked—without spending anything.
Illustrative diagram — installation is a short staircase of steps: download, create the environment, install, configure the keys, and you’re ready.
Before running any command, gather three things. Having them ready before you begin prevents the most common beginner mistake: getting stuck halfway through installation because something basic was missing.
The language the tool runs on. Download it at python.org/downloads.
One from Perplexity and one from Gemini. You’ll get both in the next topics.
Command Prompt on Windows; Terminal on Mac/Linux. This is where you type commands.
When installing Python on Windows, there’s a checkbox that’s easy to overlook—and it causes half the problems beginners run into:
In the terminal, type python --version (or python3 --version). If you see 3.9 or higher, you’re ready. If you get an error, it means you still need to install it—or add it to PATH.
The first of the two keys comes from Perplexity — the AI that does the research (Phase 1). Without it, no documents are generated. The process takes about 2 minutes.
Open perplexity.ai/settings/api in the browser.
It's free to get started. Just log in as usual.
The key appears on the screen. It starts with pplx-. Copy it and save it.
# formato (exemplo — a sua será diferente)
pplx-1a2b3c4d5e6f7g8h9i0j...
Treat this key like a password: anyone who has it can use your credit.
This is the key to the Phase 1 (Research). If it’s missing or incorrect, the tool won’t even start writing the documents—it stops right away with a key error.
The second key comes from Google Gemini — the AI that writes the documents (Phase 2). It’s free to get started and you can get it from Google AI Studio in just a few clicks.
Open aistudio.google.com/apikey.
Works with the same Google account you already use every day.
The key starts with AIzaSy. Copy it and save it with the other one.
The keys come from different websites (Perplexity and Google), and each has its own credits. Both offer a free plan so you can try them before spending any money.
With the project downloaded, there’s a shortcut that does almost everything for you: a single command. It’s the recommended path if you don’t want to handle each step manually.
# na pasta do projeto
python setup.py
This command launches an assistant that sets up the entire environment all at once.
On some computers, the shortcut may fail (different Python version, permissions, etc.). That’s okay: the next topic shows the manual installation, which performs exactly the same steps, just one at a time.
If you prefer to control each step — or if the automatic process failed — you can install it manually. They are four commands simple. Plus, you’ll understand what happens behind the scenes.
# 1) Criar o ambiente virtual (a "caixa" isolada do projeto)
python3 -m venv venv
# 2) Ativar o ambiente
source venv/bin/activate # Mac / Linux
.\venv\Scripts\activate # Windows
# 3) Instalar as dependências
pip install -r requirements.txt
# 4) Criar o arquivo de chaves a partir do exemplo
cp .env.example .env
Run them in order. Step 2 varies depending on your system—use only the line that matches yours.
Every time you open a new terminal to use the tool, run the activation command first. When the venv is active, you’ll usually see (venv) at the beginning of the line — that's the sign everything is working correctly.
The file .env is where your keys “go” in the program. Open it in a text editor and fill in both fields. This is the step that connects the tool to the AIs.
# cole cada chave depois do = (sem aspas, sem espaços)
PERPLEXITY_API_KEY=pplx-1a2b3c4d5e6f7g8h9i0j...
GEMINI_API_KEY=AIzaSy1a2b3c4d5e6f7g8h9i0j...
Replace the examples with your actual keys. Save the file after editing.
This file stores your keys in plain text. Never send it by email, chat, or public repository—anyone who has it can spend your credits. It should stay only on your machine.
Before spending a cent, it’s worth doing a simulation test. It confirms that the installation and keys are correct — without making any paid AI calls.
# com o venv ativado
python -m strategy_factory.main run "Stripe" --dry-run
The flag --dry-run simulates the run: nothing is charged, and no real AI is called.
Then everything is in order: Python, the environment, and .env configured. You’re ready for Module 1.3.
Go back to Topic 6: there's probably an extra space, a field name that was changed, or the file wasn't saved.
If the dry run passed, the tool is installed and configured. In the next module, you’ll run it for real — through the web interface, without any commands — and generate your first report.
1.3 — Your first report (web mode) — launch the web interface and generate your first strategy package with point-and-click, without commands.