# Command Query

![Command query window](/files/Vtlq2PkMJNNnlVJg41mZ)

## Basic usage

Within the command input text view, users can enter any valid Redis command. Multiple commands may be entered, separated by newline characters (`\n`), unless they are enclosed within quotes.

Clicking the "Execute Selected" button will execute the Redis command contained within the current line where the caret is positioned. Users may also execute multiple commands by selecting a range of lines that contain these commands. The commands that are about to be sent to the Redis server will be highlighted with a subtle gray background.

Command names are case-insensitive.

## Command colors

Read-only Redis commands, which will not modify the Redis database, are displayed in orange within the input text view. On the other hand, Redis commands that modify the database will be displayed in blue.

## Quote Encoding

Arguments of a command are separated by whitespaces (spaces or `\t`). Sometimes you may want to include these separators in the argument. If that's the case, you can use `"` or `'` to wrap the argument.

For example:

```
set keyname "content that contains a space"
set keyname 'content that contains a space'
```

Backslashes (`\`) can be used to "protect" quotes if the arguments contain quotes:

```
set keyname "content that contains both spaces \"and\" quotes"
```

Additionally, you can use `\n` to insert newlines when the content is wrapped with double quotes:

```
set keyname "content that contains a \n newline"
```

Similarly, use backslashes to "protect" backslashes:

```
set keyname "content that contains a \\"
```

## Multiline Command

Use quotes (`"` or `'`) to wrap an argument across multiple lines:

```
eval "
local a = 1
local b = 2
return a + b
" 0
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.getmedis.com/reference/command-query.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
