Track map
Detailed content
⌨️ Command line in practice
The web interface is great for getting started, but the terminal is where the tool gains superpowers: automation, batches, and precision. Seven topics about the main command and its flags.
What it is
The CLI (command-line interface) uses the same engine as the web app, but you operate it with text. It shines when you want to run several companies in sequence, automate tasks, use it on a headless server, or repeat an analysis precisely.
Why learn
Anyone who only uses the web is limited to one company at a time, click by click. The CLI unlocks scale and repeatability — that’s what separates casual use from professional use.
Key concepts
- Batches: multiple companies in sequence
- Automation and server use
- Accuracy: the same command, the same result
What it is
The central command is python -m strategy_factory.main run "Stripe". It runs the 3 phases and creates the folder output/stripe with everything: documents, presentations, Word, and diagrams.
Why learn
This is the command you'll use most. All the flags we'll cover next are variations of it. Mastering the run is mastering 90% of the tool.
Key concepts
- run "Company" = complete pipeline
- Name in quotes becomes the output/slug folder
- Always activate the venv before running
What it is
Add --context "B2B payments, fintech" to provide context for the research. This guides Perplexity and improves the quality of the 15 documents.
Why learn
For lesser-known companies or those with ambiguous names, context makes all the difference — it keeps the AI from researching the wrong company.
Key concepts
- --context = industry, model, size
- Free text in quotation marks
- Optional, but recommended
What it is
Use --mode quick (the default) for a quick, inexpensive pass, or --mode comprehensive for more in-depth research — and higher costs.
Why learn
This is the flag that has the biggest effect on cost and time. Module 2.2 is devoted entirely to it — for now, you just need to know it exists and what each value does.
Key concepts
- quick = default, ~9 searches
- comprehensive = ~18 searches, more in-depth
- The 15 documents are the same in both
What it is
With --dry-run, the tool simulates the execution and shows what would be generated, without making any AI calls — in other words, at no cost.
Why learn
This is the best way to test the installation and keys before spending any money. If the dry run runs without errors, your setup is correct.
Key concepts
- --dry-run = simulation, zero cost
- Shows the execution plan
- Great for validating the setup
What it is
The command status "Stripe" --detailed shows the progress and cost of an analysis; list lists all companies analyzed so far.
Why learn
These are your inspection commands: find out what’s already been done, how much it cost, and what’s still missing—without reopening each folder by hand.
Key concepts
- status "Company" --detailed = progress + cost
- list = all analyses completed
- They don't use the API; they're read locally
What it is
resume "Stripe" resume where you left off; reset "Stripe" --yes clears everything; and the flags --skip-research, --skip-synthesis e --skip-generation reuse results already saved in the cache.
Why learn
These are your recovery and cost-saving commands: never redo (and pay for again) a step that already worked. We’ll return to them in Module 2.3.
Key concepts
- resume = continues where it left off
- reset --yes = start over from scratch
- --skip-* = skips phases already in cache
⚖️ Quick vs. Comprehensive modes
The most important choice for each analysis: fast and cheap, or deep and comprehensive. Six topics to help you decide with cost and quality in mind.
What it is
The difference is in the research depth: Quick mode does about 9 searches; Comprehensive does about 18. The 15 generated documents are exactly the same—the richness of the source material is what changes.
Why learn
Knowing the output is the same dispels a common myth: Comprehensive doesn't generate "more documents"; it generates better-grounded documents.
Key concepts
- Quick ≈ 9 searches
- Comprehensive ≈ 18 searches
- Same 15 documents in both
What it is
The default mode. It takes 2 to 3 minutes and costs about US$ 0,05 per company. It’s the quick pass, ideal for an initial overview and screening multiple companies.
Why learn
Because it’s inexpensive and fast, it’s the natural starting point. You can evaluate many companies for a few cents before taking a deeper look at the ones that matter.
Key concepts
- This is the default (no flag needed)
- 2-3 min · ~US$ 0,05
- Use it for screening and a first pass
What it is
The in-depth run. It takes 5 to 10 minutes and costs about US$ 0,50 per company. The research is broader and more detailed—ideal for the company you’re actually going to present to.
Why learn
When the result is going to a client or executive leadership, it’s worth paying 10x more (still just cents) to get the best possible grounding.
Key concepts
- --mode comprehensive
- 5–10 min · ~US$ 0.50
- Use it for the company you’ll be presenting to
What it is
In Quick mode, the research uses only the model sonar (cheap and fast). In Comprehensive, it combines sonar + sonar-pro + sonar-deep-research. In both cases, synthesis always uses Gemini gemini-2.5-flash.
Why learn
Understanding which models are used in each mode explains why Comprehensive costs more: it uses more expensive, powerful models for research.
Key concepts
- Quick = sonar
- Comprehensive = sonar + sonar-pro + deep-research
- Always use gemini-2.5-flash for summaries
What it is
In practice: Quick costs between ~US$ 0,02 and US$ 0,15; Comprehensive costs between ~US$ 0,31 and US$ 0,90. The generation phase (local) is always free.
Why learn
Even the most expensive mode costs less than a dollar. Seeing the numbers side by side shows that “expensive” here is still extremely cheap compared with consulting.
Key concepts
- Quick ~US$ 0,02-0,15
- Comprehensive ~US$ 0,31-0,90
- Local generation = free
What it is
The winning strategy: screen several companies in Quick, then run the chosen one in Comprehensive. If you already have the basic research, use --skip-research so you don't have to pay again.
Why learn
This is the workflow that balances cost and quality: you spend more only where it's worthwhile, after filtering with the cheaper option.
Key concepts
- Triage in Quick, dig deeper in Comprehensive
- Simple decision tree: presenting it? → comprehensive
- --skip-research avoids repeated research
🧬 Behind the scenes (concepts)
Open the black box: the 3 phases behind the scenes, the state and cache files that make everything resumable and cost-effective, and the output folder structure. Seven topics that demystify the tool.
What it is
In the first phase, Perplexity performs 9 to 18 searches about the company: overview, technology stack, competitors, pain points, and regulations. Everything is collected and saved for the next phases.
Why learn
This is the raw material for everything. Without good research, the documents come out weak — that's why context and mode matter so much.
Key concepts
- 9–18 searches depending on the mode
- Covers company, industry, competitors, and regulations
- Result saved for reuse
What it is
In the second phase, Gemini generates the 15 documents in dependency order — some are written only after others are ready. There’s a ~5s pause between calls to stay within the API limits.
Why learn
Understanding the sequence explains why the phase takes a little while and why you can’t generate everything at once: one document uses the previous one as input.
Key concepts
- 15 documents in dependency order
- Pause for ~5s between calls
- Respects Gemini's request limit
What it is
The third phase runs on your computer at no cost: it builds the 2 PPTX files (with the python-pptx library), the 2 DOCX files, and renders the Mermaid diagrams as PNGs (using Chrome/Puppeteer under the hood).
Why learn
That’s why the total cost is so low: the part that turns into “polished files” doesn’t use any API—it all runs locally.
Key concepts
- PPTX via python-pptx
- DOCX and PNG diagrams
- Mermaid rendered with Chrome/Puppeteer
What it is
O state.json is the analysis checkpoint: it records the current phase, which deliverables are ready, the cost incurred, and the errors found.
Why learn
This is exactly the file that lets the command resume: without it, the tool wouldn’t know where to pick up.
Key concepts
- Stores the phase, completed deliverables, cost, and errors
- This is what makes resume possible
- Stays in the company folder
What it is
O research_cache.json stores Perplexity’s raw research. With it, you can regenerate the documents without researching again, using --skip-research.
Why learn
This is your biggest ally in saving money: research is the part that costs. Reusing it means you can tweak and regenerate documents for almost nothing.
Key concepts
- Stores Perplexity’s raw research
- --skip-research reuses this cache
- Regenerate documents without paying to redo the research
What it is
If you interrupt with Ctrl+C or the internet goes down, just run resume "Empresa" to pick up where you left off. For a 429 error (request limit), wait a few minutes and resume.
Why learn
Failures happen. Knowing how to recover without losing your work (or the money you’ve already spent) is what makes everyday use stress-free.
Key concepts
- resume continues where it left off
- Error 429 = limit reached → wait and resume
- The state.json preserves progress
What it is
Each company gets its own folder output/{slug}/ with subfolders: markdown/ (15 .md), presentations/ (2 .pptx), documents/ (2 .docx), mermaid_images/ (5 .png), in addition to state.json e research_cache.json.
Why learn
Knowing the structure helps you find any file right away—and understand what each one is. Track 3 walks through the contents of each deliverable.
Key concepts
- output/{slug}/ per company
- markdown, presentations, documents, mermaid_images
- + state.json and research_cache.json