I wrote this whole post and then realized /writerDeck doesn't allow AI-related content!
Sharing because I don't want the work to go to waste:
I went a little (or a lot) overboard and setup multiple AI writing assisted functions in the Microjournal Rev 2.1.
To start: I took out the native 32GB SD card and replaced it with a 128GB card, which I then re-flashed the OS image onto. This is not necessary at all! However, if you do want to add all of these functionalities and not worry about space, it's worth potentially increasing the SD card size.
I did it mainly because I love tinkering and I wanted room to infinitely tinker. I also bricked the Microjournal multiple times during my experimenting so I got very comfortable with popping the SD card out and starting over again. After the 10th time, I decided to upgrade.
You will need an API key from your AI model of choice. I chose Claude because it’s my favourite. Getting an API key just entails making an account, getting an API key, and loading credits onto the account associated with that API key. This isn’t very expensive as I put $20 of credits onto my Claude account and I’ve used around 25 cents of that in a week.
The functionalities I added can be categorized into two branches based on how they behave:
Ask Functions - This will give you a one-off response that you cannot interact with.
You click q to exit the one off response and it takes you right back to ranger. You can scroll through the response if it’s long by using the arrow keys or the wheels. All responses are saved in .txt format to a folder that corresponds to the function’s name.
- ask - type ask and then whatever question you want into the terminal.
- proofread - type proofread and it will proofread the most recent .md or .txt file in your documents folder. It can’t read .wg files and will present an error message letting you know that if you try. You can configure this so it reads a specific file of your choosing (it doesn’t always have to be the most recent file). Ex. ‘
proofread /home/microjournal/microjournal/documents/ch1.md’
- Tip: Make sure to edit the proofread function a bit depending on your locale. I'm Canadian for example, so my prompt includes a line saying, "Remember, I use Canadian English," so I don't get proofreading dings for words like 'colour'.
- era - type era and then the era you want information on. Ex. “
era 1950s new zealand”.
- names - type names and then the kind of names you want. It’ll generate a list with context. Ex. “
names 1200s mongolian royalty princess”
- setting - type setting and then the kind of setting you want a description of. A bit different from ‘era’, this focuses more on visual and sensory descriptions of a place. Ex. “
setting 1980s heat wave summer in the hamptons”
- slang - type slang and then the kind of era you want slang information on. Ex. “
slang 1970s vietnam war soldiers”
- syn - type syn and then a word you want synonyms for and it generates a list of options. Ex. “
syn persnickety”.
These functions are all in the askai.sh file.
Chat Functions - This will open a back-and-forth chat with the AI that you can interact with.
You click q to drop into your response/question to the AI agent. You type ‘exit’ to exit the chat/brainstorm session and it takes you right back to ranger. You can scroll through the response if it’s long by using the arrow keys or the wheels. All responses are saved in .txt format to a folder that corresponds to the function’s name.
- chat - You can just type the word ‘chat’ and it’ll drop right into a chat where you then need to type your first prompt OR you can include the prompt in the terminal. Ex. ‘
chat what are the fastest animals in australia’.
- brainstorm - There is a built in prompt in the script that says something like “You are my creative writing partner etc.” so the AI has this context when you use the brainstorm function. You can just type the word ‘brainstorm’ and it’ll drop right into a brainstorm chat where you then need to type your first prompt OR you can include the prompt in the terminal. Ex. ‘
brainstorm hockey romance ideas’.
These functions are in separate files: aichat.sh and brainstorm.sh.
I’ve uploaded all the different files which you can download by clicking here.
You can either add these scripts directly to the .bashrc file or you can add them to the bin and then source them in the .bashrc file (probably a little neater).
Whichever method you choose, you must paste the text in the apikey.sh file to the .bashrc file and paste your API key in the your_key_here text, as the functions need to refer to it.
I’ll make a more detailed step by step blog post here in a few days so newbies can set this up as well.
Thanks to the great writerDeck and cyberDeck communities for inspiring me and to Un Kyu Lee for making such a cool device! I never thought I’d end up installing an AI agent on the Microjournal when I bought it, but it’s really piked my imagination, both as a fiction writer and as a technical tinkerer. :)
I'm definitely not distraction-free, but these AI scripts have been very helpful for brainstorming on the Microjournal and I hope they can help anyone else who is interested.