Lab
Hello World with Codex, TypeScript, and Bun
Lab: Hello World with Codex, TypeScript, and Bun
Objective
Use Codex as your coding partner to create, run, debug, and explain a simple TypeScript program that runs with Bun.
You are not expected to write the program by hand. Your job is to clearly describe what you want, review what Codex creates, run it, and make sure you understand how it works.
Success Criteria
You have successfully completed this lab when you can:
- Create a dedicated lab project folder inside your
labsparent folder. - Create or select the lab folder as a Codex project.
- Use Zed to write
reflection.md. - Ask Codex to create a small TypeScript program.
- Use Bun to run a TypeScript file.
- Test the program from the terminal.
- Explain what the generated code does.
- Ask Codex for help when the program does not work.
- Make one small improvement or stretch change.
- Create a
reflection.mdfile with your answers. - Turn your lab directory into a public GitHub repository and submit its URL.
Instructions
Open Codex.
Create a new Codex project for this lab.
When Codex asks you to choose a folder, create or select this lab folder inside your course labs folder:
~/labs/hello-world-bun
If your labs folder does not exist yet, create it when choosing the project folder. The goal is for this lab project to live at:
labs/hello-world-bun
- In Codex, click the terminal button in the upper right. The terminal should open in the lower window.
For the rest of this lab, run terminal commands from inside this hello-world-bun project folder unless a step explicitly says otherwise.
- Launch Zed from the Codex terminal while you are in this project folder:
zed .
This opens the same hello-world-bun folder in Zed. Use Zed whenever this lab asks you to create, open, or edit a file.
- Create a file named
reflection.mdin Zed.
Use this file to answer the reflection prompts later in the lab. Save the file in Zed before returning to the Codex terminal to run commands.
- Ask Codex to help you create a simple TypeScript program.
Your program should:
- Print a welcome message.
- Ask the user for their name.
- Store the name in a variable.
- Print a personalized greeting using that name.
- Run with Bun.
You may use this prompt to get started:
Create a simple TypeScript hello world program that runs with Bun.
It should print a welcome message.
It should ask the user for their name.
It should store the answer in a variable.
It should print a personalized greeting using that name.
Please also explain how to run it.
You can improve the prompt if you want.
- Review what Codex creates.
Your project should include at least one TypeScript file. If Codex creates a file with a different name than you expected, write the file name in reflection.md.
- Ask Codex to explain the code to you after it creates it.
Do not skip this step. Your goal is not only to make the program run. Your goal is to understand what the code does.
- Run the program with Bun.
Use the command Codex gives you. It will probably look similar to this:
bun run index.ts
If your TypeScript file has a different name, adjust the command to match your file.
- Test the program from the terminal.
Your exact wording can be different, but the program should follow this basic interaction:
Welcome to AI Applications!
What is your name? Kevin
Hello, Kevin! It's great to meet you.
- If the program does not work the first time, ask Codex to help you debug it.
Do not just paste errors silently. Explain what you tried and what happened. For example:
I ran bun run index.ts and got this error. What does it mean, and what should we change?
After Codex suggests a fix, run the program again and confirm whether the fix worked.
- Make one small improvement.
Ask Codex to add one extra feature. Choose one:
- Ask for the user's favorite programming language and respond to it.
- Ask for the user's age and print a message about learning to code.
- Add colored terminal output.
- Add a loop so the program can greet more than one person.
- Ask Codex to refactor the program into a function.
After Codex makes the change, run the program again and make sure it still works.
- Complete
reflection.md.
Answer these questions:
What did you ask Codex to build?
What file or files did Codex create?
What Bun command did you use to run the program?
Did Codex get it right the first time?
What did you have to change, fix, or ask again?
What extra feature did you add?
What part of the TypeScript code do you understand best?
What part still feels confusing?
- Verify your required files are present:
ls
Your folder should include:
reflection.md
It should also include your TypeScript program file, such as:
index.ts
If Codex used a different file name, that is okay. Make sure your reflection.md identifies the file.
- Run the program one final time before submitting:
bun run index.ts
If your TypeScript file has a different name, adjust the command to match your file.
Required Deliverables
Submit both:
- A short video showing your program running.
- A public GitHub repository URL for your
hello-world-bunlab folder.
Your video should show:
- Your TypeScript file in Zed.
- The Bun command you used to run it.
- The program working in the terminal.
- The extra feature you added.
Your GitHub repository should include:
- your TypeScript program file
reflection.md- any other project files Codex created
Submit Your Lab With GitHub
Before you submit, make sure you are inside your lab directory:
pwd
The path should end with:
labs/hello-world-bun
Initialize Git, commit your work, create a public GitHub repository, and push it:
git init
git add .
git commit -m "Complete hello world Bun lab"
gh repo create hello-world-bun --public --source=. --remote=origin --push
Get the URL for your GitHub repository:
gh repo view --web
Copy the GitHub repository URL from your browser and submit that URL with your lab submission.