What is the purpose of what's being written? This is core to providing a relevant answer.
First off I'm going to dismiss that a correct answer is a link to some "official" style guide and that anything less is not an answer. There's no criteria for picking such a guide to be a/the "correct" guide, and they're just conventions anyway, not hard and fast rules. I'm instead going to focus on style as a means of accurately conveying information to a target audience.
For a paper, article, or PowerPoint where you're talking about the commands but where it isn't a guide that people will be working from, I'd say capitalize to avoid the confusion about whether or not the preceding period is part of the command:
Linux has many nice programs. vi is a popular editor.
Linux has many nice programs. Vi is a popular editor.
To an uneducated eye, it's not clear if ".vi" is a file extension or some techie jargon - they don't know whether or not to parse the sentence on the period.
You can also use quotes to clariy:
Linux has many nice programs. "vi" is a popular editor.
Linux has many nice programs. "Vi" is a popular editor.
But for documentation, or a how-to article, or a textbook, or even a presentation or article with a techie target audience, it's more clear to stylize the code in a different, monospaced font and with a slight highlight color, just as it appears in your question or in established docs like the python docs here.
I have written a lot of documentation for Python, Powershell, SQL, and others over the last 5 years and I have found this convention to be the most clear and unambiguous.