In-game code editor

Hello! Has anyone tried to create a game like CodeCombat? I really want to know how to build an in-game code editor to help you interact with the world.
I want to create a game that teaches you coding while playing.

I’ve thought about that before and yes it’s possible. Do you want to create an actual console so players can do real code that controls the system or use game logic and make a mod menu where they type commands?