Feature flags, environments and change requests on Split.IO (Harness FME),
through the Admin API under /internal/api/v2. The reads list workspaces,
environments, flags and change requests; every write files a change request
that Split’s approvers then accept or reject. toil never changes a flag directly.
Verification level: unit.
Supported versions: The oldest Split.IO Admin API version toil supports hasn’t been established. toil calls the
Admin API under /internal/api/v2 with an Admin API key sent as a Bearer header. It
has not been run against a live Split account yet.
Credential
A Split Admin API key: in Split, Admin settings → API keys → Create API key, with
the type Admin. toil sends it as Authorization: Bearer <key>. There is no login and
no token exchange.
Configuration
| Key | Env var | Required | Meaning |
|---|---|---|---|
baseUrl | TOIL_SPLITIO_BASE_URL | yes | Admin API root, normally https://api.split.io |
adminApiKey | TOIL_SPLITIO_ADMIN_API_KEY | yes | Admin API key |
workspace | TOIL_SPLITIO_WORKSPACE | no | Default Split workspace (project) ID, used when --ws is not given |
There is no CI fallback variable.
export TOIL_SPLITIO_BASE_URL=https://api.split.io
export TOIL_SPLITIO_ADMIN_API_KEY=<your Admin API key>
Or ~/.toil/config.json:
{
"version": 2,
"connections": {
"split": { "area": "splitio", "baseUrl": "https://api.split.io", "workspace": "<workspace id>" }
}
}
The key never goes in this file; a plaintext one there is refused with
CONFIG_INVALID. Run toil connections add split --area splitio to keep it in the
OS credential store, or set TOIL_SPLITIO_ADMIN_API_KEY.
The workspace is --ws
Every command but workspace list and change-request get acts in one Split
workspace: --ws <id>, else the connection’s workspace. Over MCP the field is
workspace. On the CLI, --workspace is toil’s own flag for the folder commands
may read files in, so --workspace <split id> doesn’t name the Split workspace; a
command left without one fails with INVALID_INPUT saying to pass --ws.
Commands
Reads:
workspace list: List all Split.IO workspaces, every page.environment list: List environments in a workspace.flag list: List feature flags in a workspace.--limit(default 50, Split’s maximum) and--offset(default 0);data.totalCountis Split’s total.--flag-setis sent asflagSetName, which Split’s reference doesn’t document, so the result carries a warning to comparetotalCountwith an unfiltered list.flag get <flag>: Get a flag, or with--environmentits definition in that environment: treatments, rules, default rule, kill state.change-request list: List Change Requests for a workspace (--environment,--status; Split returnsREQUESTEDones when--statusis unset).--limitdefaults to 25 (Split allows 1 to 100). Split pages by marker: passdata.nextMarker(alsometa.page.nextCursor) as--afterfor the next page.--offsetaccepts only 0, andtotalCountisnull, since Split reports none.change-request get <id>: Get a Change Request by ID.
Writes, each a change request against one --environment. They need writes: true
on the connection and --allow-write on the call. Every one takes --mnemonic (the
title), --description (the comment), --change-number (added to the comment as
“Change number: …”, since Split has no field for it), --approvers (comma-separated
email addresses, only where the environment lets submitters choose) and
--rollout-status <id> (a rollout status ID; Split’s guide says KILL doesn’t need
one, and the others may).
flag update <flag>: Replace a flag’s definition with the JSON object in--input-file(-reads stdin on the CLI). Start fromflag get <flag> --environment.flag set-rule <flag>: Change rule--rule-index(from 0) to one--treatment(a 100% bucket) or--weights(a JSON array of{treatment, size}, sizes in percent; anything but an array is refused). The rest of the definition is copied from the current one.flag set-default <flag>: Set the default rule to one--treatmentat 100%.flag toggle <flag>:--enabled false(or0) kills the flag; any other value restores it,offandnoincluded. A value other thantrueor1that restores adds aSPLITIO_TOGGLE_RESTOREDwarning tometa.warningssaying so.flag toggle-many: One change request per entry of--input-file, a JSON array of{flag, enabled}, titled<mnemonic> — <flag>. A failed entry doesn’t stop the rest; it’s reported inresults[]withok: false, the envelope staysok, andmeta.warningssays how many failed.enabledis read by truthiness, so the string"false"restores. Every entry must have aflagname; if one doesn’t, the command fails withINVALID_INPUTnaming the entry, before any request is filed.flag kill <flag>,flag restore <flag>: Kill or restore a flag in the environment.flag archive <flag>: Remove a flag’s definition from the environment (Split’sARCHIVEchange request; not Split’s flag-archive API). CLI only: it removes a definition, and deletes are never served over MCP.
toil splitio workspace list
toil splitio flag get new_checkout --ws <workspace id> --environment <environment id>
toil splitio flag kill new_checkout --ws <workspace id> --environment <environment id> \
--mnemonic checkout-off --description "Kill during incident" --change-number CHG0001234 --allow-write Settings at a glance
-
baseUrlrequiredAdmin API root, e.g. https://api.split.io
TOIL_SPLITIO_BASE_URL -
adminApiKeyrequired secretSplit Admin API key
TOIL_SPLITIO_ADMIN_API_KEY -
workspaceDefault Split workspace (project) ID, used when --ws is not given
TOIL_SPLITIO_WORKSPACE
Commands at a glance
toil splitioworkspace listList all Split.IO workspaces
toil splitioenvironment listList environments in a workspace
toil splitioflag listList feature flags in a workspace
toil splitioflag getGet a flag definition
toil splitioflag updatewriteSubmit a Change Request to replace a flag's full definition in an environment
toil splitioflag set-rulewriteChange one targeting rule without altering the rest of the flag definition
toil splitioflag set-defaultwriteUpdate the fallback default rule for traffic matching no targeting rule
toil splitioflag togglewriteEnable or disable a single flag via a Change Request
toil splitioflag toggle-manywriteEnable or disable multiple flags from a JSON file (each creates its own Change Request)
toil splitioflag killwriteSubmit a Change Request to kill (disable) a flag
toil splitioflag restorewriteSubmit a Change Request to restore a killed flag
toil splitioflag archivewriteCLI onlySubmit a Change Request to remove a flag's definition from an environment
toil splitiochange-request listList Change Requests for a workspace
toil splitiochange-request getGet a Change Request by ID