My son has been trying without much success to teach me how to play chess. I'm completely hopeless, I think I don't have the patience for it :).
I want to get better so I used Amazon Q for command line (CLI) to generate Python code by interacting with Amazon Q from within my terminal to build a Chess Tutor. The tutor explains all the rules to me as I go along.
The following environments are supported for both macOS and Linux:
Shells: bash, zsh, fish.
CLIs: Over 500 of the most popular CLIs such as git, aws, docker, npm, and yarn.
Installing Amazon Q for command line I'm on Windows and Amazon Q CLI doesn't have a native Windows version, so I could use Amazon Q CLI on Windows through the Windows Subsystem for Linux (WSL).
I then initiated a conversation with Amazon Q using the q chat command in my terminal then entered my prompt.
Note that you will need to log into Amazon Q using your AWS Builder ID to allow permissions to Amazon Q for command line.
Initiate a conversation with Amazon Q in the command line
Q CLI created a chess tutor application in Python that helps me learn chess by playing against the computer.
Details of the generated chess tutor application
Q CLI guided me regarding all libraries to install before running the tutor application successfully.
Install required libraries for the tutor application
I encountered some errors once I started running the chess tutor application, and I used Q CLI for troubleshooting.
Troubleshoot with Q CLI
Here's the complete Python code, this is the code generated by Q CLI including the snippets that I inserted guided by Q. I enjoyed the fact that I could still be part of the loop by fixing the errors myself, although Q CLI was happy to provide me the complete updated file had I not been comfortable with making the fixes myself.
Here's the Chess Tutor application that I enjoyed playing at the end of the process. I want to use this to practice so that I can surprise my son the next time we play.
Chess Tutor application
Your move!
I'd love to hear what you build. I provide references below for you to get started with Q CLI and bring your own ideas to life.