6 ms·
Run interactive commands in Gemini CLI
- aiiizzz 1y agoI'd prefer that the Gemini cli run inside a text file, rather than this way round. And really, ctrl-f? Do these devs not use the terminal at all?
- nacs 1y agoIt's nice that they mention node-pty that does most of the heavy lifting for the terminal/pseudo-tty that powers this (VSCode's terminal emulator is powered by the same library). It looks like they've added a layer on top of node-pty to allow serializing/streaming of the contents to the terminal within the mini-terminal viewports they're allocating for the terminal rendering. I wonder if they're releasing that portion as open source?
- amitav1 1y agoI think that this feature might have taken Gemini CLI from just Temu Claude Code with higher usage limits, to actually competitive as a tool. It'll be interesting to see how well this actually works in practice.
- adastra22 1y agoIdk, the more skilled I get with Claude Code, the less I use interactive workflows.
- anp 1y agoI tend to agree but there are a few scenarios where I really want it to work. Debuggers in particular seem hard to get right for the current agents. I’ve not been able to get the various MCP servers I’ve tried to work, I’ve struck out using the debug adapter protocol from agent-authored python. The best results I’ve gotten are from prompting it to run the debugger under screen, but it takes many tool calls to iterate IME. I’m curious to see how gemini cli works for that use case with this feature.
- rockwotj 1y agoI would love to use gdb through an agent instead of directly. I spend so much time looking up commands and I sometimes skip things because I get impatient stepping over the next thing
- efskap 1y agoTo be clear, the LLM is only aware of the final state of the ptty when the command exits, right? It's not a TUI computer-use model at this point from what I can tell.
- jgoodhcg 1y agoPopping into nvim to check on something really quick seems immediately useful. I think I'll still want a dedicated tab or different terminal app to have my longer lived editor open but this might be nice for validating output with test runners or checking on a database entry in psql or something.
- nacs 1y agoI'm not sure how usable neovim will be in what looks to be a 6 line high window as they show in the demo video.
- 0x457 1y agoPretty sure you can expand it full-screen there.
- mark_l_watson 1y agoI had problems running Emacs in no window mode (emacs -nw). I should try again, or maybe just use vim.
- jasonjmcghee 1y agoI've had a pretty poor experience with Gemini. I've had to convince it to do things it should just be able to do but thinks it can't for some reason. Like reading from a file outside of the project directory- it can do it fine, but refuses to unless you convince it that no it actually can. Also has inserted "\n" instead of newlines on a number of occasions. I'd argue these behaviors are much more important than being able to use interactive commands.
- Liebmann5 1y agoI second this man’s take. I’ve been using it consistently for a few months to give it a try and is definitely subpar. It can give really good answers at times however isn’t worth the time, energy, or luck to get it there.
- ChrisGreenHeur 1y agoI have had these exact issues a lot with codex (gpt-5-codex)
- sunaookami 1y agoGemini doesn't seem to be trained on tool use (which Claude is) so it quiet often thinks it can't do something it certainly can and does a lot of nonsense. For me it fails nearly everytime while it's trying to read project files because it uses relative paths instead of absolute so I've put "For your "ReadFile" and "WriteFile" tool, you MUST use absolute paths to files" in my system instructions. Speaking of system instructions, Gemini always forgets them or doesn't follow them. And it still puts code comments nearly everywhere, it drives me nuts. Codex is much better at following system instructions but the CLI is..... very bad.
- theshrike79 1y agoCodex doesn’t give feedback while it’s running. It just works quietly in a way that’s not easy to interrupt if you could see it going off the rails. Claude is better at this.
- 1y ago
- orliesaurus 1y agoAs someone who has been experimenting with AI ‑powered command‑line helpers, I think adding interactive commands to the Gemini CLI is a logical step, but it won’t be useful unless the underlying model is reliable for basic tasks. Several people here noted that Gemini sometimes refuses to read files outside the project directory or mishandles newlines; those sorts of inconsistencies undermine trust. In a world where you have 100 options, trust is of utmost importance. The CLI’s integration with node‑pty and the ability to stream pseudo‑tty output into mini‑terminal viewports is clever, and I’d love to see that layer documented or open‑sourced so other tools can build on it. I see this feature as something you’d use for short‑lived tasks like running a quick script, checking a log, or doing a one‑off database query. For longer editing sessions I’d still use a real terminal multiplexer and editor. If Google can fix the reliability issues and make the API for interactive sessions open, that would be hella good for everyone!
- goxofy 1y agoMake cli in Gemini like this is hard to use.
- coderatlarge 1y agoi’ve had little luck getting ai systems to correctly set up networking for a set of vms. they tend to go round and round with ip tables commands that don’t ultimately solve the problem. is config fundamentally harder than writing code ?
- theshrike79 1y agoDid you give them a way to check the networking rules? If not, the model is just shooting in the dark and guessing.
- coderatlarge 1y agoi give feedback by copy-pasting output. hence the round and round. maybe if i had a sandbox that the model could run on autonomously it might ho better/faster.
- caymanjim 1y agoThe best thing about this is that now Claude and Codex have to add it.
- theshrike79 1y agoI’m still waiting for Gemini to add hooks and sub-agents
- greymalik 1y agoThey will do it with needlessly complexity that is out of step with the competition, as they did with slash commands (toml) and extensions (skills-equivalent).
- selvan 1y agoFrom the blog " Gemini CLI spawns a new process within a pseudo-terminal in the background, leveraging the node-pty library...So how does this virtual terminal running in the background show up on your screen? Think of it like a video stream. Our new serializer takes a snapshot of the pseudo terminal at every moment—capturing every piece of text, every color, and even the cursor's position. These snapshots are then streamed to you, allowing you to see and interact with the terminal application in real-time. It's not just a stream of text; it's a live feed." Terminal serializer code: https://github.com/google-gemini/gemini-cli/blob/main/packages/core/src/utils/terminalSerializer.ts https://github.com/google-gemini/gemini-cli/blob/main/packag... Uses @xterm/headless npm package.
- ffsm8 1y agoYour link 404s
- selvan 1y agoThanks. Fixed it.
- breakingcups 11mo agoThat excerpt sounds like it was written by an LLM.
- baalimago 1y agoHow much tokens does it eat up? Does the context stay concise? Who owns these "serializations" that's uploaded to google all the time?
- deleted 1y ago[deleted]
- deleted 1y ago[deleted]
- thallavajhula 1y agoAside: The demo shows git commands being run in the CLI. I absolutely hate it when devs use a commit message that says "chore: my first commit from gemini cli" - I get that it's meant for the demo, but in general too, I've seen codebases that enforce these commit prefixes such as "chore", "feat", "bugfix" etc. Is there any real value to that? Besides wasting up the 50 character limit on the first line of the commit message, I don't see anything else being done including those. Also, non-imperative commit messages?! Come on, guys!
- ilikepi 1y ago> I've seen codebases that enforce these commit prefixes such as "chore", "feat", "bugfix" etc. Is there any real value to that? It's a choice some teams make, presumably because _they_ see value in it (or at least think they will). The team I'm on has particular practices which I'm sure would not work on other teams, and might cause you to look at them with the same incredulity, but they work for us. For what it's worth, the prefixes you use as examples do arise from a convention with an actual spec: https://www.conventionalcommits.org/en/v1.0.0/ https://www.conventionalcommits.org/en/v1.0.0/
- jval43 1y agoJust because someone put up a fancy website and named it "conventional" doesn't mean it's a convention or that it's a good idea. The main reason this exists is because Angular was doing it to generate their changelogs from it. Which makes sense, but outside of that context it doesn't feel fully baked. I usually see junior devs make such commits, but at the same time they leave the actual commit message body completely empty and don't even include a reference to the ticket they're working on.
- dustypotato 1y agoIf you're looking in the commit tree for which commit fixed a certain bug, but didn't fix it fully , for example , you first look at all the `fix:` and then if it matches, you read the rest. You just write `fix: Thumbnail wasn't updating after upload` to `Fix for Thumbnail not updating after upload`, which isn't really wasting characters. But I'm also not a fan of this being an enforced convention because somebody higher up decided he/she it brings some value and now it's the 101st convention a new dev has to follow which actually reduces productivity.
- arjie 1y agoIt was very buggy for me. You kind of have to coax it into interactive use and then some of the time it got stuck pondering once I exited the app flow and returned to the Gemini CLI (not with Ctrl-F, full exit, it closes the TUI window). It's also super laggy. To be honest, at this point having Claude Code monitor the output of a `tmux pipe-pane` is probably going to be superior.
- snthpy 1y agoI couldn't tell from the post how this will affect Gemini's ability to assist better as a result. I guess for Google this will be a treasure trove of real developer interactions to train on. I might try this once Gemini 3 comes out. Until then, if you're running tmux or zellij, this seems like a worse user experience since you're in a subwindow and have less screen real estate to work with.
- jeffrallen 1y agoGemini is comically bad, like so bad you wonder if the product managers even know what it is supposed to sound/look like when working with an LLM. What the heck is going on in Google-land?
- dustypotato 1y ago> It's not just a stream of text; it's a live feed. LLM wrote this article it seems. For me Gemini CLI is not as good as Claude Code and sometimes writes more code than necessary and makes it hard to maintain. but hope it gets there with gemini 3.0 release. It's open source so I can imagine it getting there faster with community contributions.
- ewoodrich 1y agoI stopped reading at that point, it was a signal that I’d just be reading another several paragraphs of repetitive prose with random bolded text. It also put such strange over emphasis on an implementation detail that is pretty much irrelevant to users which made it actively distracting on top of being an obvious LLMism.
- dustypotato 1y agoThe posted link says: >The new interactive shell is enabled by default in Gemini CLI as of v0.9.0. but https://geminicli.com/docs/tools/shell/#enabling-interactive-commands https://geminicli.com/docs/tools/shell/#enabling-interactive... > To enable interactive commands, you need to set the tools.shell.enableInteractiveShell setting to true. Seems contradictory. I can't get it to work in either case .
- heeen2 1y agoI made a mcp that would use a pty lib to allow claude to debug a TUI app I was writing with ok-ish results. ultimately I wanted to see what was happening myself so when I need interactive I just tell it to use tmux-cli to capture the neighboring pane. https://github.com/pchalasani/claude-code-tools/blob/main/docs/tmux-cli-instructions.md https://github.com/pchalasani/claude-code-tools/blob/main/do... maybe turning that into a mcp with more guardrails and integrated guide to the agent would make it more popwerful
- michaelbuckbee 1y agoI'm not actually sure about that (that turning it into an MCP would help). I've seen more momentum building around having better cli tool integration with ClaudeCode than MCP reliance.
- lazarie 1y agoTrying to use Gemini CLI is one of the most frustrating experiences with any tool I've had in over two decades of working with software. It's seemingly very hard to understand how it should be configured at all if you don't have a personal Google account. Rather than just using your credentials to login and start, you need to find some forum posts of people that have reversed engineered that you need to use a Google Cloud environment variable, even if you are operating without a "Code Assist License" on a Google Business account. No matter what I do on my paid subscription through Google Business with a Google Cloud project provided in the environment configured, which I had to explicitly set up just to test the CLI even though I have access to the Models through my subscription and AI Studio, I always get error 429 after one to five messages. The limits that Google claim on Gemini seem to be just a fraction of what is claimed in my case, No clearly stated reason as to why, not in the cloud console and not when using the tool itself, except for the HTTP error message. These are not big prompts or anything of that nature. It's simple things like review a readme file or double check a single file for errors. It's been like this from the very beginning. Even now just to verify it, I havent used Gemini for over a week, I ask it to review 3 files that are in git diff, the files are between 50-100 lines long, after checking the first file it's already on 429, on a PAID subscription, and it even states "99%" context left. So my paid subscription lets me use less than 1% of the context window and I get locked out for a unknown amount of time. Contrasting this to both Codex and Claue Code, where you just log in and go, it's really a night and day difference. The user experience of the paid version of Gemini CLI is just utterly terrible.
- harlequinetcie 1y ago<rant> How many people are running LLMs CLIs instead of using their APIs? It seems so obnoxious to me that using a CLI command is cheaper than using their APIs, hence forcing them to build these kind of work arounds. Maybe I'm not getting it right, but it seems there are two competing paradigms which certainly with llms coding for llms, who cares. </rant>
- lherron 1y agoBuilding an interactive shell inside their CLI seems like a very odd technical solution. I can’t think of any use case where the same context gathering couldn’t be gleaned by examining the file/system state after the session ended, but maybe I’m missing something. On the other hand, now that I’ve read this, I can see how having some hooks between the code agent CLIs and ghostty/etc could be extremely powerful.
- CaptainOfCoit 1y agoLLMs in general struggles with numbers, it's easy to tell with the medium sized models that struggle with line replacement commands where it has to count, it usually takes a couple of tries to get right. I always imagined they'd have an easier time if they could start a vim instance and send search/movement/insert commands instead, not having to keep track of numbers and do calculations, but instead visually inspect the right thing happening. I haven't tried this new feature yet, but that was the first thing that came to mind when seeing it, it might be easier for LLMs to do edits this way.
- lherron 1y agoGotta be better than codex literally writing a python script to edit a file multiple times in a single prompt response.
- CaptainOfCoit 1y agoPersonally haven't had that happen to me, been using Codex (and lots of other agents) for months now. Anecdote, but still. I wrote up a summary of how I see the current difference between the agents right now: https://news.ycombinator.com/item?id=45680796 https://news.ycombinator.com/item?id=45680796
- redhale 1y agoI have used Claude Code heavily, and I've been forced to use Gemini CLI heavily (for a particular client project). Of all my issues with Gemini CLI (and there are many), this addresses none of them. This is a fascinating product management prioritization decision. It makes me wonder if the people who build Gemini CLI actually use Gemini CLI for real work. Because I would think that if they did, they would surely have prioritized other things. My personal biggest issue with Gemini CLI, which is a deal breaker if I have a say in the tooling I'm using, is that if you hit a per-minute rate limit (meaning it will be resolved in a few seconds) your session is forcefully and permanently switched over to using Flash and there is nothing you can do other than manually quit and restart to get back to using Pro 2.5. The status footer line will even continue to lie to you about what model you are using. I would genuinely like to understand the use cases for which this is desirable behavior. But even IF those use cases do exist, what is the harm or difficulty in giving an option to override this behavior? These models are not interchangeable. GitHub issues have been opened for months, some even with PRs attached, with no action from Google. For comparison, Claude Code handles this situation with a simple exponential back off until the request succeeds. That's what I want, ESPECIALLY in a CLI agent that may be running headlessly in a pipeline.
- jiggawatts 1y agoThese tools aren’t made to be used, they’re made to make the CEO look less bad by showing that “Google has these things too! We’re not falling behind! Don’t tell the board to vote to fire him!” That’s it. It’s not a “product”, it’s a keeping-up-with-the-Joneses checklist item.
- Workaccount2 1y agoGoogle is a proving ground for building "wow" factor products to line your resume with. There isn't a drive to actually cater to users, it's a selfish endeavor which sometimes aligns with what users want. So the game is feature pack so you can leverage it for jumping ship or spring boarding internally. It's the absolutely worst aspect of google, and I think its something worth dumping Sundar over, in order to get in a leader that will unify goals and get people who want to make great products, not great window dressings for themselves.
- 1y ago
- devinprater 1y agoWell, I'm glad that's pretty accessible. My screen reader says "focused" when I hit Control + F and I can ask it about top output for example.
- libraryofbabel 1y agoDoes anyone know / care to speculate how they actually make this work, in terms of the LLM call loop? Specifically: does it call back to the LLM after each keystroke sending it the new state of the interactive tool, or does it batch keystrokes up? If the former, isn’t that very slow? If the latter, won’t that cause it to make mistakes with a tool it hasn’t used before?
- neuronexmachina 1y agoI think this is the PR that implemented the feature: https://github.com/google-gemini/gemini-cli/pull/6694 https://github.com/google-gemini/gemini-cli/pull/6694 > feat(shell): enable interactive commands with virtual terminal
- guluarte 1y agoLook at me, you are the model now
- zeld4 1y agoi gave up on gemini cli. 1 in 3 times I used it in past 2 months, it failed for really odd reasons, sometimes the node app just exception quit, sometimes gemini stuck and blame itself and gave up. same task I throw to cc and codex, they nailed without a blink...