Resolved: Official API method to get list of commands from command palette?

Is there any way through the official API to get a list of available commands (i.e. what’s shown in the command palette)? When running the current version of the app I see app.commands but commands is not part of App in the API, so I was not sure what that meant. I’ve searched the forum for this particular query and skimmed a number the GitHub issues on the API, but am otherwise new to conversations about the API.
Could someone please clarify whether there’s a way to get commands via the API? Thanks!

app.commands.commands has all command’s, it’s not documented, which means that it might change without notice.

You can declare, these undocumented features in your code to use them.
Similar to how its done here:


Thank you for the very helpful answer! Marking this resolved via the title.