#3

feat: add fetch hook to add custom user agent

Opennimarbwants to merge intofrom

In our CLI, we want to inject request metadata (such as use agent strings / headers), without patching global fetch, which can become ugly.

therefore, we:

  • add fetch?: typeof fetch to main()
  • thread fetch through addGeneratedCommands into executeAction, so generated CLI commands use the provided fetch implementation.
  • add a test to validate that the fetch is honoured

NOTE: this PR includes my previous PR, let me know if i shall separate because one should be merged before the other. thanks!