# Timeline Editor

## Timeline Editor Basics and Commands

The Timeline Editor is a powerful tool for managing conversational histories and processing user commands. It allows you to interact with language models, save and load conversation timelines, and manipulate the conversation flow. This guide will walk you through the basic concepts and commands available in the Timeline Editor. For [installation](https://underdogcowboy.gitbook.io/underdogcowboy-docs/basics/timeline-editor/using-the-timeline-editor-from-the-command-line) of the Timeline Editor, see the page [Using the Timeline Editor from the Command Line](https://underdogcowboy.gitbook.io/underdogcowboy-docs/basics/timeline-editor/using-the-timeline-editor-from-the-command-line)

### Key Concepts

* **Timeline**: Represents the entire conversation history.
* **Message**: Individual entries in the timeline, each having a role (user or model) and text content.
* **Current Position**: The current point in the timeline where new messages are added.

### Key States

* **Interactive (i):**  In this state we communicate with the underlying LLM. This is the mode the script defaults to, so you can directly start talking with the LLM.
* **Command (cmd):**  We switch to command mode by entering cmd in the command line, while we are talking with the LLM.&#x20;

### Available Commands

Here's a list of available commands and their shortcuts:

| Command          | Shortcut    | Description                                        |
| ---------------- | ----------- | -------------------------------------------------- |
| interactive      | i           | Enter interactive mode to chat with the model      |
| cmd              | No Shortcut | Enter in the command mode of the script.           |
| save-timeline    | s           | Save the current timeline to a file                |
| load-timeline    | l           | Load a timeline from a file                        |
| export-markdown  | e           | Export a message to Markdown                       |
| head             | h           | Display the current position in the timeline       |
| display-item     | d           | Display a specific item from the timeline by index |
| display-timeline | dt          | Display runtime timeline                           |
| save-agent       | sa          | Save your dialog as an agent                       |
| select-message   | sm          | Select a specific message by index                 |
| select-dialog    | sd          | Select a specific dialog                           |
| select-agent     | sla         | Select a specific agent                            |
| switch-model     | swm         | Switch LLM model                                   |
| help             | ?           | Show the help message                              |
| quit             | q           | Exit the application                               |

### Command Details

#### Interactive Mode

* **Command**: `interactive` or `i`
* **Description**: Enters a chat session with the model. You can send messages, files, or switch back to command mode.
* **Usage**:
  * Type your message to chat with the model.
  * Use `file <file_path>` to send a file.
  * Enter `cmd` to switch back to command mode.

#### Save Timeline

* **Command**: `save-timeline` or `s`
* **Description**: Saves the current timeline to a file.
* **Prompts**:
  * Filename to save the timeline
  * Name for the timeline session (optional)
  * Description for the timeline session (optional)

#### Load Timeline

* **Command**: `load-timeline` or `l`
* **Description**: Loads a timeline from a file.
* **Prompt**: Filename to load the timeline from

#### Export to Markdown

* **Command**: `export-markdown` or `e`
* **Description**: Exports a selected message to a Markdown file.
* **Prompts**:
  * Index of the message to export
  * Filename for the Markdown file

#### Display Timeline Information

* **Command**: `head` or `h`
* **Description**: Displays the current position in the timeline and total number of messages.

#### Display Specific Item

* **Command**: `display-item` or `d`
* **Description**: Displays a specific item from the timeline.
* **Prompt**: Index of the item to display

#### Display Timeline

* **Command**: `display-timeline` or `dt`
* **Description**: Displays a visual representation of the timeline, showing frozen segments and the current position.

#### Save as Agent

* **Command**: `save-agent` or `sa`
* **Description**: Saves the current dialog as a user-defined agent.
* **Prompts**:
  * Name for the agent
  * Description for the agent

#### Select Message

* **Command**: `select-message` or `sm`
* **Description**: Allows selection of a specific message from the timeline.

#### Select Dialog

* **Command**: `select-dialog` or `sd`
* **Description**: Loads a previously saved dialog.

#### Select Agent

* **Command**: `select-agent` or `sla`
* **Description**: Loads a previously saved agent.

#### Switch Model

* **Command**: `switch-model` or `swm`
* **Description**: Switches to a different language model.
* **Prompt**: Selection from available models

#### Help

* **Command**: `help` or `?`
* **Description**: Displays the list of available commands and their descriptions.

#### Quit

* **Command**: `quit` or `q`
* **Description**: Exits the application.

### Tips for Using the Timeline Editor

1. Use the interactive mode for continuous conversations with the model.
2. Save your timelines regularly to preserve important conversations.
3. Experiment with different models using the `switch-model` command to find the best fit for your task.
4. Use the `display-timeline` command to visualize your conversation structure.
5. Export important messages to Markdown for easy sharing or documentation.

Remember, the Timeline Editor is a powerful tool for managing and manipulating conversational histories. Experiment with different commands to find the workflow that best suits your needs.
