Hacker Newsnew | past | comments | ask | show | jobs | submit | alkh's commentslogin

Can someone please explain how one would tell LLM to use such a CLI over a natively supported MCP server? Do you need to add the info about CLI into persistent memory(ex. AGENTS.md) and run an mcp server manually? Or it is something else?

A simple prompt that tells the agent how to use gh cli to use GitHub using —help commands makes the agent start learning how to use a specific cli and just use it.

This method was popularised by beads with a simple command “bd quickstart” to teach the basics to an agent. Think of this as an adaptive learning method for the agent.

I’ve not seen the details of mcp2cli, but let’s just say you had a mcp2cli wrapper over stripe, you can just tell the agent to run mcp2cli for stripe as a provider to learn how to use the rest of the APIs


Thank you, this seems like a very good intro to newcomers! Would be cool if you could continue these series with a few more advanced lessons as well


Thank you! That's the plan. I was thinking of writing a 3D mesh classifier explainer next that'll build on these concepts.


Omg, this is so great, that you so much! Gonna set up a bunch of A320 warning sounds to scare me in case I am idle for too long :)


Like many other people, I use oh-my-zsh for default setup and that's it. I literally use a single plugin for git and very actively autoload my custom functions to avoid startup delay. With my 384 line config and oh-my-zsh on, here are the results:

$ hyperfine -N "zsh -lc 'exit 0'" "zsh -c 'exit 0'"

Benchmark 1: zsh -lc 'exit 0'

  Time (mean ± σ):      54.5 ms ±   6.3 ms    [User: 10.2 ms, System: 14.3 ms]

  Range (min … max):    38.1 ms …  64.9 ms    78 runs
Benchmark 2: zsh -c 'exit 0'

  Time (mean ± σ):       6.5 ms ±   1.4 ms    [User: 0.8 ms, System: 1.3 ms]

  Range (min … max):     3.9 ms …  14.2 ms    424 runs
It's crazy how their startup time is 380 ms, and I suspect something else might be the reason, not just oh-my-zsh


For anyone who cares about zsh startup performance, `zsh4humans` by `romkatv` (author of powerlevel10k) is worth a look: https://github.com/romkatv/zsh4humans

It achieves instant startup by rendering the prompt before the full shell initializes. Since adopting it, I am done fiddling with my shell config and the fact that `zsh4humans` is in maintenance-mode is actually an advantage as it keeps me from wasting time refactoring `zshrc`.


I think `zsh -l` start a login shell, which does not load zshrc so oh-my-zsh don't get initialized. Try `zsh -ic exit` and it should load zshrc before executing exit.

That said, the time of `zsh -ic exit` isn't really meaningful metric for measuring the performance of an interactive shell. See https://github.com/romkatv/zsh-bench#how-not-to-benchmark for details.


Valid points, I learned something new today. Thanks, you were right. If using -ic flags I am getting around 300 ms... Interesting how I never noticed, guess I don't open many terminal during the day


Better way to benchmark zsh startup time is with zprof. Add this to your ~/.zshrc:

    zmodload zsh/zprof
    .. rest of your zsh config ..
    zprof
And then restart terminal.


Trying doing the benchmark in a git repo.


That's where I actually did it, by coincidence


You should try extract, z, and fzf


Imho, we should let people experiment as much as they want. Having more examples is better than less. Still, thanks for the link for the course, this is a top-notch one


Don't forget that you can enable syntax highlighting/file rendering(like pdf, markdown) in less with lesspipe https://github.com/wofr06/lesspipe. It is exteremely useful and improves readability a lot. What's nice is that this functionality is typically disabled in pipes, so you can be sure that your script will behave as intended.


You may also have to specify "-R" for less such that ANSI escape sequences are honoured.

(I usually invoke this when viewing jq output, a JSON data formatter / query tool.)


True. To combat that you can define a variable LESS with default options in your config file. In my case, I have export LESS='-R --quit-if-one-screen -i' (interpret escape sequences, cat input instead of showing it in a pager if it fits on a screen, enable smart-case searching)


Have to post this monstrocity that let's you either run a python script with uv or with python directly if uv is not installed(for some of my collegues)

#!/usr/bin/env bash

""":"

if command -v uv > /dev/null

then exec uv run --script "$0" "$@"

else

exec python3 "$0" "$@"

fi

":"""


The only thing I am missing now from Ghostty is being able to open it in any open Finder folder with a keyboard shortcut(like standard Ubuntu terminal). Ghostty already provides Finder-specific GUI shortcut but you need to use a mouse. Otherwise, stellar work(especially the ease of configuring it) and congrats to everyone involved!


You can set a keyboard shortcut for that GUI menu entry (and most others) in macOS system settings.


I do this with an Alfred workflow, I hit command+space and then type “ft” and it opens the front most Finder window’s directory in Terminal (or iTerm, you can set it to whatever)


This can be done through Nautilus scripts.

> cat ~/.local/share/nautilus/scripts/Ghostty

#!/usr/bin/env bash

ghostty --working-directory=$(pwd)

> cat ~/.config/nautilus/scripts-accels

<Ctrl><Shift>F4 Ghostty


Thanks, looks cool but not available for OSX (:


Can you not bind the command "open ." to a keybind through Ghostty?


Wrong direction. OP wants to open Ghostty from a Finder window, not vice versa.


I think they are looking for the opposite: open a Ghostty window from Finder.


Yeah, exactly, like Ctrl+Alt+T opening Xterm in Ubuntu. If I am not mistaken, if you have a file explorer open it will automatically open terminal in that specific folder(i.e. kind of like `cd`ing there first)


Just want to thank you for the comprehensive extension list, this is very useful!


I’m really glad I got it after stumbling across the original at my university library. It’s really nice reading it from time to time and getting inspired to become a better developer


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: