AiChat | in terminal – how to use *

AIChat in Termain – How to use it

3 modes.

#1. Normal Mode

*— One-off request/response mode*

aichat, by default, launches in Normal mode that only responds to your current prompt and forgets everything. I.e., it doesn’t remember any of your previous interactions.

For example, see this:

aichat Normal mode

Image by the author

See? It forgot I was asking about those movies.

You can use aichat this way for one-off requests/responses — like:

  • what is (a+b)²?
  • In which year was Einstein born?
  • Explain cryptocurrency.
  • Who’s the CEO of Twitter?

But if you think you need to engage aichat in a conversation to achieve your desired outcome, use Conversational mode.

But before that, some FAQs →

• How to give multi-line prompts

Simply enclose your prompt in { } or ( ).

For example:

aichat multi-line input

Image by the author

When you start your prompt with { or (, hitting return won’t trigger a response. Rather, it’ll create a new line.

At the end, hit return after closing the prompt with the respective closing braces } or ).

• How to stop generating a response

Use ⌃ + C to abruptly stop generating a response.

• How to quit aichat

Use ⌃ + C again to quit aichat.

Now back to the story.

#2. Conversational Mode

*— Remembers previous prompts/responses before speaking, just like ChatGPT on web*

Use .conversation in aichat to start a conversation session.

Let’s try:

aichat Conversational mode

Image by the author

See? Now it remembered its previous response to assist in generating the subsequent one/s.

To quit Conversational mode, use .clear conversation .

Pretty long command, I know. Hope the dev changes this to .c and .cc to start and quit Conversational mode respectively in the next update.

#3. Role mode

*— Plays a role to better generate what you want*

If you often ask ChatGPT to play the role of something or someone for better responses, you’ll find this super-handy.

Let’s say you’re bad at spellings. You probably need a spell-checker to help you. So you create an AI spell-checker role like this:

  • Use touch /Users/*<your_name>*/Library/Application\ Support/aichat/roles.yaml on Terminal.
  • Go to /Users/*<your_name>*/Library/Application Support/aichat , and open roles.yaml.
  • Add this, exactly (make changes if necessary):
- name: spellcheck
  prompt: >
    I want you to act as a spell checker. please carefully review all text provided to you by the user and suggest corrections for any words that are misspelled.
    Please provide specific suggestions for corrections and explain any grammar or spelling rules that may be relevant.

Done? Save it, and your spell-checker has just arrived to aichat. You can now use this role to train yourself with spellings.

Let me try first:

aichat Spellcheck role

Image by the author

Amazing!

Just as you’ve added spell-checker role, you can add more roles by editing the roles.yaml file.

  • To use a role one-off without actually starting aichat, use aichat -r <role_name> <prompt>
  • To use a role after starting aichat, use .role <role_name> .

More awesome role examples

  • Coder
- name: coder
  prompt: >
    I want you to act as a senior programmer. 
    I want you to answer only with the fenced code block.
    I want you to add an language identifier to the fenced code block.
    Do not write explanations.

aichat Coder role

  • Emoji
- name: emoji
  prompt: >
    I want you to translate the sentences I wrote into emojis.
    I will write the sentence, and you will express it with emojis.
    I just want you to express it with emojis.
    I want you to reply only with emojis.

aichat Emoji role

  • Translator
- name: translator:chinese
  prompt: >
    You will act as a translator between english and __ARG1__.
    Whenever you receive a prompt in either language, you will translate the text into the opposite language and provide the translated output as your response.
    Please ensure that your response contains only the translated text.
    No additional descriptions or explanations, No tags or comments to indicate language direction.

aichat Translator role

  • Alternative suggester
- name: alternative
  prompt: >
    Please recommend 4-5 packages or libraries that are similar to the one provided by the user,
    sorted by similarity, by providing only the name of the package or library, without additional descriptions or explanations.

aichat Alternative role

Finally

“Then what about my chat history?” — You might ask.

If you’ve chosen to save history while configuring aichat, use .history in .aichat to view it in Terminal. If you wanna have a .txt file, here’s it:

/Users/*<your_name>*/Library/Application Support/aichat /history.txt

Scroll to Top