Skip to main content
The EDSL command-line interface lets you create and validate study objects, run surveys with language models, publish surveys for human participants, and inspect or export responses. Use it from a terminal, a script, or a coding agent. This guide uses ep. The commands edsl and python -m edsl are equivalent entry points. An EDSL Agent describes a survey respondent; a coding agent is software that can use the CLI to build and run a study.

Install and discover commands

Install EDSL in your Python environment:
Check the installed version and available commands:
Use the installed CLI’s help to check flags before constructing a command. ep info reports configuration diagnostics and redacts credentials. See Installation for environment setup. For shared-state machines, ep state validate, ep state inspect, and ep state simulate work with serialized Machine JSON. After a run, use ep results state --file results.ep to inspect persisted state bindings and snapshots. See Testing and serialization for the input format and examples. The installed EDSL distribution also includes version-matched skill bundles. Use ep skills list --routing to see their routing descriptions and available references, ep skills search <query> to find guidance, and ep skills show <name> to retrieve a skill with its linked references. Use ep skills install --target <path> to copy the bundles into a harness’s skill directory. Repeat --skill <name> to install selected bundles only; without it, all bundled skills are installed. For a single routing skill that loads other guidance on demand, install edsl-harness. The bundled edsl-shared-state and edsl-orchestration skills describe the two features below. See EDSL skills for coding agents for harness setup and package discovery. ep workflow manages research-task gates. Portable respondent workflows have a separate namespace: ep orchestration validate, inspect, and run operate on WorkflowExperiment JSON files. run writes its durable database and state files to an output directory; configured LLM executors can make model calls. Use --responses to replay supplied answers without model calls, and --resume to continue an existing run. See Workflow CLI commands. For broad discovery, run ep search "<research decision>" and follow a result’s next_command. Use ep search-sources to see the active collections and playbooks. See search across EDSL resources for configuration examples and object-only search.

Try a local example

Run these commands in a working directory where you want to save the example files. They create a survey and execute it with EDSL’s test model, which returns a fixed answer. This example requires no model credentials and makes no paid model calls; its output is test data. Create a question and save it as a survey:
Create the test model configuration and combine it with the survey in a saved job:
Validate the job, run it locally, and inspect the answer:
To inspect a finished pilot, run ep inspect test-results.ep --sample 3 for the first three answer rows. For a local Results file with recorded user prompts, the JSON summary also gives a bounded commands.inspect_recorded_prompts command. It selects stored wording alongside answers and available scenario fields. A missing prompt is returned as null. The selected answer is A test response. The completed responses are saved in test-results.ep; the run command returns execution metadata rather than response rows. Read each command’s JSON response and check status before proceeding to the next command.

Read command responses

By default, operational commands write one JSON document to stdout. Diagnostics go to stderr, and output captured from lower-level operations may appear in warnings. Help output from --help is plain text. Options that explicitly request raw output, such as --output - on object-creation commands, bypass the usual response envelope. A successful response has this structure:
data contains command-specific information. When a command saves a file, inspect the returned save metadata for its path and format. An error response has this structure; suggestion is included when available:
For automation, parse stdout as JSON, inspect status, read warnings, and check the process exit code. Do not extract identifiers or URLs from progress messages. For example:
If stdout cannot be parsed as JSON, treat it as a command failure and inspect stderr. Do not continue with missing or guessed output values.

Create and validate study objects

Check a CSV before importing or sharing it

Inspection checks every data record and returns the original headers, row count, column count, and a sample of cells as text. Use --sample 0 for counts only. Quoted commas, quotes and line breaks belong to the same field. An empty cell still counts as a field, and completely blank physical lines between records are ignored. A width mismatch or a CSV parsing error returns INVALID_CSV with exit code 5. Its details locate the first bad record by one-based data record number and physical start and end lines (record 0 means the header). On a width mismatch, inspection also includes the first 12 header and record cells, each limited to 100 characters. Use --sample 0 to suppress those values. Both ep agents create --from-csv and ep scenarios create --from-csv check the input before saving, preserving any previous output if a record fails. Inspection checks structure. Values and calculations need their own checks. Use ep surveys check-answers signup.ep --cases checks.json to try concrete answers on a saved survey. Each checkbox observation includes the submitted selection count. If a checkbox accepts more or fewer selections than its saved limits because it is permissive, the observation records the reason. Include --output audit.csv --column question --column selection_count --column observed --column reason to save a report. Prefer .ep packages for objects you want to save, inspect, reuse, or share. The CLI also accepts serialized JSON for many commands. A Jobs object combines the survey with its agents, scenarios, and models. Inspect schemas before constructing serialized objects by hand:
A question example shows one configuration. For the full list of explicitly named constructor settings in your installation, read data.constructor_parameters. For example, ep schema show --question-type list includes min_list_items and max_list_items, even though the example sets neither. To require two to four responses in a saved list question named suggestions, run ep surveys update-question survey.ep suggestions --patch '{"min_list_items":2,"max_list_items":4}'. Reopen it with ep surveys questions survey.ep --question suggestions to inspect the saved limits. When the command returns a single question, it also lists its optional parameter names. For a ratings grid, ep schema show --question-type checkbox_matrix also lists the related matrix type. Choose matrix for one choice per row and checkbox_matrix for multiple choices per fixed row. You can also use object-creation commands directly. For example, add a question to the survey from the local example:
add-question updates the survey package in place. A job built earlier retains its saved survey, so rebuild the job to include the new question. Use ep agents create --help and ep scenarios create --help for creating respondent profiles and scenario data from files.

Edit a saved survey locally

Use ep surveys to revise a local file from the terminal. Each successful in-place edit to a .ep package records a revision when its contents change. Pass --output to write a separate file. These edits work offline.
Repeated --option flags supply the complete ordered choice list. For typed values or other question fields, pass a JSON object or filename with --patch. Renaming updates references inside the survey, including answer piping, memory, and skip rules. Review any separate settings files or scripts that refer to the old name. For a survey with questions named channel, receipt, and notes, this example shows the receipt page only to in-store respondents. It carries existing browser settings into a new local file.
Each path in paths.json lists the expected pages in order. Include the answers that affect routing. The command checks the end of the survey and exits with a validation error at the first mismatch.
To find out which screens a visitor would see, supply sample answers with --routes. You can give the command a file or inline JSON. For the checkout survey above, the store route visits three pages and the online route visits two.
The CSV has one row per visible screen, with columns route,page,items. Each route starts at page 1. The items include messages and page instructions in display order. The JSON response also lists the background steps reached on each route. If a staff-only model question controls a branch, supply its hypothetical answer alongside the visitor’s answers. A background-only group consumes no screen number. To assert pages with --paths in this situation, give the route an object with background_answers and the usual pages list. This is a local rehearsal of a single pass through a fixed-order survey. It uses the saved groups and rules. Deployment, inference, and collection of human responses are separate operations. To change a question’s type while keeping its name, position, routing and group membership, supply a full replacement definition. For example, convert a rating stored as text choices to a scale with numeric options.
The existing wording carries over if you omit it. Supply the new type’s question-specific settings. Check any downstream expressions that compare answers against the old options.

Place page directions and preview an independent judge

For a grouped human survey, put directions immediately before the first question on the relevant page. Inspect the saved item’s position in data.item_order.
For a simulated study, a single question can use a different model and system prompt while keeping its type and answer options. Here a respondent chooses an application type and an independent reviewer evaluates it. Render a sample prompt locally to verify that the auditor receives that choice.
The preview returns the model override and rendered user and system prompts without calling a provider. Use --traits and --scenario to supply additional sample inputs as JSON. For a question that inherits the job’s model, the preview uses the test model. Use ep surveys set-question-model eligibility.ep audit --clear to restore the job’s model and agent persona. To revise which prior answers a simulated respondent sees, inspect the survey’s memory_plan with ep surveys show. Here the first tasting note becomes blind, and the comparison still recalls its tasting notes while dropping the panel ID.
Use --clear-for with repeated --target FOCAL=PRIOR to replace all memories for one question. Edits apply in the order --full, --clear-for, --forget, then --target. Question text can still pipe answers explicitly. Use ep surveys preview-prompt with sample answers to check what the model sees. The following check fails if the note is missing or the ID appears in either prompt.
To check several respondents at once, save named cases in a JSON file. Each case can include scenario, traits, and the full answers history. Only earlier answers are visible at each question in the survey’s saved order.
Put earlier answers in answers, keyed by the survey question names. For example, a source column called first_impression can supply the answer for a question called opening. Each check lists unprovided_prior_answers when its memory or templates reference an earlier question whose value was omitted. Conditional wording and skipped questions can make omissions intentional. The command renders locally without inference. A check can specify scope as user, system, or either (the default). Expectation failures return exit code 5, with all verdicts in the JSON details and the requested CSV. If the examples come from a table that changes each week, use field references in the same cases file. For example, the template below uses the CSV’s visit ID as the case name and looks for that visitor’s own tasting note in the comparison.
To write a joinable CSV directly, add --column case=visit_id --column question --column result. The result field contains pass or fail. Optional missing_text and forbidden_text_found fields record the literals behind a failure. CSV preserves strings including leading zeros. A JSON array of records or a saved ScenarioList can supply typed values such as a list of checkbox answers.

Edit the inputs to a simulation

Use edit-item with a local agent, scenario, or model list. Positions start at zero. A patch merges nested fields, so changing one trait or model parameter preserves its siblings. Insert without an index to append, or use --remove --index N to delete an item. Pass --output to write a separate list.
A replication team may receive several copies of a saved panel or model lineup. Compare the complete definitions with one command:
Each candidate gets a match flag, the number of differences and up to 20 examples. A path such as ["agent_list", 16, "traits_presentation_template"] locates a change on the seventeenth worker. For an AgentList, the report also includes each side’s saved name when present. Use ep agents show birch/staff.ep --index 16 to review that worker’s profile. Mapping key order and archive history do not affect equality. List order and JSON value types do. Comparisons read the standard JSON definition of each reopened local object without syncing or running it. Optional runtime diagnostics, such as Results task history, are outside that definition. For an automated release check, add --require-match; a mismatch returns exit code 5 with the same report in the error details. Use --max-differences 0 for counts only. To see how a model will be told about each worker, run ep inspect people.ep --sample 5. Each sample includes traits_presentation_template alongside the stored traits, codebook and answering instructions. For example, two workers can have both station and relief_contact in their profiles while only one worker’s template mentions the relief contact. A partial sample reports whether templates differ anywhere in the panel. Follow panel_variation.inspect_all to see each worker’s template. The JSON from ep inspect people.ep includes the named lookup and patch commands for a local AgentList. A named lookup matches the printed agent name exactly, including case and leading zeros. If several agents share that name, the CLI returns their zero-based positions. Inspect one with ep agents show people.ep --index N before editing by position. After an agent patch, the JSON receipt includes the previous and saved values of the supplied fields under data.patch.before and data.patch.after. Apply revised inputs to a saved job with ep jobs edit study.ep --survey revised.ep --models panel-v2.ep --output study-v2.ep. Each supplied file replaces that component. You can add --agents and --scenarios in the same command. Running the revised job is a separate step. To compare a different model panel on the same assigned work, run ep jobs edit pilot.ep --models panel.ep --cross-models -o comparison.ep. For explicit or zipped assignments, each distinct agent/scenario pair receives every model in the new panel once. Four assigned tickets and three model settings yield 12 interviews, even when one reviewer owns two tickets. The JSON receipt reports interviews_per_iteration. Use a plain same-size replacement to retain model-specific allocation by position. To hand off an input from a saved job, extract it into a new standalone file:
ep inspect pilot.ep --type Survey checks the type of the whole file. If it contains Jobs, the error suggests the extraction command before any output is written. You can also extract scenarios and models. Each file contains the stored component in its original order, so the roster includes people who received no assignment. The job keeps the assignments linking people, scenarios and models. To see those assignments use ep jobs variants pilot.ep. To recover a component from an earlier job revision, add --ref and a commit from ep log pilot.ep. With a ScenarioList, ep jobs build returns a JSON warning when a field has no direct reference in the survey’s question or instruction templates. For example, a question that uses {{ product }} with scenario columns product and record_id returns a warning with "code": "UNREFERENCED_SCENARIO_FIELDS" and "fields": ["record_id"]. The job is still saved. An ID used to join results can stay as metadata. A characteristic meant to influence an answer should reach the relevant question. The same advisory appears in the JSON from ep jobs edit and ep run. Analysis skips dynamic access to the whole scenario and functional questions, where the fields used can depend on runtime data. To check the saved price card, allocation total or dictionary answer fields, run ep surveys questions pilot.ep. For a question’s complete stored settings, run ep surveys questions pilot.ep --question day_passes. Repeat --question for multiple items, or use --full for the whole questionnaire. The same commands read the questionnaire embedded in a Jobs or Results package.

Build a factorial experiment

To test every message at every site and time slot, cross their saved ScenarioLists. Four sites, three messages and two slots give 24 scenarios. A check reports the row count for each input and the total without constructing the combinations.
The result contains all the fields from each contributing row, including typed values. The first list varies slowest. Duplicate rows contribute separate combinations, and an empty input gives an empty design. If two inputs both have a field such as label, rename one with ep scenarios transform before crossing them. Use ep scenarios join --on when each site needs a particular matching record from another table.

Enrich scenarios from a lookup table

For a study where each visit needs the correct site’s rate for the period, attach it before building the job. Each combination of the repeated --on fields must identify a single lookup row.
The output preserves the order and multiplicity of visits. A missing rate leaves the added fields null. The JSON receipt reports the total matched and unmatched input rows and shows the first ten misses with their input positions, keys and optional IDs. Use --max-examples for a longer handoff or --require-match when every visit must match a lookup key. To release a table only if every visit has a recorded fee, add --require-value fee_cents. Repeat the flag for additional mandatory lookup fields. Missing fields, nulls and whitespace-only strings fail this check. Zero and false are valid. The JSON receipt distinguishes unmatched inputs from matched rows with missing values, and gives field counts and bounded examples. Without the flag, missing values remain permitted and the receipt reports gaps across all lookup fields. Use --check-only in place of --output for a local audit. The first duplicate lookup key fails with both lookup row positions, a sample of differing scalar values, and a count and sample of the affected input rows. Non-key fields must have distinct names across inputs.

Import an Excel worksheet

Inspection lists every worksheet and previews the headers and first three data rows of up to ten sheets. Use --sheet NAME --sample N for a particular sheet. Formula cells show their saved values when available. Both import commands use the stored cell values. Text IDs such as 07 and 007 remain distinct, and a depot code stored as the text NA stays NA. A blank cell remains missing, and a numeric measurement stays numeric. If Excel only displays the number 7 as 007 through a custom format, its stored value is still 7. To read a survey in the terminal, print its Markdown questionnaire or save it for review:
With JSON output, each routing rule includes its condition (expression) and its effect (when_true). For example, Skip entry_method and continue at next_visit means a matching respondent bypasses the locker-entry question. Use either heading flag independently. With both flags, a heading reads 3. [age] “What is your age?” (numerical). By default it reads 3. “What is your age?”. Dropdowns show the first five choices and a count of the remaining choices. Add --expand-options to list them all. This flag only changes the preview. The dropdown’s top_k determines how many matches a search returns. Budget questions show an allocation table with the total above it. Demand questions pair each price with an empty quantity cell. Rank questions show the available choices followed by the requested number of blank ranking positions. Group discussions list their stages in order. Active survey instructions appear before each question they apply to, including when you open that question on a later page. Matrix questions display items as rows and response options as columns. Questions appear in authored order with response options and routing. Jinja expressions and control tags in question text appear as inline code, so you can see where answers or scenario values will be inserted and which wording is conditional. For example, a Yes/No question can display ○ No → Go to question 3. The skipped question also shows its skip condition above the answer choices, even on a page by itself. More complex conditions appear at the question where they are evaluated. The flag writes Markdown directly to stdout on success. Omit it for the normal JSON summary.

Check routing against example interviews

Write examples from the research brief before implementing its skip or stop rules. Each expected_path lists every question this respondent should see, in order, through the end. For a survey with consent and two follow-up routes, save a file named paths.json:
Supply answers for visited questions used in routing rules. Other answers are optional. Optional scenario and agent objects provide values for context-dependent rules. The checker uses only answers from questions reached so far and verifies the end of the interview. A mismatch returns exit code 5 and the first divergence for each failing case in error.details. For example, a broad fallback might send the “needs help” respondent from rating to routine when the brief requires urgent. Correct the rule and rerun the cases. To repair a checkbox follow-up, change the existing skip condition on the write-in question. This example shows the write-in whenever the respondent selected Other, including alongside another choice.
The edit preserves the rule’s priority, evaluation phase, and destination. If the question has several custom rules, select one using --when before|after, --priority, or --match-expression with the exact old condition. For an after-answer rule, --next can change the destination to another question or EndOfSurvey. Omit --output to update the source package. The check walks local, question-level skip and stop rules without inference. It compares question names in the survey’s fixed order. Use --schema and --paths for grouped browser pages. Job-level order and sampling policies require assignment-level tests. A rule expression that draws a random value can take a different path on a later run. Set answer-option randomization on a survey with set-option-randomization. Repeat --question for each question; use --pin-options with a JSON object or a path to one when some options should stay in their original positions. This works for static choices and whole option lists resolved from scenarios or prior answers:
Inspect warnings from ep surveys show or ep validate to catch obsolete pins, pins that match no current fixed choice, and shuffles with fewer than two different movable values. For example, pinning both Email and Text in a three-choice list leaves App as the only movable option. Every draw then produces the same order. For a verified fixed shuffle, the receipt lists the pinned values and their one-based slots along with the number of movable options. The data.option_order_check.requires_interview_data list identifies questions with templated choices. Check those with representative scenario values or prior answers. Setting a new pin that matches no fixed choice returns a validation error before saving the edit. Use --clear to remove the survey’s option-randomization settings. See Surveys for execution behavior and Python examples. For model studies and Humanize web surveys, configure forward/reverse presentation of linear scales with ep surveys set-scale-direction-randomization. Repeat --question for each scale; use --clear to remove the policy:
On the web, each response receives its own draw and retains it when the respondent returns. For model jobs, models share the draw for a given agent, scenario, and iteration. A survey with this policy includes a scale_direction_results field in its JSON edit and show receipts. After retrieving human responses, run its example with your Results path. Match the response ID to the direction recorded for your question and the options actually displayed. Older rows can lack a recorded direction.

Assign scenarios to their designated agents

When each scenario has an owner, match its field to an agent trait. For example, a set of claims can have several rows assigned to one reviewer and none to another.
If a desk code is unique only within its branch, match both fields. Suppose Maya works North desk 007, and Lee works South desk 07. A ticket for South desk 007 needs a correction even though both values appear on the roster. Repeat the option to require the whole combination:
The successful multi-field receipt lists the pairs in matching.field_pairs. For a failed match, error.details[].key_value shows the scenario fields and values together. Correct the source or assignment before saving the job. The agent field comes first. Use agent.name to match by the saved agent name. Each scenario must match exactly one agent. Text codes such as 07 and 007 are distinct. The job retains the original component lists and schedules the matches in scenario order, once per model. The JSON receipt reports the number of used and unused agents. On a missing or ambiguous match the error details identify the scenario rows, available ID fields and competing agent names.

Export the planned interview schedule

For a saved local job, ep inspect pilot.ep includes commands for reviewing its schedule. list_schedule_fields lists selectable assignment fields. export_schedule_csv writes one row per scheduled interview to schedule.csv, including repeats. Its suggested columns include shared scenario identifiers (id or *_id), reviewer names when available, and the model. Choose the output filename and columns for your handoff. The Markdown preview of a local job also shows how to list its schedule fields. Use ep jobs variants assigned.ep to list the fields available across the saved schedule. To hand off a run sheet, select one column per piece of information the coordinator needs:
The CSV contains a row per planned interview in assignment order, including intentional repeats. Include model.inference_service when a model name is available through multiple providers. Use the same fields with --group-by to count combinations or --unique-by to reject duplicates. If a requested check fails, the command preserves any previous export. It runs locally. For a crossover study, include iteration (zero-based) and treatment.condition (the assigned name from the saved treatment policy). A blinded scenario may only contain a code. Read the round from the exported column because schedule order can group rows by scenario. To check a protocol that requires each participant to see each condition once on each model, run:

Compare two staffing schedules

A coordinator rebuilt a job and rearranged its rosters. To check that each person still reviews each ticket the approved number of times at each model temperature, compare the scheduled interviews:
For a coordinator’s column labels, add options such as --heading agent.name reviewer --heading reference_count approved_count. Each CSV row retains the candidate path supplied on the command line. The report gives a verdict for each candidate. Every discrepancy in the CSV includes the candidate path, the selected field values and the two interview counts. A group present in only one job has a zero count in the other. Numeric values 1 and 1.0 share a group, while text identifiers such as "07" and "007" remain distinct. Repeated interviews count separately and a change of running order is allowed. If the round, model identity or treatment arm matters, include iteration, model.model, model.inference_service or treatment.condition as appropriate. Fields omitted from the grouping can differ even when all counts match. The default JSON preview shows up to ten differing groups per candidate; --limit controls that preview. The CSV contains all differences.

Review saved survey revisions

To recover the questionnaire actually fielded, supply the wording and choices from your notes. Every clue must match in the same revision. Options are order-sensitive.
The report counts all committed revisions reachable from the current HEAD and returns the matching source hashes. --limit bounds the displayed list. Omit --output to inspect ambiguous matches. A unique match can be saved as a new independent Survey package, including its instructions, routing and memory. The original package keeps its history.
With multiple candidate packages, data.comparisons contains an entry for each path, including unchanged copies. All entries use the same master and are returned in argument order. A field with only a before value was present in the master and removed from the named copy. Edits to questions and instructions list their added_fields and removed_fields when present. Reversing the inputs reverses these directions. For release signoff, ep surveys diff master.ep candidate.ep --expect-field closing question_text checks that the closing question’s wording changed and all other saved fields stayed the same. Repeat --expect-field QUESTION FIELD for each required field. Added or removed questions, order changes, instruction edits and survey settings count as unexpected changes. A mismatch exits 5 with the complete comparison in error.details[0], including matching copies when several were checked. Review the new wording itself before approving it. One package compares the selected commit with its first parent. Two packages compare their saved definitions, even if they have independent history. The receipt identifies both commits and lists changes to questions, instructions, order and survey settings, including sampling, scale direction, recall and routing. For question sampling, the receipt gives the total, the required questions within it, any additional slots and the questions the sampler cannot select. Routing can still skip an assigned question. A wording edit that is also mirrored in the recall metadata is reported once. An empty change list means the stored survey definitions agree. Use ep log platform.ep to find older commit IDs. Both the CLI and the version history in ep open use the same comparison.

Import selected roster fields

To prepare a panel from a larger staff roster, choose its fields at import time. This example uses each badge as the agent name and keeps district and shift as traits.
For an Excel workbook, use --from-xlsx and --sheet. Use a new output path when the recipient should receive only the selected fields. Saving over an existing .ep preserves its earlier versions.

Check routing after an option changes

Run ep surveys show survey.ep or ep validate --file survey.ep and read the JSON warnings. For example, if a pickup follow-up still tests whether the previous answer equals Counter service, but the choice was renamed to Collect at a branch, the warning identifies the follow-up, the answer field, the old label, and the current choices. Validating a saved Jobs object checks its embedded survey as well. data.routing_label_check counts the fixed labels checked and lists up to ten comparisons against free-text answers. A visitor can type a former ticket label in a referral box even after the ticket option changes. To hand off the findings, run ep validate --file survey.ep --warnings-csv review.csv. The CSV includes one row per validation warning. Repeat --warning-code to select the kinds of warning to export. The JSON envelope retains all findings. A clean instrument produces a header-only report. For saved surveys with authored rules, data.routing_label_check.export_example gives the command to write a two-column report. Change the output path as needed. Repeat --warning-column to select the fields and their order, for example --warning-column rule_question --warning-column label for a short review sheet. The JSON receipt contains the report path and warning count. This check covers direct equality or membership comparisons with fixed text choices on multiple-choice, yes/no, and checkbox questions. A structurally valid survey can have a routing warning. Verify the paths you intend to field, especially when choices depend on a scenario or a rule computes its value.

Assign treatment conditions

Use an explicit schedule to assign each respondent/model/iteration unit to one scenario condition. Condition values are scenario indices in the Jobs package. Save a policy JSON file with conditions, schedule, unit, and optionally unit_id_field, exposure_questions, balance, and planned_iterations:
Apply and validate the policy, then inspect realized assignment and exposure in results:
Unit keys start with agent:<id>; agent_model appends |model:<index>, agent_iteration appends |iteration:<index>, and agent_model_iteration appends both. balance: "exact" requires equal counts for all conditions. Iteration-specific units require planned_iterations to match the run’s n. Use ep jobs set-treatment-assignment jobs.ep --clear to remove a schedule. This version accepts explicit schedules on the default Cartesian assignment plan; it rejects probability-based assignment, stratification, custom Jobs assignment plans, and Humanize. Configure exact-count question sampling in a saved Survey package, then inspect and validate the policy:
Declare and inspect question-order blocks:
Required questions count toward --sample-size; questions outside the eligible pool are always asked. Each respondent/scenario/iteration gets one sample shared across model variants. Results expose sampled and omitted questions under randomization.*. Question-order blocks contain at least two contiguous, independent questions in declared order. Custom branching, internal piping or memory dependencies, and instructions inside a block are not supported. questions_to_randomize continues to randomize answer options. Humanize currently reports a capability error for surveys with question-order blocks or question sampling. If validation fails, correct the reported problem before running the object.

Check a Word programming proof

Send a vendor an editable programming specification, check the returned proof locally, then save the survey it describes.
Validation reads the visible EDSL question headings, choice codes and routing instructions. A successful response includes the reconstructed survey. A rule comparing a coded answer to 2.5 in a three-option question returns a validation error naming that question and listing up to 20 response codes with their labels. A numerical question can still have a fractional threshold. For an ordinary Word questionnaire, the CLI reports the unrecognized format and previews up to 20 body paragraphs. Read the original for any tables or remaining text. Use the recovered wording and field notes with ep surveys create, ep surveys add-question, and the appropriate survey rules.

Preview saved objects in Markdown

ep inspect --markdown starts at page 1 with 10 entries per page. The header shows the displayed range and total. It accepts the same packages, JSON files, or remote references as ep inspect. Local Markdown previews use the saved package contents. Plain ep inspect returns its JSON summary. For example, agents.to_markdown(page=2, page_size=5) returns the second page in Python. Use ep inspect survey.ep --markdown for the same quick, paged look you would give any study object. Use ep surveys show survey.ep --markdown to read or export the whole questionnaire, or to include question names, types, or all dropdown choices.

Rehearse a saved job with scripted responses

A rehearsal exercises routing, option order, answer decoding and validation using a local test model. Give each question that will be asked a scripted reply. For example, if station is a coded multiple-choice question and reason is free text, save this as replies.json.
Check the second interview’s decoded station against the study brief, or run the same replies over every assignment and save the actual prompts and answers.
The rehearsal substitutes test models for both job and per-question models. A skipped question can omit its reply. A failed check identifies the interview, question and mismatch, exits with code 5 and preserves any existing output. Omit --iterations to use the job’s saved treatment schedule.

Run with language models

For hosted execution, configure an Expected Parrot account and API key as described in Managing Keys. Check authentication and connectivity:
Discover available models:
Replace MODEL_NAME below with a model returned by the catalog. These commands build and estimate a job; the final command runs it and may incur model usage costs:
Blocking runs require an output file. Use .ep for a Results package or .json for serialized data. An ok response can include a PARTIAL_RESULTS warning. For example, “Found answers in 0/50 result rows. 50/50 interviews failed.” Check data.meta.completion.answered_interviews for the number of rows with at least one answer and data.meta.failed_interview_count for the number of unsuccessful interviews. An interview that answers one question and fails on another counts toward both. To disable remote inference, add --local. This runs execution on your machine but can still call a model provider over the network and incur charges. Provider credentials or a configured local model server are required for real model calls. See Connect to your own model server for endpoint configuration. To exercise a job with the saved settings of two offline test readers, run ep run study.ep --models readers.ep --local --output rehearsal.ep. The job supplies the questionnaire and assignments. The ModelList supplies each reader’s settings, including different replies for two entries with the same model name. ep jobs test-case --responses replies.json gives every selected assignment the new scripted replies instead. Use --agents, --scenarios, and --models to replace those components for one run. The original --agent_list, --scenario_list, and --model_list spellings also work. Use --model NAME to construct a single model by name. Choose either --model or --models per run.

Submit a background job

Use background execution for long remote jobs:
The response includes job metadata under data.meta.remote_job when available. Read its job_uuid and use that value in follow-up commands. Replace JOB_UUID below with the returned identifier:
A completed or partially failed job can have answers ready on the runner before its published Results UUID exists. If the job reports latest_job_run_details.results_available, the same ep jobs results JOB_UUID --output results.ep command retrieves the submitted questionnaire and the available interview pages. Its JSON receipt reports result_source: "runner" and results_uuid: null. Any supplied Results UUID must still match a published receipt. The CLI verifies page counts and the interview IDs supplied in the manifest before saving. If a page disappears during retrieval, retry the job command. A completed job with ep jobs wait JOB_UUID --output results.ep uses the same reader. A partial-failure wait gives recovery commands for the available answers and the exception report. If a transfer sheet gives you both IDs, pass them together to check that the answers belong to that run.
Both commands look up the job first. If the receipt differs, the command exits with code 5 and RESULTS_RECEIPT_MISMATCH. Its details include the supplied receipt and the job’s published Results ID. An unpublished result returns RESULTS_NOT_AVAILABLE. In either case, the CLI stops before downloading or writing. If you have only a Results ID, ep jobs results --results RESULTS_UUID --output answers.ep still fetches that object directly. To check an entire delivery register, name its job and receipt columns and choose a separate CSV destination.
The command reads each distinct job’s publication record once. It preserves the input columns, row order and duplicates, then appends published_receipt and finding. The default input column names are job_uuid and results_uuid. Add --exceptions-only to omit matching rows from the output. A partial lookup caused by a network failure, authentication failure (401), rate limit or server error leaves a prior report intact. A completed audit returns status ok and a count for each observed finding, including discrepancies. It reads job metadata only. The presence of a published receipt is independent of the number of successful interviews. Fetch results after the job completes; fetch the error report when investigating failures. To submit, wait, and save in one command:
--background alone returns before responses are ready. Do not combine --background with --output unless you also use --wait.

Collect human responses

After configuring Expected Parrot authentication, you can publish the saved survey for human participants:
humanize create creates a hosted survey. Read the returned survey identifier and respondent URL from the JSON response. Share the respondent URL with participants when you are ready to collect responses. Replace HUMAN_SURVEY_UUID with the returned identifier to inspect the survey and save responses:
humanize responses saves completed responses. Add --include-partial to also save responses that are still being taken; agent.response_status tells them apart. To stop taking new responses, pause the survey. Respondents who open the link are told it’s closed, and anyone partway through can still finish. Resume it to accept new respondents again:
You can also publish from a Jobs package with --jobs. Jobs used for human surveys must not include models. If they contain scenarios, supply --scenario_method; use ep humanize create --help to see the available assignment methods. See Humanize for survey configuration and Prolific studies for participant recruitment.

Check a panel against recruitment quotas

Give one target per combination in the recruitment CSV, for example:
Each agent counts once. Labels are compared as text with case and leading zeros preserved. The count column can be named count, target, or selected with --count-column. Without --by, the other columns define the groups. Unlisted combinations have target zero. The receipt also reports whether each trait’s totals match on its own. All single-trait totals can agree while the joint quotas fail. When saving the CSV, the receipt includes the first ten discrepancies and a truncation flag. The optional CSV contains one row per discrepancy or only its header when every target matches. In automation, QUOTA_MISMATCH and exit code 5 mean the comparison finished with discrepancies. A malformed plan or missing roster trait produces a validation error before an output is written. To draw a pilot from an existing roster, use the same recruitment sheet with a seed.
The draw samples roster entries without replacement within each joint cell and saves the selected personas in roster order, with their original traits and interview instructions. Reuse the same ordered roster, targets and seed to repeat it. A zero or unlisted cell contributes no members. If a cell has too few members, the command returns INSUFFICIENT_ROSTER with every affected combination, its target, the number available and the number still needed. An earlier pilot at the output path is preserved on a shortage.

Inspect and export saved responses

Use results commands on saved files:
To give a reviewer a random set of complete interviews, draw from a saved Results file. This example selects up to three consenting visits per site.
The packet contains the original questionnaire and the selected Result rows, including their answers and model records. The receipt lists the eligible and selected counts for each site, including sites with zero eligible visits. Sampling is without replacement within a draw. A site with two eligible rows contributes both. To make another draw, change the seed and destination. Two independent draws can overlap. The same file, filter, grouping and seed reproduce the same ordered rows. Repeat --group-by to draw within combinations such as site and shift. For a single draw from the whole file, omit --group-by. To match a sampled row back to its source, use a saved visit or participant ID. When an agent has no saved name, EDSL assigns a display name such as Agent_0 during inspection. The same interview can have a different display name in a smaller packet. For an inline preview, omit --output and select the fields to display with repeated --column options. To make a spreadsheet of the saved draw, use ep results export review.ep --column answer.remark --output remarks.csv. For a categorical response, use ep results rate to count the total result rows, answered rows, rows matching one value, and percent matching among answered rows. Each result row is one observation. A group with zero replies has a blank percent in CSV and null in JSON. A group with replies and zero matches has a numeric zero. Repeat --group-by to report joint groups.
To deliver selected columns with reader-facing headings, repeat --report-column FIELD HEADING in the desired CSV order, for example --report-column scenario.region Region --report-column answered Replies --report-column percent "Approval (%)". Use --weight agent.survey_weight to calculate a survey-weighted percentage. The command keeps the raw row counts, adds answered_weight and matched_weight, and calculates percent as 100 times their ratio (matched over answered). Answered rows need a finite, nonnegative number or numeric string. A zero-weight reply counts toward answered. Unanswered rows contribute no weight, and a zero total answering weight yields a blank CSV percentage or JSON null. For checkbox responses each row contributes at most one match. Nulls are unanswered, while an empty list means a recorded answer with no choices. Use --value-json 1 for a numeric answer or --value 01 for a text code. For a compact summary of answer frequencies and numerical means by district, run:
When inspecting a local Results file, the JSON from ep inspect includes a runnable review command and templates for comparing groups. Substitute qualified fields from the same receipt for the uppercase placeholders. To see how each visit type changed over time, request both grouping fields in one review.
segment_summaries contains the separate period and visit-type totals. joint_segment_summary includes each observed period and visit-type combination. Its groups report the number of rows, the number with numeric answers, and the mean. Check groups_truncated before reporting a complete breakdown. answer_distributions counts distinct full answer values. --text-chars controls how much of each label is displayed. Long labels retain their beginning and end and carry value_truncated: true. value_type distinguishes text codes from numbers with the same printed label. Within each segment, count gives the total number of result rows. numeric_counts gives the number of numeric replies to each summarized question, including zero ratings. A question with no numeric replies in that group has no entry in means. Repeat --column for multiple columns; do not pass a comma-separated list. Inspect available columns before selecting them. Use a bounded select to review responses and export to save larger datasets. Results queries support .ep, .json, and .json.gz files. Use .jsonl or .ndjson for a partner feed with one UTF-8 JSON object per line. Repeat --field SOURCE NAME to select and name exactly the fields the recipient should receive. You can also use --column with optional --header labels. If no fields or columns are specified, the command exports all available fields. Both forms also work with CSV, JSON arrays and Excel.
In a Results CSV, a list or dictionary occupies one cell containing JSON. For example, a checkbox response with two choices can be read with JSON.parse(row.Choices) after the CSV parser reads the row. A skipped answer gives a blank cell; a recorded empty selection gives []. A dictionary preserves nested booleans and nulls. Scalar text, including a ticket code such as 007 or a note that happens to look like JSON, stays literal. Use the field’s expected type to decide which cells to parse. Read the CSV with a CSV parser so quotes, commas, and line breaks inside a cell are handled correctly.
ep results select --csv uses the same cell encoding. Earlier versions wrote the Python representation for nested answers. Re-export a saved Results file to produce JSON cells for a downstream application. To give coders one row per written response, use --long and select the question types in the saved Results. The same command works when the next survey uses different question names.
For each recorded answer the default long-format columns are question_name, question_type, and answer. Add exact interview columns with --column or --field to carry respondent, scenario or model identifiers. Question type comes from the interview metadata when available, then from the saved survey. When a recorded type differs from the questionnaire, the JSON output of ep inspect, ep surveys questions, and ep surveys show includes a RECORDED_QUESTION_TYPE_MISMATCH warning for Results. The counts describe interview records with that answer key and known type metadata, including blank answers. An unknown type is null and is omitted by a type filter. A missing answer key produces no row. A recorded null produces a row unless --answered-only is set. That option also skips whitespace-only strings and preserves zero, empty lists, and the exact text of every nonblank reply. --filter operates on interviews first and --limit counts exported answer rows. JSON Lines keeps ordered arrays, nulls, numbers, and strings with leading zeros. A newline in a response is escaped inside that record. No matching rows produces an empty file. The receipt includes the row count and final field names. This export can be read one line at a time by ordinary JSON consumers. Use .xlsx for a native Excel workbook. Repeat --column in the desired order and use --filter to select the rows. The workbook keeps identifiers stored as text, numeric answers, blank cells, and literal response text. Lists and dictionaries occupy one cell as JSON. Excel export uses the optional openpyxl dependency in the environment running ep.
Use --sheet-by COLUMN to give each branch, cohort, or model its own tab. The grouping field can be omitted from the displayed columns. Filters apply before grouping. Tabs follow first appearance and rows retain source order within each tab. The JSON response lists the final headers in order and the row count for each worksheet. The order of the --column flags determines the column order. Each --header changes a displayed name.
Group values must give distinct, valid Excel tab names. A blank, invalid, or ambiguous name raises an error before the destination is replaced. An empty selection produces one header-only worksheet named Results. For randomized surveys, inspect assignment and exposure provenance as structured columns:

Check a saved sample against its job

If a job assigned two riders to two stations for two iterations, eight rows can still include the same rider/station/wave twice. Compare the Results with the original job before certifying the sample.
The command works locally, respects the job’s assignment plan and ignores Results row order. Use the iteration count from the run request. A saved treatment schedule supplies its own count. The check compares agent, scenario and model definitions as well as their assignment slots. For a scripted rehearsal that deliberately substituted a test model, add --allow-test-model. Historical rows without indices need a unique matching component for each missing index. Success returns the planned and recorded counts. Exit code 5 includes counts and examples of missing, duplicate or unexpected assignments, rows with changed component data, and rows whose identities could not be resolved. --limit bounds examples per category. Validate answer completion and the survey definition separately.

Calculate a report with SQL

To calculate a response rate among people who actually saw a question, add --exposure QUESTION. For a question named remark, [presented.remark] is 1 for a recorded display, 0 for a recorded non-display, and SQL NULL for unknown. [has_answer.remark] is 0 for a missing or whitespace-only answer and 1 for a recorded value, including zero or an empty selection. The two fields are independent. A recorded exposure event takes precedence over the legacy entry flag, including an explicit unknown event flag. Answer text alone cannot establish display.
Repeat --exposure for more questions. The extra fields belong to the primary SQL table. Use ep results outcomes checkout.ep --question remark to inspect the recorded outcome, display flag, and answer presence per row. ep results sql loads a saved Results file into a local SQLite table named self, with one row per response. Quote each EDSL column name as a whole, for example [scenario.branch_code]. In a join, place the SQL table alias outside the identifier, as in spring."answer.rating". CSV tables use their original headers. For example, load --table roster roster.csv and join on roster.branch = spring."scenario.branch" when the CSV header is branch. Missing-column errors identify fields on the named input. For a query alias, the hint lists which loaded inputs have the dotted field. When the analyst supplies a SQL file with named tables, use one --table NAME FILE for each input. For example, ep results sql --table spring before.ep --table fall after.ep --query-file compare.sql -o changes.csv runs their query unchanged. To inspect a lookup on its own, use ep results sql --table sites directory.ep --describe. A positional input creates the table self by default. Use --as NAME to give it another name. A saved AgentList or ScenarioList can serve as a lookup table directly. For example, to find missing receipts, use the driver roster as the source of expected respondents and match the printed badge against the receipt. An AgentList exposes name and one column per trait, such as [traits.depot]. A ScenarioList uses its original field names. A field present only in later rows is available throughout, with SQL NULL where it is missing.
For instance, this reminders.sql returns active drivers who still owe a numeric count at a reporting depot. A zero counts as a response, and repeat receipts do not duplicate a reminder.
SQL can calculate several measures with the same denominator, group records, or compute a pooled total in the same report.
When a colleague needs the CSV and you also need the numbers for a meeting, add --preview-rows N to the export. This writes the full file and includes its first N rows as CSV cell text in data.preview.rows. Check data.preview.truncated before interpreting a preview as the complete table. The default export receipt contains the column names, row count and path. Setting --preview-rows 0 explicitly also omits row values. For a preview without saving a file, use --limit N. When comparing survey waves, ep inspect march.ep reports the number of rows with stored and missing agent names. Select the stored name beside the answer.
If the researcher recorded membership IDs as agent names, use agent.name as the candidate linkage field and check that it is unique per wave. Unnamed agents have a null value. The display column agent.agent_name generates a label when a saved name is absent. The spelling alone cannot establish whether a label was saved. A researcher can explicitly name an agent Agent_23. After confirming that the saved identifiers refer to the same people across waves and occur once in each file, join the two waves. This writes one row per matched member. SQL equality leaves unnamed respondents out of the match.
Use --query-file analysis.sql to rerun a calculation on a new file. Brackets and double quotes both identify columns. Use single quotes for text values. A misspelled column such as COUNT("answer.ratng") returns a validation error with similar loaded fields when available. An existing output CSV is preserved. The JSON preview shows up to 20 rows by default. A CSV includes every row the query returns. Use --column repeatedly to load just the inputs to a large analysis. Text identifiers retain leading zeros, numeric ratings remain numeric, and missing answers are SQL NULL. List and dictionary answers are JSON text. For ranked or checkbox answers, json_each produces one row per selection with its original position. For example, this counts first preferences:
Use ORDER BY when the report requires a particular order.

Automation conventions

  • Discover commands and schemas from the installed version before generating inputs.
  • Validate inputs, check every response’s status, and read warnings before continuing.
  • Keep credentials out of logs and shared files. Use the configuration described in Managing Keys.
  • Use saved objects and returned identifiers to continue work. A background submission is not a completed run.
  • Pass explicit pagination, for example ep jobs list --page 1 --page_size 20, and inspect returned pagination metadata.
  • Retry remote operations only when doing so will not duplicate work. Check job status before submitting another run.
  • Obtain explicit user direction before destructive actions such as ep delete or ep jobs cancel; both require --yes.

Exit codes

Use the JSON error’s code, message, and optional suggestion to decide the next step. For example, correct flags after USAGE_ERROR, inspect schemas after VALIDATION_ERROR, and check credentials after AUTH_ERROR.