# Getting started [中文](../getting-started.md) | English This guide takes you from installation to opening a tavern, creating your first character and starting a chat. Subcommands accept both Chinese and English (`/aha start` = `/aha 开场`). The examples here use the English forms. Mode names and some card buttons appear in Chinese in the interface, so they are shown with the original text in parentheses on first use. ## 1. Install Install DSH first and have a working model ready. Aha Tavern is not on npm yet, so build a package yourself: ```bash pnpm install pnpm build pnpm pack ``` You get `aha-tavern-0.0.1.tgz`. Install it into the profile you use (`web` below): ```bash dsh plugin --profile web add ./aha-tavern-0.0.1.tgz ``` Restart DSH (`dsh web`). When you create a new session, the mode list now has four more entries: - **Tavern: Setup** (酒馆:筹备): open a tavern, create characters, write your profile - **Tavern: Chat** (酒馆:单聊): chat with one character - **Tavern: Group** (酒馆:群聊): several characters on stage, with a narrator - **Tavern: Book** (酒馆:写书): turn the stories you have played into a book To upgrade, `add` the new tgz again. A package with the same name and version may be cached, so use a different file name when you reinstall. ## 2. Open a tavern A tavern is a folder. Whichever folder you pick as the workspace in DSH becomes the tavern. 1. Create a new session, pick the workspace folder, and choose the mode "Tavern: Setup". 2. Type: ``` /aha init ``` 3. The host asks how you want to be addressed and whether to write your player profile. Say "skip" if you want to skip it. If the workspace is not a tavern yet, Setup tells you so and lists the other taverns you have opened. ## 3. Create your first character Still in Tavern: Setup: ``` /aha card 白狐 ``` (白狐 is an example character name, a fox who runs a tavern.) Or just say it in words: "Create a character named 白狐, a sharp-tongued, soft-hearted fox who runs a tavern." The host fills in the details. Before anything is written, a card pops up for you to choose "Save" (保存) or "Not yet" (先不保存). If you are not happy, choose the latter and say what to change. ### Create a character from an image If you have an image of the character, attach it to your message (add an attachment in the input box) and add a sentence: ``` Make a character from this image. She is the night watch of an old mountain academy, quiet, sharp-tongued but soft-hearted. ``` The host looks at the image to write the appearance, writes the personality and tone from what you said, and then shows you the whole card. You can also send just the image with no text. The host then pops up a card asking whether you want to say a few words yourself, let the host improvise from the image, or fill in only the appearance. After the card is saved, the host asks a few follow-up questions. You can skip any of them or say "not now": 1. What the character calls you, and what your relationship is. 2. Whether to use this image as the reference sheet (needs [image setup](image-setup.md) first). 3. After the reference sheet, whether to give the character a voice (needs [voice setup](voice-setup.md) first). Notes: - **The model must accept images.** The model you use has to support image input, or messages with images cannot be sent, and the input box will tell you to switch to a model that supports images. If you declare models in your own config, add `input: [text, image]` to the model entry. If you have no image-capable model, you can skip the image and describe the looks yourself; the image path can still be used when you make the reference sheet. - **Check the appearance.** The host only writes what it can see in the image, but it can miss or misread things. This appearance text is used later when drawing, and a mistake will clash with the reference sheet, so check it before saving. - **Attach the image to the message.** If you only give a file path, the host cannot see the content; the path can only be used for the reference sheet. - If you choose "fill in only the appearance", the personality field first gets the placeholder "not set yet" (尚未设定), because the character card requires this field not to be empty. Fill it in later. - Editing an existing character works the same way: attach the image and say "change 白狐's appearance to match this image". If you want the character to know you, write your player profile: ``` /aha me ``` ## 4. Start chatting Open a new session, choose the mode "Tavern: Chat", and pick the same tavern folder as the workspace: ``` /aha start 白狐 ``` The character gives the opening line, and from there you just type to chat. You don't need the full name. `/aha start 狐` also finds 白狐. If more than one character matches, a card pops up for you to click. `/aha start` with no name lists all characters in the tavern. Saying "I'm looking for 白狐" in plain text works too. To talk to another character, or to start over, open a new chat session. ## 5. Make characters remember things There are two ways: - **Just say it**: say "Remember: I don't eat cilantro" in the chat. The character decides for itself whether to note it down. - **Use the command**: ``` /aha remember I'm going to the mountains to sketch next week ``` `/aha remember` with no text makes the character review this chat and organize its memory. Memory is stored in `memory.md` in the character's folder. It is plain text that you can open and edit. The next time you start a chat, the character talks to you with these memories. ## 6. Group chat To put several characters on stage, open a new session, choose the mode "Tavern: Group", and pick the same tavern folder as the workspace. **Start**: tell it who is present and the scenario together: ``` /aha start 白狐 青衫 It's my birthday today ``` (青衫 is another example character name.) You can also say it in words. If you give only the scenario and no names, a card pops up for you to select the characters present. After you choose, the plugin repeats "who is present, what the scenario is" for you to confirm, and the scene starts only when you confirm. At most 5 characters can be present (plugin config `groupCastMax`, default 5). **What replies look like**: one model plays everyone. The narrator's lines start with 【旁白】 (narrator), and characters' lines start with "Name:" (the name followed by a colon). Each turn has at most one narrator passage and three characters speaking; who speaks depends on the situation and nobody is forced to talk. **Addressing one character**: put `@name` in your message, for example `@白狐 what do you think`, and only 白狐 responds this turn, while the other characters stay out (the narrator can still speak). **Narrator**: to change the surroundings or the situation, use ``` /aha narrator make the mood tense ``` The characters cannot hear this request; they only see that the situation has changed. The request stays in effect until the next scene change. **Scene change**: when the narrator notices that the place or time has changed, a card pops up asking whether to change scene. You can also do it yourself: ``` /aha scene Next morning, outside the mountain gate. 青衫 leaves ``` Both the "new scenario" and "who comes or goes" parts can be left out. **Wrap-up**: ``` /aha wrap ``` This writes a recap of the scene and gives it a title. You can keep chatting after wrap-up. **Memory in group chat**: - `/aha remember I don't eat cilantro` notes it for everyone present. - `/aha remember @白狐 I don't eat cilantro` notes it for 白狐 only. - `/aha remember` with no text has the narrator write the scene so far into a recap and organize the memory of the characters present. What happens in a group chat goes into every participant's index of past events. If you later chat one-on-one with one of them, they remember these events and can recall them; they can only recall scenes they were present for. ## 7. Write a book To turn the stories you have played into a book, open a new session and choose the mode "Tavern: Book". One session is one book; coming back to the session later means you are continuing to work on that book. **Start a book**: ``` /aha book Mountain days with 白狐 ``` The title is optional. A card pops up: tick the chats to include (the 20 most recent are listed), then choose the point of view to write in. **Set the outline**: the editor drafts an outline (chapters and sections, each with a synopsis). You go back and forth in the conversation, and when you are happy, say "done" (定了) and the outline is saved. **Start writing**: ask the editor to begin, and the plugin writes the draft section by section in the background. ``` /aha progress /aha pause ``` `/aha progress` shows how far it has got; `/aha pause` stops the section being written, and finished sections are kept. **Rewrite a section**: tell the editor "rewrite chapter 2 (3): less scenery description", and only that section is rewritten, the rest is untouched. **Rewrite as a novel**: the draft follows the order of the chats. If you want a novel, tell the editor you want to rewrite it as a novel. The editor asks you to pick or describe a style and sets a separate novel outline. The novel outline can merge and reorder sections of the draft, and can add a preface. Once it is set, the sections are rewritten one by one, and you can rewrite any single section too. **Export**: ``` /aha export ``` Without an argument both are exported, in the book's folder: the draft is `