TUI – Marvin
Options
????️ Full chat interface in your terminal
???? Create bots with totally different personalities and aims
???? Create a number of persistent threads
Marvin features a full-featured TUI, or textual content person interface, that runs solely in your terminal. The TUI makes it straightforward to talk along with your bots, in addition to handle them, for fast non-programmatic interactions.
Beginning the TUI
To start out the TUI, kind marvin chat
into your terminal. It is best to see this display:
Keep away from terminal.app on MacOS
On MacOS, the default terminal offers a poor TUI expertise. You would possibly choose one other terminal, like iTerm2 or Warp. See the Textual FAQ for extra element.
Chatting
To speak with a bot, start typing within the enter on the backside of the display and hit enter. Your message will seem and Marvin will reply. You may discover your converation seems within the left sidebar as a brand new thread.
Responses are rendered as markdown. Sadly, you may’t enter multi-line responses but, however this can be a highly-requested Textual function.
Copying messages
To repeat a message, enter the message enhancing mode by clicking on it. Then click on the “Copy” button to repeat the message contents to the clipboard.
Deleting messages
You possibly can delete messages if you wish to restart your dialog from a sure level. Be aware that deleting a message additionally deletes all subsequent messages. To delete a message, enter the message enhancing mode by clicking on it. Then click on the “Delete” button.
Threads
Every dialog in Marvin is named a “thread”. Threads are persistent and might have doubtlessly many contributors (each bot and human). Within the TUI, every thread is a definite historical past of messages between you and a bot.
Threads are proven within the sidebar on the left aspect of the display. You’ll solely see threads that embody the bot you are presently speaking to.
Deleting threads
To delete a thread, choose it from the left hand sidebar and press the “Delete thread” button.
Auto-naming threads
Marvin does its finest to call the threads, taking the message historical past into consideration in addition to the bot’s persona. It is going to replace the thread title till the bot has responded greater than 5 instances.
Bots
Bots are what set Marvin other than a easy chat interface. Marvin bots all have personalities and directions, so it can save you bots which are significantly helpful to you. You may need one bot that solely writes formal emails, one other that brainstorms engineering options, a 3rd that performs role-playing video games, and one other that solely creates memes. It is fully as much as you.
Altering bots
To talk to a special bot, press the “Bots” button and select a special bot from the menu.
Altering the default bot
By default, Marvin is chosen because the lively bot when the TUI begins. To vary this, present a special bot’s title when beginning the TUI. If the offered title isn’t discovered, it is going to be ignored.
Creating and updating bots
You can talk to the default Marvin bot to create other bots – just describe the bot you want and, once it collects enough information, it can use plugins to create the bot for you. You can also explore and update existing bots this way.
If you prefer a programmatic interface, you can create bots either in Python:
from marvin import Bot
bot = Bot(
name="MyBot",
description="A description",
personality="A personality",
instructions="Some instructions",
)
bot.save_sync()
# to update an existing bot with the same name
bot.save_sync(if_exists='update')
Or from the CLI:
You can also edit and delete bots the same way.
Settings
You can set your OpenAI API key from the TUI by pressing the Settings button. It will be validated and stored in your Marvin config for future sessions, including interactive use outside the TUI.
Upgrading the database
When new versions of Marvin are released, they may require your database to be upgraded in order to handle the new features or enhancements they contain. Therefore, whenever Marvin starts, it checks to see if your database is up-to-date and prints a helpful warning if it isn’t. The TUI can go a step farther and upgrade your database automatically. If it is possible to do so, you will see a screen like the one below.
Manually upgrading the database
We have tried to prevent the TUI from accessing the database until after it runs the upgrade check and shows the warning screen. However, if for some reason it is unable to run the check properly, it may crash. In this case you can manually upgrade the database by running marvin database upgrade
in your terminal.
Technology
The Marvin TUI is built with Textual, a Python library for constructing TUIs.