CLI startup is covered in the AmigaDOS Developer's Manual, section 1.3.1 "Initial Environment In Assembler".
I've got a paper copy, but a quick Google has come up with the following scanned PDF which has a few OCR errors, but is generally readable.
https://retro-commodore.eu/files/dow...0eBook-ENG.pdf