This application is a reference implementation for interacting with Medallia Experience Cloud (MEC) services via the command line.
Prerequisites:
- Homebrew (macOS/Linux package manager)
Install via Homebrew for the easiest setup:
# Add the Medallia tap
brew tap medallia/mec-cli
# Install mec
brew install mec
# Verify installation
mec --helpTo upgrade to the latest version:
brew upgrade mecPrerequisites:
- Node.js (version 20 or higher)
- npm (version 11 or higher; comes with Node.js)
- Git (for cloning the repository)
For contributing to the project or local development:
# Clone the repository
git clone https://github.com/medallia/mec-cli.git
cd mec-cli
# Install dependencies and build
npm install
npm run build
# Verify installation
./bin/mec --helpDeveloper Tip: For local development, add
./binto yourPATHor create an alias for easier use:# For bash users echo "alias mec='$(pwd)/bin/mec'" >> ~/.bashrc && source ~/.bashrc # For zsh users echo "alias mec='$(pwd)/bin/mec'" >> ~/.zshrc && source ~/.zshrcAfter this, you can run
mecfrom anywhere in your terminal.Note: If you later install via Homebrew, remove the alias or PATH modification as
brew install mecautomatically addsmecto your PATH.
Configuration profiles are stored in ${USER_HOME}/.mec/profiles as a human-readable INI file with secure file permissions (owner read/write only). Profiles can be managed via commands or edited directly in the file.
# Configure your default profile
mec configure \
--token-url "https://admin-suite-stable.qa.den.medallia.com/oauth/merlin/token" \
--client-id "digital_integration" \
--client-secret "your-client-secret" \
--api-gateway-url "https://admin-suite-stable-merlin.apis.medallia.com"
# Create named profiles
mec configure \
--profile "merlin-qa" \
--token-url "..." \
--client-id "..." \
--client-secret "..." \
--api-gateway-url "..." \
--languages "Spanish,French" \
--output-path "~/Downloads/"mec profiles list # List all profiles
mec profiles list --detailed # Show detailed profile info
mec profiles show --profile "merlin-sbx" # Show specific profile
mec profiles delete --profile "merlin-prod" # Delete a profilemec surveys list # List all surveys
mec surveys list --name "feedback" # Filter by name
mec surveys list --uuid "dfc33eb1-2039-4bb5-b682-0a9dc894b2e5" # Find by UUID# Download translations by survey name
mec translations download --survey-name "feedback"
# Download translations by survey UUID
mec translations download --survey-uuid "dfc33eb1-2039-4bb5-b682-0a9dc894b2e5"
# With language filtering
mec translations download \
--survey-name "feedback" \
--languages "Spanish,French"
# Include HTML content
mec translations download \
--survey-name "feedback" \
--include-html-blocks# Upload translations
mec translations upload --file "translations.xlsx"
# Dry run (preview changes)
mec translations upload --file "translations.xlsx" --pretend-upload| Option | Description |
|---|---|
--profile |
Profile to use |
--languages |
Comma-separated language list |
--output-path |
Custom output directory |
--include-html-blocks |
Include HTML content |
--save-debug-files |
Save debug files for troubleshooting |
--pretend-upload |
Dry run mode |
src/
├── app/ # Application entry point
├── commands/ # CLI command handlers
├── core/
│ ├── adapters/ # HTTP & File system adapters
│ ├── config/ # Configuration management
│ └── services/ # Business logic (surveys, translations)
├── ui/ # User interface (prompts, formatting, parser)
└── utils/ # Utilities (logging, helpers, errors)
mec --help # Main help
mec configure --help # Command-specific help
mec translations download --help # Subcommand helpCopyright 2025. Medallia, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.