Skip to content

About

Agent-friendly CLI for the Qualtrics Experience Management Platform & offline survey compiler

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

53 Commits

Folders and files

Repository files navigation

qualtrics-cli

qualtrics-cli

Agent-friendly CLI for the Qualtrics Experience Management Platform & offline survey compiler.

CI Release License Go

qualtrics-cli gives researchers, data teams, scripts, and AI agents a stable terminal interface for Qualtrics: query surveys, definitions, asynchronous response exports and imports, distributions, contacts, webhooks, compile offline survey specifications to QSF, and call unmapped APIs directly.

Highlights

  • Agent-first: stable JSON envelope ({ok, data, error, meta}), separated stdout/stderr, request UUIDs, and machine-readable error codes
  • Safety gates: --read-only, --dry-run, and --confirm gates; destructive operations (deleting surveys and their responses) require typed confirmation
  • Offline survey compiler: compile plain-text Markdown survey specifications directly to Qualtrics Survey Format (.qsf) files (qualtrics definitions build) without requiring API access
  • Async jobs as first-class commands: response exports and imports expose start, status, and download/upload with optional --wait polling and automated archive extraction
  • Full Survey Platform surface: complete coverage of surveys, nested definitions, granular questions/blocks/flow/options CRUD, distributions, XM Directory mailing lists & contacts, and event subscriptions
  • Raw escape hatch: qualtrics raw <METHOD> <path> for immediate authenticated access to any endpoint

Why

Qualtrics is powerful in the browser, but automation often breaks because browser flows are slow and many brand accounts restrict REST API tokens (AuthZ_2.0), leaving researchers and autonomous agents blocked.

qualtrics-cli provides both:

  1. A complete REST API client for accounts with API access.
  2. A 100% offline survey-to-QSF compiler allowing users to describe surveys in Markdown and generate .qsf files ready to import via the Qualtrics web UI with zero API permissions needed.

Quickstart

Install

Run the following on macOS or Linux:

curl -fsSL https://raw.githubusercontent.com/thedavidweng/qualtrics-cli/main/install.sh | sh

Run the following on Windows (PowerShell):

powershell -ExecutionPolicy ByPass -c "irm https://raw.githubusercontent.com/thedavidweng/qualtrics-cli/main/install.ps1 | iex"

The binary installs to /usr/local/bin (or ~/.local/bin).

Other installation methods

Homebrew Cask (macOS/Linux):

brew tap thedavidweng/tap
brew install --cask qualtrics

Go:

go install github.com/thedavidweng/qualtrics-cli/cmd/qualtrics@latest

Manual download: Grab the archive for your operating system from the latest GitHub Release, extract it, and place the qualtrics binary on your PATH.

Set up

qualtrics auth set-token
qualtrics auth set-datacenter pdx1
qualtrics auth status        # validates credentials and checks brand API access
qualtrics doctor             # validates local configuration files

Credentials live in ~/.config/qualtrics-cli/config.yaml (mode 0600). The token can also be supplied via QUALTRICS_TOKEN or env:NAME secret indirection.

1. Offline Workflow: Text to QSF (No API Required)

Create a survey specification file survey.md:

---
title: Customer Feedback Survey
language: EN
---

# General

## How satisfied are you with our platform? [mc]* @satisfaction
- Very satisfied
- Satisfied
- Neutral
- Unsatisfied

## What can we improve? [text-essay]

Compile it to a .qsf file and inspect its structure:

qualtrics definitions build survey.md -o survey.qsf
qualtrics definitions qsf summary survey.qsf

Import into Qualtrics: Create Project → Import a QSF File.

Question types are [mc], [mc-multi], [mc-dropdown], [rank], [text], [text-essay], [matrix], [matrix-multi], [likert], and [description]; an unknown [type] falls back to [text]. See docs/qsf-spec.md for the full syntax reference (choices, scales, text entry, logic, labels, translations, and build warnings).

2. Online Workflow: API Operations

# List all surveys
qualtrics surveys list --json

# Inspect a survey definition
qualtrics definitions show SV_0123456789123

# Export survey responses with polling and automatic extraction
qualtrics responses export start SV_0123456789123 --format csv --wait --extract

# Send a raw API request
qualtrics raw GET /surveys

Uninstall

rm -f /usr/local/bin/qualtrics ~/.local/bin/qualtrics
rm -rf ~/.config/qualtrics-cli

Commands Overview

Command Group Description
auth Manage credentials (status, set-token, set-datacenter, logout)
doctor Check local configuration and environment
definitions build Compile plain-text Markdown survey spec to .qsf
definitions qsf Offline tools for .qsf inspection (summary) and conversion (convert)
surveys Survey management (list, show, create, delete)
definitions Survey definition documents (show, export, import)
definitions questions Granular question CRUD (list, show, create, update, delete)
definitions blocks Granular block CRUD (list, show, create, update, delete)
definitions flow Survey flow inspection and update (show, update)
definitions options Survey options inspection and update (show, update)
responses export Asynchronous response export jobs (start, status, download)
responses import Asynchronous response import jobs (start, status, upload)
distributions Survey distributions and link generation (list, show, create, delete)
distributions links Distribution link management (list, show, create, update, delete)
directories XM Directory containers (list, show, create, update, delete)
directories mailinglists Mailing list management (list, show, create, update, delete)
directories mailinglists contacts Contact records (list, show, create, update, delete)
events subscriptions Webhook event subscriptions (create, get, delete)
raw Authenticated passthrough for any Qualtrics endpoint

See COMMANDS.md for the complete flag documentation and JSON_SCHEMA.md for the stdout envelope contract.

Configuration

~/.config/qualtrics-cli/config.yaml:

default_profile: default

profiles:
  default:
    datacenter: pdx1
    auth_method: token
    token: env:QUALTRICS_TOKEN
    timeout: 30s
    read_only: false

Configuration precedence: defaults → config file → QUALTRICS_* environment variables → flags.

Safety Model

Tier Example Commands Gate
read surveys list, definitions show, doctor None
remote_action responses export start, responses import upload --confirm (or --dry-run)
mutation distributions create, definitions questions update --confirm (or --dry-run)
destructive surveys delete, contacts delete Typed confirmation (or --confirm)

--read-only blocks all remote mutations and destructive commands. Exit codes:

  • 2: Invalid arguments
  • 3: Authentication required or invalid token
  • 4: Read-only mode violation
  • 5: Rate limit or network timeout
  • 6: API error or endpoint unauthorized (AuthZ_2.0)
  • 7: Validation failure
  • 10: Confirmation required

Roadmap

Postman collections in the Qualtrics public workspace:

Collection Status Notes
Survey Platform (Core) ✅ v1.0 Complete coverage (49 endpoints)
Offline Survey Compiler ✅ v1.0 Pure-Go Markdown → QSF compiler
XM Directory Extended 🔜 v1.1 Contact deduplication, transactions, directory settings
User Management 🔜 v1.1 Users, groups, and division management
CX / Discover ⬜ Planned Dashboards, tickets, sentiment analysis
Employee Experience (EX) ⬜ Planned 360 cycles, participants, engagement pulses
Research Core Panels ⬜ Planned Legacy panel/sample endpoints
Site Intercept ⬜ Planned WRAPI system (survey.qualtrics.com/WRAPI)

Planned capabilities:

  • OAuth 2.0 client credentials grant (auth login)
  • responses synthetic — generate synthetic survey data from declared behavioral priors

Acknowledgments

Development

mise run check      # fmt + build + test + lint + conventions
mise run drift      # verify endpoint catalog synchronization
mise run test-live  # live endpoint tests (when working token is configured)

Architecture decisions are recorded in docs/adr/.

License

Apache License 2.0 — see LICENSE.

About

Agent-friendly CLI for the Qualtrics Experience Management Platform & offline survey compiler

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages