cli/insert: abstract temporary filename generation