For some time, I needed an excuse to jump back into Python programming, even if it's just starting with a small script. I was setting up yet another Ubuntu 24 virtual machine in WSL, and so I brought in the various Linux CLI tools I use into ~/bin. Downloading and extracting each executable from various GitHub projects was getting tedious, so I looked for a tool that could do that. What I found were either yet another binary executable you'd have to download from GitHub, or things that would approach package managers. So, I found my excuse to write a small Python script that would use the GitHub API to find and download Linux executables.
I left active Python programming around the time of Python 3.1, so I had a lot of catching up to do. Using VS Code and its Pylint and Pylance extensions greatly helped me avoid obvious mistakes. Static type checking came a long way since the days of Python 3.1, and in VS Code its Python extension is integrated with Pyright's type checker.
One of the perks of working at Microsoft is that I can get GitHub Copilot, I guess a "Pro+" plan with some yet-to-be-public features, in my personal GitHub account (github.com/benad). The first thing I noticed when turning that on in VS Code is its code generation, which goes far beyond simple code completion. Copilot would guess what I'm trying to code, and most of the time it guessed correctly, so I just press TAB to insert that auto-generated code.
While you could conceivably generate all of the code like that, or by using Copilot's "Agent" mode, I'm trying to learn from that experience, and would rather make some of my own code design decisions. In that case, you can ask Copilot questions in the context of the current code, and it can answer even providing examples that fit in that code. This is far more convenient than having to describe the entire context ("In Python 3", etc.) each time when asking the Copilot app or web site.
Beyond the summaries and examples generated by Copilot, the answer also contains the sources, which more often than not point directly to the correct section of the official reference documentation, at which point I just leave the AI's answers and read the documentation. There are a few instances though where the official documentation (and even the source code) is lacking, and asking for more sample code from Copilot helps. An example is with Python's urllib module: Even its documentation basically says: "Don't use this, use this other module instead", which wasn't of much help since I was intentionally avoiding non built-in modules like the one proposed (the Requests library).
While code generated (or suggested) by Copilot is generally correct, it sometimes output sample code using an outdated approach that do not apply to newer versions of libraries or APIs, so using different models might return more up-to-date results. As an example, when adding support for GitHub API tokens in my script, it used the older HTTP header format to pass the token that isn't recommended anymore. It was another instance of Copilot, this time reviewing my pull request, that found that issue and suggested the new approach, in which case I found GitHub's API documentation to confirm the suggestion.
The final script gh-fetch-release is small and simple enough that it would be possible for someone with little to no programming knowledge to "vibe code" it using only AI code generation. But beyond just my personal learning experience, there was still some value in my human input. For example, I'm the one that insisted in using Object-Oriented Programming to handle the extraction of the various archive formats (see Pull Request #3). While the code generator could be instructed to make use of OOP for that part of the code, adding that to the pile of small (but significant) design decisions makes the prompts closer to a full product requirement document file. This is why, in my case, I get better results when the code generation happens when I started to write the code, since I find it easier to describe the code design that I want in programming language than in human language.
Published on October 13, 2025 at 14:25 EDT
Older post: Git BASH: Home away from home