Skip to main content

optimizely-cli is a command-line interface for Optimizely projects.

It aims to give you quick access to your experiment data as well as store a local copy of your data so that you can manage and track changes in the version control system of your choice.

System Requirements

optimizely-cli runs on Linux and Mac OS X, and requires Python 2.7.x+. It may work on other versions of Python.

Installation

Install or upgrade optimizely-cli using pip:

$ pip install –upgrade optimizely-cli

If you get some sort of error about TLS versions like this:

“There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION]”

Then install a newer version of pip and then install again:

$ curl https://bootstrap.pypa.io/get-pip.py | python

Getting Started

To use optimizely-cli, you need to link it to your Optimizely account. The quickest way to get started is to run the opti init command and follow the instructions:

$ opti init
    First visit https://app.optimizely.com/v2/profile/api to create a new access token
    Enter the token you created here:
    Verifying token...
    Token is valid
    Credentials written to .optimizely-credentials.json
    Do not add this file to version control!
    It should stay private

    Checking for an existing project...
    Successfully created project (id: <project_id>)
    Config file written to .optimizely.json

You can move .optimizely-credentials.json to your home directory (the opti tool will look there as long as your project is under your home):

$ mv .optimizely-credentials.json ~/

Or add it to your .gitignore file like this:

$ echo .optimizely-credentials.json >> .gitignore

Don’t commit your credentials to version control!

Usage

For a full list of commands, just type opti at the command line. Here are some examples of available sub-commands:

attribute

Manage Audience Attributes

audience

Manage Optimizely audiences

environment

Manage Environments

event

List, create, and manage Optimizely events

experiment

List, create, and manage Optimizely experiments

feature

Manage Features

group

Manage Optimizely exclusion groups

init

Link an Optimizely project with your repository

project

List, create, and manage Optimizely projects

pull

Pull down the current state of an Optimizely project

push

Push back local data to an Optimizely project

Examples

Get a list of projects

$ opti project list

Create a new project

$ opti project create

Get a list of events

$ opti event list

Create a new event

$ opti event create new_event

Pull all Optimizely experiment data and write them to a local optimizely/ directory

$ opti pull

Collect changes to your local optimizely/ directory and apply them your data in Optimizely

$ opti push

Command Completion

The opti utility can complete your commands. Just add the following to your .bashrc:

eval “$(_OPTI_COMPLETE=source opti)”

Contributing

Please see our Contributing Guidelines.

Additional Code

Please see Additional Code.

Any use of the Optimizely Service is subject to our Terms of Service or the separate, written agreement between your company and Optimizely (if any).

Release files for optimizely-cli 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for optimizely-cli 0.3.0
File Size Uploaded
optimizely-cli-0.3.0.tar.gz 19.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for optimizely-cli 0.3.0
File Interpreter ABI Platform
optimizely_cli-0.3.0-py2-none-any.whl Python 2 none any Details

Total release size: 52.6 kB

Release files / optimizely-cli-0.3.0.tar.gz

Download URL optimizely-cli-0.3.0.tar.gz
Size 19.3 kB
Tags Source
SHA-256 checksum
How to use checksums
64259ece76546e9640baf4489a6e0ef7f2a85a53c889cd84d30a6ff6720541d0
BLAKE2b-256 checksum
How to use checksums
baefb8ed388d89aa42f798eb50bf6deca100e4bdf927132f74b46960093e3aff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.12

Release files / optimizely_cli-0.3.0-py2-none-any.whl

Download URL optimizely_cli-0.3.0-py2-none-any.whl
Size 33.3 kB
Tags Python 2
SHA-256 checksum
How to use checksums
3ea521abe280ae23fdcee13c9954e1412eaf02cca093d6f83a78871c9512a177
BLAKE2b-256 checksum
How to use checksums
6154c5a51267dc2bc006475450b8e8737911db7df9cbe82954ce3849e9e543a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.12

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page