Ctrl-d keyboard shortcut equivalent

I am working on a requirement. Here, cli command user input is in multi line mode and ctrl D is given as end of input. When it is by script, some equivalent to ctrl+D is needed. In other words, a user defined string or token which can be used as EOF marker.
I noticed in java, there is maapi.CLIReadEOF(). Is there any way to define any string which can be used for CIIReadEOF() defined in Maapi in java? Is there any setting or customization to achieve this?
Confd version is 7.2.1. Please suggest.
Thanks in advance.

Multi-line mode is just for the CLI user convenience, you do not have to use it from your scripts - just send the value enclosed in double quotes with as many \n as you please.

Thanks. It works well directly via script. But, our client is calling cli via their scripts. Our action callback is executed and multi line string value is set to CDB. But, they don’t have exposure to directly set into CDB. So, looking for solution for eof token which can be used via script. Please suggest if there is any option.