This tool is under active development! Breaking changes may be on the horizon. If you depend on fecli
for day to day use, please reach out to @bruab when stuff goes wrong.
fecli is a command line tool for locally hosting frontend snippets. We use it to develop personalization campaigns and experiments for Optimizely Classic, Optimizely X, Adobe Test & Target, and Google Optimize.
It consists of a local server to host your code and a Tampermonkey script to inject it.
You'll need to have node.js installed locally to run fecli
and the Tampermonkey extension to view variations locally.
npm install -g fecli
- Create local JavaScript, CSS or HTML files to inject
- Create a .json file with the path to these files
- Execute the following command:
fecli host <path/to/some.json>
- Visit https://localhost:8080 and follow the instructions to install the Tampermonkey userscript
- Append
?fecli=activate
to any page on which you want to inject your code
At the minimum, your file must define an array of "files"
to host. For a minimal example, see demo/sample/minimal.json
. Hosting this file with fecli
will inject the contents of a single JavaScript file into the browser.
You can define as many files as you want, with ".js" or ".css" extensions. They'll be added to the page in the order listed.
Optionally, you can define an "inject"
condition to ensure that your code only runs after a certain statement evaulates to true
. TODO example
Code copyright 2015 Celerius Group Inc. Released under the Apache 2.0 License.