My ubuntu partition was formatted EFI, now it's not formatted at all haha. Also, what's the CLI?
A bit confused what you mean by this. EFI stands for extensible firmware interface, and isn't a file system. You can have an EFI partition on a drive, but the EFI partition, most the time, is itself formatted as FAT. The EFI partition provides the system with firmware information about the drive such that it doesn't need an operating system to understand and interact with it.
Did you mean what CLI is in general or what the specific commands are? For the sake of being sure, I'll reply to both
1) CLI stands for command line interface. Anything you write in the Terminal is communication through CLI
2) Can't remember the specific commands, but it's part of diskutil. Try looking through the man pages. I think it should work if you just do "diskutil list" to get the partition ID for the previously Ubuntu partition, then "diskutil remove diskxsy" with x and y replaced by identifiers, and then lastly resize the main partition, which I believe can be done with "diskutil cs resize 100%" but I'm not entirely sure about any of these command, since it's been a while since I've done it, so you better do a bit of looking into it before you try them out.
I have had a similar issue once, where I formatted a partition for Windows with NTFS, but then for some reason I couldn't get Windows installed on it, and through the Windows installer, deleted the partition, returning it to free space.
Then when I tried merging the free space into the main partition through OS X, it wouldn't and I had to do it through the Terminal. The basics of what I did is the above, but the commands may be a bit wrong.
PS. All used commands are documented, aside from the core storage one to resize the cs volume, which at least wasn't documented when I used it, but there are still loads of internet articles on it.