Repository navigation
Promptify
The promptify command simplifies and accelerates the test data generation process by allowing users to describe their data needs using plain english. Instead of running two separate commands, sf smockit template init followed by sf smockit data generate, users can now execute sf smockit promptify to generate both the template and data in a single, streamlined workflow.
Just provide a natural language prompt (e.g., "Generate 10 Account records excluding email, phone number, and job title") and Smock-it handles both template and data generation in one go.
Before you get started, make sure you have:
- Smock-it Installed (v3.0.3): Ensure the latest Smock-it CLI is installed on your system.
- OpenAI API Key: Required for generating JSON templates from natural language prompts.
- Salesforce Org Alias or Username: A valid and authenticated Salesforce org alias or username where the test data will be generated.
- Uses OpenAI: Converts your natural language prompt into a structured JSON template using OpenAI's API.
- Takes user's instruction or prompt: Accepts a simple English description of the data you want to generate (e.g., "Create 20 Leads without phone numbers").
- Asks username/alias: Requests the Salesforce username or alias to identify the org where data will be generated.
- Asks output formats: This prompts you to choose one or more output formats, such as CSV, JSON, or Data Import (DI).
- Saves template: Stores the final JSON template file in the data_gen/templates directory for reuse.
- Optional data generation: Asks whether you'd like to generate the data immediately after creating the template.
-
Run the Promptify Command:
sf smockit promptify - Enter Registered Email (One-Time): You'll be prompted to enter the email used for your Smock-it signup. If you're not registered, Smock-it will provide a sign-up link.
- Provide OpenAI API Key: If the key isn't already set, you'll be prompted to enter it. Once entered, it gets stored in your environment variables for future use.
- Enter a Prompt: Type a natural language instruction describing the data you want: Generate 100 account records, excluding phone and website, and Name set to testName.
- Provide Salesforce Alias or Username: Enter the alias or username of your target Salesforce org: testOrg
- Select Output Format(s): Choose one or more formats for the output: we're selecting all three: CSV, JSON, and DI (Data Import).
- Template Creation: Smock-it creates a JSON file and saves it in the data_gen/templates folder.
- Generate Data (Optional): After saving the template, Smock-it asks if you want to generate the data immediately or exit: we are choosing to skip data generation for now.
Note: If you don't want to generate the data immediately, press N to skip. You can generate the data anytime later using:
sf smockit data generate -t <yourTemplate.json> -a <orgAliasorusername>.{
"namespaceToExclude": [],
"outputFormat": [
"di",
"json",
"csv"
],
"count": 1,
"sObjects": [
{
"account": {
"count": 100,
"fieldsToExclude": [
"phone",
"website"
],
"fieldsToConsider": {
"name": [
"testName"
]
},
"pickLeftFields": true
}
}
]
}
© 2025 Concret.io, All Rights Reserved. | For a quick demo and guided installation: Schedule a Call. | Smock-it Website