flightline learn
The learn command is an advanced tool used to refine your synthetic scenarios with patterns from real data. While Flightline can generate scenarios based on your code alone, learn allows you to provide concrete examples to enhance realism and domain accuracy.
Usage
When to use learn
Use this command when your discovery-based scenarios (from flightline generate --from-discover) are not specific enough for your domain. By providing a small sample of real data, you can help Flightline understand:
- Complex Schema Structure: Nested relationships that might be ambiguous in the code.
- Domain-Specific Logic: Inferred business rules (e.g.,
totalmust equalsubtotal+tax). - Realistic PII Patterns: Custom formats for IDs, emails, or addresses used in your industry.
Key Options
| Option | Description |
|---|---|
--model, -m | The model used to analyze the data (default: google/gemini-3-flash-preview). |
--output, -o | Path to save the profile (default: profile.json). |
Privacy and Security
A crucial feature of thelearn command is that the resulting profile.json contains zero real data values. It extracts the metadata and statistical “DNA” of your dataset without retaining the sensitive “cells.” This makes it safe to check into version control or use in non-production environments.
Refining Generation
Once you have created a profile, use it with thegenerate command to create more grounded test data:
Generate Refined Data
See how to use your learned profile for generation.
