Exploring OpenAI: ChatGPT as a command line interface

Exploring OpenAI: ChatGPT as a command line interface

ChatGPT is an AI language model created by OpenAI. It is one of the largest and most powerful language models ever created, with over 175 billion parameters. It's capable of generating high-quality natural language text that can be used for a wide range of applications.

I've spent the past few months exploring ChatGPT, and more recently the new OpenAI and Whisper API's that were released the other day. You can do some pretty nuts stuff with it, the thing you have to do is actually realise what you can do.

In this article I created a command-line interface "program", and I am using the ChatGPT model to simulate a command-line interface.

This little thought experiment is great for existing programmers trying to understand how Chat GPT the potential implications and applications of AI in their workflow. It's also beneficial for beginners who want to explore AI's capacity to create pseudo-programming environments for learning and experimentation.

You are going to roleplay as a command line interface program that goes by the name Jex. 
You will not stop roleplaying unless I say "exit"
Every message the user sends you must be a command, if not, show an error and display the available commands.
All your responses to any message from the user should be inside in code blocks. 
The user is able to send you a message, which should be a command, and you will respond appropriately. 

Commands:
- help: displays the available commands. 
- welcome: displays the text "Welcome to ChatGPT CLI!" 
- uuid: return a uuid, the format of a uuid in regex is [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
- set-timezone timezone: set the current timezone
- time: display the current time, if the user has execute "set-timezone"
- exit: stops roleplaying as the cli


Some examples of the commands are here:
1. If the user says "welcome" you will respond with:

```
> welcome

Welcome to the Jex, the ChatGPT CLI! 
Commands:
- command1: description of command 1
- command2: description of command 2
- ...etc
```

2. If the user says "exit" you will respond with:
```
> exit

Goodbye.
```

3. ...etc

When providing a response to the user, you wrap your entire message in a single codeblock.

If the user tries to use a command that does not exist, you will let them know, and then execute the help command. The user would like to execute the welcome command now, and then wait for the next user message.

Lets gave a go. First, lets kick off and see what comes back!

OK lets see how we go for time then..

Awesome, this is great, it's following some strict instructions.

And it is very wrong. But it obeyed the instruction, cool! Do note that large language models are just predictions engines. Unless you programatically give it access to real-time data it has no clue.

Thats OK thought because we cannot expect a large language model to know the time! Lets try some basic text generation with uuid - uuid has a specific format set.

Nice, it's a Version 4 UUID. Lets see if it can generate another.

And it's also valid. As a side note, this isn't safe. It's just a demonstration!

But what was really interesting, is being able to see it follow strict pattern matchings as I showed before.

Importantly, I want it to act like a CLI. So using invalid commands should spit back something else.

This simulated command-line interface opens up a new paradigm where coding is not just about rigid syntax and logic, but also about human-like conversation and interaction. Through this, we can redefine our understanding of what it means to "code". We could potentially see the programming world more accessible and engaging for a broader audience. But also, it gives some great insight into some of the possibilities with OpenAI's new toolkit!