A Look at the Kit Environment
Picking up from the last lesson, if you want to save your conversation, either click the "save" button in the lower right corner of the Script Kit window, or hit Cmd+ Enter
.
![demo](https://res.cloudinary.com/johnlindquist/image/upload/v1686016296/transcripts/01-Conversation-taylor-drafts/zfv7pi9
Transcript
00:00 If you want to save your conversation either click here or hit command-enter and it will grab the entire conversation and write it to a file. Later on we'll explore loading this conversation back into our script, but for now I just want to show you where it's writing the conversation at the end of the script. This is using an inspect function which takes the text that you pass in and writes it to a date stamped file in a temp directory. If we open our file explorer we'll see our .conv and that stands for kit environment. And most importantly it's where your scripts are stored.
00:31 So this Adventure Time script is stored here, and you'll see some other scripts in there I've been playing around with today. And because it's so fast just to create a new script you can just type the name of a script which doesn't exist, hit enter, I'll just type say Hello world, and then I can run this script right away. Hello world. I'll often write scripts even if they're just for one-off tasks, and then I can come back and work on them later if I want to expand their functionality. Now this ChatGPT script is stored in your kenvs, so your kit environments inside of the kit environment, just as an organizational way to have these repos, the examples repo, has these scripts in it that ship with Script Kit, and these kenvs have the same setup as your root kenv.
01:12 It's just a way of separating your personal scripts from scripts you've grabbed from repos online. And again anytime you close VS Code you can open Script Kit, hit commando, it'll pop open your editor whether it's VS Code or something else directly to that script with the workspace being focused on your kit environment. When I open Script Kit and type forward slash it'll bring up the file explorer focused on our home directory. And you'll see that .conv is inside of our home directory and I can navigate in and out of directories with the right and left arrows. And you'll see our temp folder here, tmp, And you'll see we have folders organized by a script name that have text files and error logs and things like that inside of there.
01:52 So if we navigate into here we'll see our conversation. When I hit enter you'll see a few actions we can take. I'm going to just search for open in VS Code, hit enter, and it gives us a way to quickly open files in VS Code from anywhere. Now the last thing you may have noticed is that inside of our scripts directory we do have some TypeScript files in there, and if you prefer TypeScript from the main menu, if you hit tab and search for TypeScript, Now any of the scripts you create will be TypeScript scripts. This doesn't touch any of your old JavaScript files.
02:20 This only impacts newly created files. So if I just say testing new script, hit enter, you'll see this is now in TypeScript. And if I quickly put together a script, We'll just show some markdown. This looks fine. I'll hit save.
02:34 Open script kit. Hit enter. You'll see that it transpiled everything for me behind the scenes.