A command-line interface (CLI) tool designed to streamline the creation of A/B test boilerplate code, as well as the creation and management of experiments in Kameleoon.
With this tool, you can quickly generate the necessary structure and components needed to set up A/B tests for your projects — saving time and ensuring consistency.
- Full integration with the Kameleoon API
- CLI-based experiment creation, goal setup, and variation assignment
- Auto-generated folders and dev environment
- Webpack-based builds that automatically update your Kameleoon code
- Compatible with @douglas.onsite.experimentation/douglas-ab-testing-toolkit
- Clone the repository:
git clone https://github.com/yourusername/abtest-cli.git 
- Navigate to the project directory:
cd abtest-cli
- Link the package globally using npm:
npm link .
- In case of an error message, you can use sudo:
sudo npm link 
- Run the CLI:
abtest create 
- Follow the prompts to provide input and customize the folder creation process.
Before using the CLI, configure your Kameleoon API credentials via a .kameleoon_env file in your home directory.
- Open Terminal and navigate to your home directory:
cd ~ 
- Create or edit the .env file in your home directory::
nano .kameleoon_env 
- Add your Kameleoon credentials (Kameleoon Profile > See my API credentials):
CLIENT_ID=your_client_id CLIENT_SECRET=your_client_secret 
- Save the file:
- Press CTRL + O, then pressEnterto save.
- Press CTRL + Xto exit the editor.
 
- Press 
Now, the CLI will read your Kameleoon credentials from the .kameleoon_env file in your home directory to obtain Kameleoon access token whenever it's executed. 😉
Running abtest create will:
- Create a local folder for your experiment
- Automatically create an experiment in Kameleoon
- Install all necessary packages, including:
- @douglas.onsite.experimentation/douglas-ab-testing-toolkit, version ^2.0.0
 
npm run devnpm run build // local build
npm run build-dev // build with logs and Kameleoon uploads
npm run build-prod // build without logs and with Kameleoon uploadsAll build commands generate a dist folder with minified scripts and update the corresponding Kameleoon experiment. 🚀
See CHANGELOG.md for version history and feature updates.
This project is licensed under the MIT License © 2024 Kristina Bekher.
