

shell-maker, a maker of Emacs shells
source link: https://xenodium.com/a-shell-maker/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

08 April 2023 shell-maker, a maker of Emacs shells
A few weeks ago, I wrote about an experiment to bring ChatGPT to Emacs as a shell. I was fairly new to both ChatGPT and building anything on top of comint. It was a fun exercise, which also generated some interest.
As mentioned in the previous post, I took inspiration in other Emacs packages (primarily ielm) to figure out what I needed from comint. Soon, I got ChatGPT working.

As I was looking at OpenAI API docs, I learned about DALL-E: "an AI system that can create realistic images and art from a description in natural language."
Like ChatGPT, they also offered an API to DALL-E, so I figured I may as well try to write a shell for that too… and I did.

There was quite a bit of code duplication between the two Emacs shells I had just written. At the same time, I started hearing from folks about integrating other tools, some cloud-based, some local, proprietary, open source.. There's Cody, invoke-ai, llama.cpp, alpaca.cpp, and the list continues to grow.
With that in mind, I set out to reduce the code duplication and consolidate into a reusable package. And so shell-maker
was born, a maker of Emacs shells.
shell-maker
's internals aren't too different from the code I had before. It's still powered by comint, but instead offers a reusable convenience wrapper.
It takes little code to implement a shell, like the sophisticated new greeter-shell
;)

(require 'shell-maker) (defvar greeter-shell--config (make-shell-maker-config :name "Greeter" :execute-command (lambda (command _history callback error-callback) (funcall callback (format "Hello \"%s\"" command) nil)))) (defun greeter-shell () "Start a Greeter shell." (interactive) (shell-maker-start greeter-shell--config))
shell-maker is available on GitHub and currently bundled with chatgpt-shell. If there's enough interest and usage, I may just break it out into its own package. For now, it's convenient to keep with chatgpt-shell
and dall-e-shell
.
If you plug shell-maker
into other tools, I'd love to hear about it.
Happy shell making!
Recommend
-
130
Swap looks in a snap. moto style shells snap seamlessly onto your moto z modular phone. Choose from a variety of materials, textures, colors, and fabrics.
-
50
README.md ShellPop About Pop shells like a master Shell pop is all about popping shells. With this tool you can generate easy and sophisticated reverse or bind shell commands t...
-
32
Work is ongoing to extend Flutter to support desktop as a target environment, allowing developers to create macOS, Windows, and Linux applications with Flutter. On the long run, this effort will create lead to a fully in...
-
16
MadSci Network: Chemistry Re: Why do electron shells have set limits ? Date: Wed Mar 17...
-
30
Base16 for Shells. Contribute to chriskempson/base16-shell development by creating an account on GitHub.
-
4
Painless Emacs remote shellsJuly 8, 2020This post is part of a series about shells in Emacs:Remote interactive shellsIn a pre...
-
6
Painless Emacs interactive shellsJanuary 21, 2020This post is part of a series about shells in Emacs:RecapOn...
-
10
The cd command is a shell “builtin”, meaning it isn’t a program on disk but something built into the shell itself. Go to the home directory
-
11
Writing a Wayland compositor with wlroots: shells July 29, 2018 on Drew DeVault's blog I apologise for not writing about wlroots more frequently. I don’t really en...
-
4
Base16 Shell See the Base16 repository for more information. A shell script to change your shell's default ANSI colors but most importantly, colors 17 to 21 of yo...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK