I’m Amjith đź‘‹

Auto-Completing Click Commands

Click is a python library for creating command line applications in Python. The llm tool created by Simon uses click and it has a lot of subcommands. eg: $ llm keys set openai Enter key: ... $ llm models default gpt-4o I am building a wrapper around this CLI tool that let’s me use it in an interactive REPL. I wanted autocompletion to help me remind the available subcommands and their appropriate nested subcommands....

January 4, 2025 Â· 3 min

Restart a Python CLI

A simple snippet to restart a Python CLI from within the CLI. import os import sys import click @click.command() def cli(): click.echo("CLI is running.") # Logic that determines when to restart if click.confirm("Do you want to restart the CLI?"): click.echo("Restarting CLI...") executable = sys.executable args = sys.argv os.execv(executable, [executable] + args) else: click.echo("Exiting CLI.") if __name__ == '__main__': cli() os.execv is the system call that can replace the current process with a new one....

January 4, 2025 Â· 1 min

Introducing LLMs to Litecli

LiteCLI is a command-line client for SQLite databases that has auto-completion and syntax highlighting. I’ve added the ability to use an LLM to create a SQL query. Disclaimer: This is an EXPERIMENTAL feature. Not yet released. Ask a question about your database in English and get a SQL query back to find out the answer. This is the SQLite db used by Chrome. AsciinemaPlayer.create('/llm-litecli/litecli1.cast', document.getElementById('demo1'), { idleTimeLimit: 2, poster: 'npt:0:07', terminalFontSize: "...

December 15, 2024 Â· 2 min

Goodbye Netflix

“People are exhausting. But you’re not people.” A direct quote from my teammate during a dinner at a conference. We became very good friends after that trip. Back in 2017 I joined Netflix and moved our family to San Jose. I joined the team that built Chaos Kong. We brought our failover time from ~45 mins to under 7 minutes. True to Netflix’s culture I received some of the best feedback in my career....

December 14, 2024 Â· 1 min

Ghostty Terminal

I got beta access to Ghostty and set it up on my MacOS (Sonoma) laptop. The terminal is nice out of the box. It has tab support and splits. The default color theme is pleasing. I still needed to adjust the configuration to make some changes to match my taste. The configuration file is located in ~/.config/ghostty/config, there is no UI based preference dialog (planned for the future). This is my config:...

November 28, 2024 Â· 1 min