Trying to export a penpot file using penpot-export and modify it in place

Hi All.

I am trying to automate exporting and modifying a penpot file and modify it. I am also trying to basically generate png files using a single penpot file as a template.

  1. i have seen the docs for getting the actual file but nothing about the file format so far. Where are the docs on the file format once i donload it . is it just json ? is that json documented anywhere ?

  2. this is the error i am getting when i do penpot-export now. i tried with node 20 (as shown below) and node 22. both resulting in the same error.

-→ penpot-export 

/home/ymo/3rdp/github/penpot/penpot-samples/test00/node_modules/node-fetch/lib/index.js:273
                                return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
                                                           ^
FetchError: invalid json response body at https://design.penpot.app/api/rpc/command/get-file reason: Expected property name or '}' in JSON at position 878
    at /home/ymo/3rdp/github/penpot/penpot-samples/test00/node_modules/node-fetch/lib/index.js:273:32
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  type: 'invalid-json'
}

Node.js v20.12.2