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.

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:
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

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:
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. If validation fails, correct the reported problem before running the object.

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. 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. When overriding a saved job, --agent_list, --scenario_list, and --model_list replace the corresponding component. --model replaces the model list with one model; it cannot be combined with --model_list.

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:
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:
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.

Inspect and export saved responses

Use results commands on saved files:
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.

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.