Skip to content

A CLI tool that quickly generates A/B test boilerplate and integrates with Kameleoon for streamlined experimentation.

License

Notifications You must be signed in to change notification settings

kbekher/abtest-cli

Repository files navigation

Douglas AB-Testing CLI with Kameleoon API

License: MIT

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.


🚀 Features


📦 Installation

  1. Clone the repository:
    git clone https://github.com/yourusername/abtest-cli.git
    
  2. Navigate to the project directory:
     cd abtest-cli
    
  3. Link the package globally using npm:
    npm link .
    
  4. In case of an error message, you can use sudo:
    sudo npm link
    
  5. Run the CLI:
    abtest create
    
  6. Follow the prompts to provide input and customize the folder creation process.

🔐 Kameleoon API Configuration

Before using the CLI, configure your Kameleoon API credentials via a .kameleoon_env file in your home directory.

Steps to Create a .kameleoon_env File in the Home Directory:

  1. Open Terminal and navigate to your home directory:
    cd ~
    
  2. Create or edit the .env file in your home directory::
    nano .kameleoon_env
    
  3. Add your Kameleoon credentials (Kameleoon Profile > See my API credentials):
    CLIENT_ID=your_client_id
    CLIENT_SECRET=your_client_secret
    
  4. Save the file:
    • Press CTRL + O, then press Enter to save.
    • Press CTRL + X to exit the editor.

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

⚙️ CLI Workflow and Webpack Capabilities

Running abtest create will:

Start development:

npm run dev

For production-ready code, use one of the following commands:

npm run build // local build
npm run build-dev // build with logs and Kameleoon uploads
npm run build-prod // build without logs and with Kameleoon uploads

All build commands generate a dist folder with minified scripts and update the corresponding Kameleoon experiment. 🚀

alt text

📝 Changelog

See CHANGELOG.md for version history and feature updates.

📄 License

This project is licensed under the MIT License © 2024 Kristina Bekher.

About

A CLI tool that quickly generates A/B test boilerplate and integrates with Kameleoon for streamlined experimentation.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published