CLI vs. IDE for AI Coding 💪
Why this nerd prefers the command line over a UI for vibe coding and how to do it if you want to give it a whirl
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
🦊 New Blog — Security and AI Research: https://teriradichel.substack.com/
⚙️ Security Automation (Pre-AI). The Code.
⚙️ AI Automation. The Code.
🔒 Related Stories: Cybersecurity | Penetration Tests
💻 Free Content on Jobs in Cybersecurity | ✉️ Sign up for the Email List
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I haven’t written for a while because I’ve been very busy working on getting some projects completed. If you want to get random tips, ideas, and updates on my progress make sure you’re following me on LinkedIn, Mastodon, Bluesky, X, Threads, Facebook, or all of the them — just find me @teriradichel or similar. My name is pretty unique apparently. I post random snippets about tips and tricks or issues I faced while vibe coding. Sometimes I post nearly a whole blog over there as a kind of brain dump because I don’t even have the time to login over here.
One of the things I randomly posted which I wanted to document over here is why I prefer using Q CLI over something the Visual Studio offshoots like Kiro from AWS which I’m sure is pretty darn cool. At least that’s what my fellow AWS heroes say who got an early peek at it. It lets you do spec driven development which I’m guessing is similar to what I am attempting to do on the command line and perhaps it works even better than what I am doing. For now.
So if you are like 99.5% of the developers out there who prefers to work in a UI then I’d suggest checking out Kiro and how spec driven development can improve the quality and outcome of your vibe coding:
I say 99.5% because this past summer I was at Amazon for a heroes event and a really funny guy who works for AWS stood up and asked us a bunch of questions to warm up the crowd. Do you program like this or that. What kind of AWS services do you use. And so on. Oddly I found that almost everything he was talking about didn’t apply to me. I do things in my own way I guess. And I’m working on things that are a bit different than I used to as a pentester versus a back office developer for banks and retail companies or an e-commerce developer for startups and so on.
The one question I finally raised my hand for was this. He asked how many people like Visual Studio versus…I can’t remember but other GUI IDEs. If you don’t know what an IDE is it’s an integrated development environment. It’s basically an application where you write your code and it helps you do things like add break points and it gives you command completion as you are typing and squiggly lines under code when you’ve made a syntax mistake.
I’ve used IDEs in the past like Visual Studio, Access, IntelliJ, Eclipse, Sublime Text, XCode, and so on. Even Google Developer in Chrome Browser can work as an IDE when you’re doing web development (or reversing things 😉). All those tools can be very handy.
But even when I had an IDE I would do weird things like insert an error into my code to produce a “breakpoint” and print things out to “watch” variables — some things that IDEs help you do. It just seemed faster than trying to remember which menu to use and what all the little shortcuts are and so on. The two things I found most useful about IDEs — code completion and testing multi-threaded applications.
But that was then…now I can easily search and copy code and it doesn’t take me too long to sort out typos …most of the time. I can finagle a way to see my threads and test values if I have to…
Finally, he asked a question for which I could raise my hand — yes I do that.
How may people use vi as their primary code development tool? 🙋♀️
I’d say there was maybe 150 people in the room and like three of us raised our hands. So I understand I’m not in the majority here and it’s not for everyone. But this post will explain, as a security professional and programmer with 30 years of experience, why I have trended towards a CLI only approach to programming over many years of programming.
And generative AI has just made it a whole lot easier.
Over the years as security became more of an issue, I didn’t want to install things on my laptop. I want to run everything on a cloud instance. Do you know how many breaches have resulted from developer networks or laptops becoming compromised? A LOT. With some AI tools it’s becoming even worse.
This is critical for me because as a penetration tester I do as much as possible to avoid putting my customers’ data at risk while testing.
Here are a few examples of how developer laptops have been a source of compromise — and there are many others:
Safe published a preliminary report on Mar. 6 attributing the breach that led to the Bybit hack to a compromised developer laptop. The vulnerability resulted in the injection of malware, which allowed the hack.
The DEV#POPPER campaign targets developers with fake job interviews.
The attack is carried out in the same manner as we observed in our previous report on DEV#POPPER. The threat actors pose as interviewers for a developer position and present the interviewee with a ZIP file package (onlinestoreforhirog.zip in this case) as part of a practical portion of the interview.
A Lastpass breach was the result of a compromised developer machine:
Our investigation determined that the threat actor gained access to the Development environment using a developer’s compromised endpoint
A DOGE engineer’s laptop got compromised which had access to government resources.
AI vibe coding is making the risk even greater. If you’ve followed me on social media as noted above, you’ve seen me post about the things AI is trying to do on my laptop without permission — and even though I have guardrails in place.
Not only that, even as pulling in a bunch of rando code and using it became all the rage — back around when Java Spring and JQuery emerged…I never liked it! I want to know what is in my code. What are all the paths it an take. What can it do? What is all that junk? What could go wrong? This was long before people were making a big deal about supply chain attacks which you 1000% should be well versed in in you do any kind of software development in any way, shape, or form.
Think log4j…
I like to take the packages I do use and strip them to the minimum, inspect them, compile them from scratch to see what is in them. Have you ever done that with rust to see the very most low-level packages that the whole house of cards relies on? Like if you try to build rust from scratch and get all the crypto crates and such…some of those ask for crates with random names that leads you to some guy’s random GitHub account. Maybe that guy is amazing, I don’t know. But what if something happens to him. And it’s crypto?!
Getting started programming on the command line is EASY 🍳😌🫰
I use Amazon Q CLI.
- Download it
- Install it
- Type q login.
- Login
- Type q chat
- Ask it to write some code for you to do something.
That’s it.
Now the login part is a bit of a pain. I have some posts on that. I wish I could just use an AWS IAM user with an MFA token on an EC2 instance to assume a role with MFA. But I can’t. So I explain some options for creating an account to use with Q CLI in some other posts.
In this post I showed how I learned Rust basically in a day. Of course I was not an expert in one day and I already have 30+ years of experience having started programming at age 12 when no one had computers, but this shows how I did it.
Learning Linux and vi commands
The one thing that may take a little time is learning all the linux and vi commands. How do you list files, change directories, see running processes on your system, inspect network traffic, etc etc.
Well the nice thing is doing all those things now is as easy as opening Q in the AWS console or Google aimode (no login — nice for non-sensitive queries) and asking “how do i…”
https://google.com/aimode
Get Teri Radichel’s stories in your inbox
Join Medium for free to get updates from this writer.
You’ll get the command to do whatever it is you are trying to do in most cases — syntax free — and without digging through 100 web pages. Sorry stack exchange. It’s sad but it is soooo convenient.
Caveats on coding with AI ⚠︎⚠︎⚠︎⚠︎
If you’re trying to learn a new language AI can help you get off the ground faster — with the big caveat that all these AI tools write horrible code architecturally. You still need to study primitive software principles, design pattens, and software architecture to get AI to write some decent production ready code.
But for me, having years of background writing software and how to construct things properly, I could ask how do I do this software architecture concept (like generics or interfaces and such) in rust and got up and going much faster than if I had started with the rust documentation.
Most of that is applicable whether you’re using the IDE or command line. But here’s the thing I would want to test out if you’re using an IDE. I used the default AWS CLI agent at first. It was going ALL OVER MY MACHINE getting into things I didn’t want it to touch. I had some AWS credentials on that machine (which I have since deleted and rotated) that Q kept saying it needed when it DID NOT for the tasks at hand. I find that troublesome.
At some point the Q CLI was trying to access it’s own code for some unknown reason. I was not asking it anything about it’s own code. I was asking about the code in the project I was working on in the folder where I started the agent.
In another case I was frustrated that Q wasn’t following the rules I wrote in my context file. I would ask Q to read them and print them out for me to prove that it had read the rules. Sometimes Q randomly prints out the system context or whatever that is called that in theory I am not supposed to see. I don’t know if that would qualify as a vulnerability but it’s so easy to do when that’s not even what you’re asking it to do or trying to do.
There’s this guy on X that breaks into this stuff constantly who calls himself Pliny the Liberator (@elder_plinius). One day I opened my account and because I follow him just to see what he’s up to there was X’s little chick agent dancing around doing nasty things he got it to do despite all the guardrails. He had posted it in response to Elon Musk’s post that his girly bot was “alright” and Pliny replied “Are you sure about that?”
So no, I don’t think context provides sufficient guardrails and I don’t want an IDE that only relies on AI context installed on my developer laptop. Not to mention that you’ve got agents randomly talking to MCP servers and other agents and doing things you don’t even ask them to do.
Agents — risks and benefits 🤖 🤖 🤖 🤖 🤖 🤖
I wrote about creating a custom agent for Q CLI here:
With that agent you can specify context and create a configuration file which in theory specifies what Q can and cannot do. Forget that. It doesn’t abide by that at all.
The first line of my context for all my agents says “Never use sudo”. I also have restrictions on that if I’ve done it correctly in my configuration. Q still tries to use sudo and when not available, asks me to login so it can do things it shouldn’t be doing. I don’t know if it’s actually Q or the model but I don’t want to get hung up on technical details. And it’s not specific to Q or Claude.
By virtue of how these AI models generate text and code, they are trying to predict and create some text and take some actions based on what it has generated. No matter how many words you use the language we use has so many variations and is so complex I don’t think there’s any way to prevent loopholes using AI context or in-model guardrails.
Beyond our language the whole model is using relationships between tokens — not English or Spanish or French. There may be linkages between tokens that AI models make and use that aren’t even real things a human would ever say.
⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️
It’s like if you’ve ever heard the Hawaiian slang “da kine” which is kind of like our word “thingamajig”. It’s a placeholder for a word you can’t think of or don’t want to bother to say but the other person knows what you mean based on the context. Sometimes I think my mind works like that and just leave out words and think everyone should know what I mean but they don’t.
The AI models might find some novel path through the weave of tokens to get to the correct end result or objective even if the path makes no sense to us. And that’s why using in model context to try to prevent bad actions is almost useless if you ask me.
⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️
But more on that in my next post and some things I’ve been working on to put safeguards around my vibe coding agents by adding Linux permissions around each one for specific tasks. For now how this all this relates to using a terminal with vim and Q CLI versus Kiro or any other IDE you might choose.
Security 🚔🔒👮🚨
So the first core theme here is — I want to work on an E2 instance not my laptop. Adding tools that may have vulnerabilities or exposing credentials to my own laptop on the various networks I may connect to is a risk. I choose not to install hardly anything on my development laptop. If I must be forced to use Zoom or some other suspect software that makes random connections to the Internet I use some other machine. I try to avoid clicking on links on my laptop though sometimes that is unavoidable. I mostly check mail on a different device as well.
And by the way have you ever inspected the network traffic all those software tools generate and all the things they connect to when you run them? They try to go to get updates and VS Code tries to connect to like 50 different endpoints for who knows what reason. I hate that. I like to really understand what is in my network traffic.
All the random connections that browsers and connecting to the AWS console are bad enough. I try to understand what each connection in the AWS console relates to when I open it up and block regions I don’t want to be connecting to. Pile Microsoft stuff on top of that and you’ve got a huge mess. I also block Apple connections, by the way, unless I’m updating my laptop and specifically NEED all those connections. It’s very difficult to minimize connections when using IDEs and Github on your local laptop where you store your credentials in text files or password management tools which are accessible to anything as long as you are logged in.
Ok so I’ve hopefully nailed that point home. I do not want to work on my local laptop. I lock down all my dev tools and things they are accessing on an EC2 instance.
Using a GUI on EC2 🖼️📉📊
But wait — you can run Windows or Ubuntu on EC2 and use an IDE that way! Yes, and I would if I wanted to or needed to run an IDE. I might try Kiro at some point and that’s how I would do it. I use one GUI tool consistently and that is Burp — when I’m pentesting. And that’s how I run it. I explained how to use Ubuntu because Windows is so expensive and makes so many darn network connections (again) which I don’t like.
I have a summary of how to do that here after researching a few things:
So if you like GUIs you can use that to install your favorite IDE and work on an EC2 instance — with the caveats that I work in a tight network and monitor constantly. I never leave it running when I’m not on it. I have it in a separate non-production account and network to try to minimize my risk. There’s also more you can do to lock it down with separate users for different purposes as I’ll explain in my next post and creating stronger per application policies to limit actions.
Even though that’s a good option and what I’d do if I was going to try Kiro I haven’t yet. Why? Because I still like the command line better for other reasons.
Faster Faster 🐇🏃♀️➡️💨🐎
I’m sometimes working on slower networks. Even if I’m not, loading the whole GUI over the wire is slow and cumbersome. I’m always in a hurry and like SPEED. Faster faster. Waiting for GUIs over networks is something I avoid as much as possible. Waiting for the GUI to load takes longer. Updating the GUI takes longer. Everything in a GUI takes longer. Though it may save you time in other ways — I get that — and some people (I guess most) like visual representations better than plain text. But plain text takes less time to display, parse, and operate on and in.
Cost 💰🤑💲💵
The other thing is, Amazon Linux is your cheapest option when it comes to an operating system and EC2 instance.
- By avoiding guis I can use a cheaper operating system.
- Not only that when you are running Amazon Linux you don’t need as hefty of a machine. That also saves some dinero.
- I don’t know how much cost all the network traffic from GUI tools generates but if you had a large team that might save a few bucks.
- Also, if your IDE is not fee you save on that as well.
Did I Mention Security? 🚔🔒👮🚨
Now let’s say you have a bunch of agents operating in a GUI. How exactly do you easily lock those agents down so they can only access specific resources? I’m sure it can be done with some clicks and other interactions. Perhaps Kiro does this for you, letting you specify a workspace and the agent is somehow restricted to it’s own workspace — with guardrails that truly cannot be bypassed. But if your agent in the GUI is accessing files behind the scenes how do you even know what it’s doing?
I’ve already heard about IDE plugins and extensions accessing developers data in conjunction with AI. I suppose that is in part dependent on what plugins the developers decided to download and run…one researcher was able to compromise Amazon’s code through one of these extensions:
Of course this can happen on the command line as well…but the thing I like about working on the command line is the ability to lock down each agent to only writing to specific content for a specific project on my instance file system.
And by the way, I never give my agents any credentials.
I only use AI to write deterministic code (deterministic meaning I know exactly what it is doing and does the same exactly thing every time with no variations and with no da kine’s or thingamajigs) to take actions with credentials. I for the most part don’t store credentials on my EC2 instance with some limited exceptions where AWS CLI credentials are used to assume a role — WITH MFA — as I’ve written about like 100 times on this blog.
Nothing to see here…move along…
Even if the AI does escape it’s little box there’s only so much it can do like mess up my architecture and code. But I backup frequently in multiple ways and can restore that pretty easily to a known good state.
The way I get around the fact that Q is constantly trying to do things it should not be doing — AND it messes up my architecture given free reign…is the topic of my next post. I find it easier to lock down each agent into it’s own little sandbox jail.
The lock down and lack of credentials or ability to do anything useful in my AWS account or on my machine provides reduced risk should prompt injection occur as well. Prompt injection occurs in various ways when you’re tricked into running content on your machine when you load content, click on links and a model could be poisoned as well…so many options for AI hacking…so little time (this is my line of work after all). If there’s not much the agent can do if a rogue command gets inserted that’s a good thing.
Hopefully I got the permissions right which Q and Gemini really struggled to do which concerns me…. what were these models trained on anyway? I had to do that mostly manually as I’ll explain.
Follow for updates
Teri Radichel | © 2nd Sight Lab 2025
About Teri Radichel:
~~~~~~~~~~~~~~~~~~~~
⭐️ Author: Cybersecurity Books
⭐️ Presentations: Presentations by Teri Radichel
⭐️ Recognition: SANS Award, AWS Security Hero Former SANS, IANS Faculty
⭐️ Certifications: SANS ~ GSE 240
⭐️ Education: BA Business, Master of Software Engineering, Master of Infosec
⭐️ Company: Penetration Tests & Security Research ~ 2nd Sight LabCloud, SAAS, and Application Penetration Testing
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
🔒 Request a penetration testFollow for more stories like this:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
❤️ Sign Up my Medium Email List
❤️ X, Threads, Blusky, Instagram, AWS BuildID: @teriradichel
❤️ LinkedIn: https://www.linkedin.com/in/teriradichel
❤️ Mastodon: @teriradichel@infosec.exchange
❤️ Facebook: 2nd Sight Lab









