Quick Start
Create your first synthetic data routine in 5 minutes
Quick Start: Your First Routine in 5 Minutes
This guide walks you through creating and running your first synthetic data routine using the GoMask CLI.
Prerequisites
- Python 3.8+
- Database connection details (host, port, credentials)
- GoMask API key (get one here)
Step 1: Install (30 seconds)
pip install gomask-cli
Step 2: Initialize (30 seconds)
gomask init
When prompted, enter your API secret from datafactory.gomask.ai/settings/api-keys.
This creates a gomask.toml file with your encrypted credentials.
Important: Add
gomask.tomlto your.gitignoreto keep credentials secure.
Step 3: Create a Database Connector (1 minute)
Connect to your database:
gomask connectors create \
--name my-database \
--type postgresql \
--host localhost \
--port 5432 \
--database mydb \
--username myuser
Enter your password when prompted. The CLI will test the connection automatically.
Or list existing connectors:
gomask connectors list
Step 4: Create a Routine with the Wizard (2 minutes)
Use the interactive setup wizard:
gomask setup
The wizard will:
- Show available database connectors
- Let you select a schema
- Display tables and let you choose which to include
- Detect foreign key relationships automatically
- Ask for routine type (synthetic or masking)
- Generate appropriate data functions for each column
- Export a ready-to-run YAML configuration
Output: routine_123_complete.yaml
Step 5: Run Your Routine (1 minute)
Execute with live progress monitoring:
gomask run routine_123_complete.yaml --watch
You'll see real-time progress:
Executing routine: My First Routine
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:45
✓ Generated 1,000 records in users
✓ Generated 5,000 records in orders
✓ Generated 12,000 records in order_items
Execution completed successfully!
What Just Happened?
- gomask init - Authenticated you with the GoMask platform
- gomask connectors create - Registered your database connection
- gomask setup - Scanned your database schema and created a routine
- gomask run - Executed the routine and generated synthetic data
Alternative: Manual YAML Creation
If you prefer to write YAML manually:
# Create an example template
gomask example --type synthetic --name "My Routine"
# Edit the generated file
vim my-routine.yaml
# Validate your changes
gomask validate my-routine.yaml
# Run the routine
gomask run my-routine.yaml --watch
Example YAML Configuration
Here's what a minimal routine looks like:
routine:
name: "My First Routine"
type: synthetic
connector_id: 1 # Your connector ID from 'gomask connectors list'
tables:
- table_name: users
schema_name: public
target_record_count: 1000
columns:
- column_name: email
generation_function: generate_email
- column_name: first_name
generation_function: generate_first_name
- column_name: last_name
generation_function: generate_last_name
- column_name: created_at
generation_function: generate_datetime
Next Steps
Now that you've created your first routine:
- Browse Available Functions - Explore 100+ data generators
- Customize Your Routine - Advanced configuration options
- Set Up CI/CD - Automate data generation
- Learn Data Masking - Mask production data
Troubleshooting
Authentication Failed
# Reinitialize credentials
gomask init --force
Connection Issues
# Test your connector
gomask connectors test my-database
Validation Errors
# Get detailed error information
gomask validate routine.yaml --detailed
See Common Errors for more help.