CX as Code CLI: Extracting full Architect flow JSON via CLI vs API

We’re trying to version control our Architect flows, but the standard export from the UI is a bit messy. I want to pull the raw JSON definition of a specific flow using the CX as Code CLI to feed it into our CI/CD pipeline.

The goal is to get the exact same JSON structure that the Architect API returns, but I’m hitting a wall with the CLI syntax. I’ve been digging through the docs, and it seems like the genesyscloud CLI doesn’t have a direct export flow command that outputs the full JSON payload to stdout like I need for a script.

I tried using the generic API call wrapper in the CLI:

genesyscloud api -v v2 -m get -e /architect/flows/{flowId}

This works, but it dumps a ton of metadata and the JSON is minified, making it hard to diff. I need the pretty-printed, canonical JSON.

Is there a flag I’m missing? Or do I have to pipe this into jq?

$ genesyscloud api -v v2 -m get -e /architect/flows/abc123 | jq .

That feels hacky. I remember seeing something about a genesyscloud architect flow export command in an old beta, but it’s gone now.

Also, when I use the API endpoint directly via curl with my OAuth token, I get the JSON, but the id field is always present. I want to strip the id and version for the template file.

Here’s what the API returns:

{
 "id": "abc123",
 "version": 4,
 "name": "Main Menu",
 "flowType": "voice",
 ...
}

I need the structure without the instance-specific IDs. Is there a CLI flag for --template or --no-id? Or am I just supposed to use a post-processing script?

We’ve got like 50 flows to export. Doing this manually is not an option.

Any ideas on the cleanest way to script this extraction? I’m on CLI v1.6.2.