A few people have asked me (an old man) how I manage to use LLMs in my life without being driven insane by their horrid new-fangledness, their hallucinations, their wanton sycophancy, the hype, the grift, and the everpresent risk of being lured into psychosis. The simple answer is that, as a command-line fogey, I use Simon Willison’s excellent llm program in the terminal, and trap the poor things in confines of being just another unix utility in my toolkit, along with sed, pandoc, and the rest.
Below is a list of examples of how I use llm, plucked from a random day. I generated the list by running:
1 |
llm logs -t -n50 | llm "These are log files from Simon Willison's llm program. I'd like to show my friends the kind of thing I use it for. Can you take these, and categorise them broadly by category, with each one a short description, phrased as though it were the question being asked by the initial prompt, linking to a page showing that prompt and its results -- as if i ran exported a datasette output on the log sqlite with url structure https://danny.spesh.com/ai/datasette/llm/conversations/.html. Highlight in bold any that seem to be a particularly good demonstration of the capabilities of LLMs, as opposed to a simple alternative to other tools like Google search or a calculator. If any of them seem personal or private, put them in a separate category at the bottom marked private. All of this should be output as markdown, easily convertable into HTML" > result.md |
I converted that result.md
into this, using pandoc -i result.md -o index.html
. I suppose I could have asked the llm to output directly into HTML, but I always peruse and tweak the output of these models, and that’s easier to do in markdown.
To make the linked pages, which I anticipated should contain rough transcripts of the results of those llm
commands, I asked llm
to write me a program to generate them:
1 |
files-to-prompt result.md| llm -T 'SQLite( "/Users/danny/Library/Application Support/io.datasette.llm/logs.db")' -x "Look at the logs db and see if you can write a script that will generate viewable html at the right URLs for the conversations and links listed in result.md" > generate.py |
files-to-prompt
is a simple program that concatenates a file(s)’ contents with its name — a great way to slam a lot of files into a prompt with sufficient context. So I’m throwing this llm the output of the last llm command’s results.
The -T SQLite
bit gives my llm model of choice (this is all being run on Anthropic’s Claude by default, but I could switch it to OpenAI, or a local LLM very easily) a tool taht gives it read-only access to a local sqlite file, here giving access to the llm
command’s own logs. Very recursive. LLMs know enough SQL to be dangerous, and the tool gives it enough context to know it’s talking to sqlite, so it can find out schemas, and explore the contents by itself.
The -x
restricts llm
‘s output to just the bit of the LLM’s answer that is surrounded by `-style markdown code prompts, a very effective way to just get the source code, without any of the tedious explanation that might accompany it.
That produced (with a few very minor tweaks by me) this Python program. And that nice HTMLification of that Python program came via this command:
1 |
llm "can you create an html template that i could paste the source to a python script into, and it would be syntax-highlighted correctly and look pretty? You can pull in external js resources available on cdns" > template.html |
As you can see, I’m still fairly heavily stuck in the 1990s, Unix and hand-crafted HTML and all. But now I have a happy Sirius Cybernetics buddy from the future to help me. Share and enjoy!
PS Here’s Simon’s far better guide to using llm.
My LLM Usage Log – Categorized Summary
Shell Scripting & Development
- Create a zsh script to convert local time to multiple timezones – Complex script development with iterative refinement, timezone parsing, and fuzzy matching capabilities
- Create a zsh function to convert between IPFS CID v0 and v1 – Specialized blockchain/IPFS tooling development
- Write sed script to fix mismatched HTML redirects and hrefs – Complex text processing with pattern matching across multiple files
System Administration & DevOps
- Where to place custom systemd service files on Debian? – Linux system administration
- How to view systemd journal entries for lotus-daemon service? – Service monitoring and troubleshooting
- How to set dynamic environment variables in systemd service files? – Advanced systemd configuration with dynamic values
- Create useradd command for IPFS system user – User management for service accounts
- What ports to open for Filecoin Lotus and IPFS nodes? – Network configuration for blockchain infrastructure
Git & Version Control
- How to revert a git repo to previous commit and push to remote? – Git workflow management
- Change git default remote to new GitHub repository – Repository configuration
- How to manually trigger GitHub workflow runs? – CI/CD automation
Filecoin and Ethereum Technical Support
- Check Filecoin account DataCap using Lotus CLI – Filecoin network operations
- Difference between wallet balance and market balance in Filecoin – Explaining complex blockchain economic concepts
- How to bridge ETH from Ethereum to Optimism? – Layer 2 blockchain operations
Technical Troubleshooting & Debugging
- Analyzing Go runtime panic with nil pointer dereference – Deep technical debugging and stack trace analysis
- Determine if processor is Ice Lake or later on Debian – Hardware identification for optimization
Writing & Language Questions
- Should it be “long term preservation” or “long-term preservation”? – Grammar and style guidance
- Compare Contributor Covenant Code of Conduct v2.1 vs v3.0 – Document analysis and comparison of policy changes
Translation Services
- Translate Chinese discussion about Filecoin sector expiration and locked tokens – Technical blockchain discussion translation
- Translate Chinese text about Asian Miners Working Group recruitment – Community organization translation
Terminal & Display Tools
- How to display images in Kitty terminal? – Terminal capabilities and graphics display
- How to create images using LLM tool? – Understanding tool limitations
Time Zone & Calculations
- Calculate time zone from PST 20:51 to someone at 11:51 next day – Time zone mathematics
- Convert 1099511627776 bytes to human readable format – Data size conversion (1TB)
Meta-Analysis & Documentation
- Categorize and analyze my own LLM usage patterns from logs – Recursive self-analysis and documentation generation
Research & Analysis
- Describe Steven Teles’ political positions and Niskanen Center work – Political science research and analysis
August 30th, 2025 at 7:21 am
[…] 详情参考 […]