How to split-test between CLI --alias branches?


After reading this: Split Testing | Netlify Docs I’m trying to setup my first netlify split-test for a React site we deploy using netlify CLI.

We do currently deploy A site like this:
netlify deploy --dir=packages/app/build --prod
netlify deploy --dir=packages/app/build --alias=v4
netlify deploy --dir=packages/app/build --branch=main

and B is deployed like:
netlify deploy --dir=packages/app/build --alias=next
netlify deploy --dir=packages/app/build --branch=canary

(according to --help, --branch is deprecated and we should stick to --alias, but tried both because alias are not being recognized for split-tests)

According to:

This feature requires either continuous deployment or manual deploys with Netlify CLI. If you’re not using Netlify CLI, we recommend connecting a Git repository for continuous deployment.

My expectation is that deploying like this, I could setup a test between main and canary; however split config panel does not show any branches.

How to fix this?

Thank you!

This is documented in a different section, but relevant here: Automatic deploy subdomains | Netlify Docs

We will update the docs on split testing page as well.

Okay so now I understand I’m doing it the wrong way but, what’s the right way to do it?

My site is deployed using the Netlify CLI and it is not using the Netlify git integration.

Thank you very much!

You can’t do this with CLI. Split testing requires branches, which requires git. You can use Edge Functions: Set up an AB Test | Edge Functions on Netlify (

Thank you very much.

I’ll consider available options and pick one.

EDIT: any expectations of ever being able to split-test between CLI deployments?