ChatGPT's ability to emulate a terminal is amazing! It's probably achieved by combining few-shot prompting with a "memory" of past interactions. Check out this notebook that replicates Python terminal examples using codex + standard prompting + memory: