Getting Started
Welcome to the Serenade docs! Here, you'll find an overview of everything Serenade can do, along with examples. First, let's get Serenade installed on your device.
Installation
Serenade is freely available for macOS, Windows, and Linux. To download Serenade, head to https://serenade.ai/download.
After installation, Serenade will walk you through installing plugins for supported applications, like VS Code, Chrome, and Hyper. Serenade will then guide you through interactive tutorials to practice voice coding.
Serenade can be configured to use cloud-based speech recognition or local speech recognition. To change this setting, just head to Settings > Server. If you're using Windows, the local server requires WSL with Ubuntu. Regardless of your setting, you can also opt into sharing your data with Serenade in order to help improve Serenade's speech-to-code machine learning models.
Setup
Serenade floats above all your other windows, so you can keep it side-by-side with other applications, like your code editor. You can toggle Serenade by clicking the Listening switch or pressing Alt+Space. Then, as you speak, you'll see a list of transcripts in the Serenade window.
Sometimes, Serenade isn't sure what you said, so you'll see a few different options. The first one will be used automatically, but to use a different option (and undo the first one), just say the number you want to use instead. For instance, to use the second option, just say
. If none of the options are right, you can just say .Basics
As you'll see throughout these docs, most Serenade voice commands have the same form:
The action
is something you want to do to your code. Common actions include to add a new line of code, to edit code, and to remove code.
A selector
is a block of code to operate on. Some selectors are text-based, like or . Even more powerful selectors are code-based, which enable you to reference parts of your code, including , , and . For a complete list of selectors, see the Reference section.
Serenade commands simply combine an action and a selector:
, , and .You can also chain commands together without pausing. For instance, you can say
to save your current file and then focus your terminal, or to add a new method at the start of a class.Finally, you can also specify how many times a command should be executed. For instance
will run the indent command three times.Common Commands
Below is a compact list of commonly-used Serenade commands that you can use as a reference or cheat sheet as you're learning voice coding.
Command | Description | Examples |
---|---|---|
go to <selector> | Move your cursor around a file | |
add <code> | Add a new statement or construct | |
insert <code> | Insert text at your cursor | |
change <old> to <new> | Change existing text | |
delete <selector> | Delete text | |
copy/paste <selector> | Copy, cut, paste | |
indent/dedent | Change the indentation level of code | |
save | Save the current file | |
undo | Undo the last operation | |
open <text> | Open a new file | |
(next | previous) tab | Switch tabs in your editor | |
focus <text> | Switch apps |
Adding Code
Serenade has two different commands for writing code.
- inserts code right at your cursor, which is helpful for inserting text onto an existing line.
- moves your cursor intelligently based on what you say (e.g., "add parameter"), and is used for writing new statements and larger blocks of code, like functions and classes.
As you'll see, Serenade uses machine learning under the hood to handle many formatting details for you, so you don't have to manually dictate symbols and formatting details like underscores vs. camel case formatting. For instance, if you have a variable foo_bar
in scope and you say , Serenade will automatically format your code as foo_bar
, so you don't have to specify the underscore.
Inserting Code
The
command will insert code at the current cursor position. is useful for appending text to an existing line of code or inserting text into the middle of a line.commands look like:
Command | Code |
---|---|
hello world | |
two one two |
Adding Code Blocks
is used for writing new lines or blocks of code. This command will intelligently position your cursor and handle boilerplate for you. For instance, will move your cursor to the nearest parameter list, and then create a new parameter.
Below are just some examples of selector. All commands have the same form:
commands—you can use anyCommand | Code |
---|---|
def factorial() -> int: pass | |
class Page: pass | |
return say("hello") | |
if x > 3: return elif x < 3: pass | |
import numpy as np | |
capitalize(word[0]) | |
# fix later | |
@app.route def index(): pass | |
class Colors(enum.Enum): pass | |
if not error: pass | |
callback = lambda e: pass | |
class Person: def name(self) -> str: pass | |
class Circle: radius = 3.5 | |
while i != 0: pass |
Raw Text
inserts text wherever your cursor has focus, even if no Serenade plugin is present. For instance, you can use to type into VS Code's "Find" dialog box rather than the main text editor. also doesn't do much formatting for you, which can be useful if you want to drop down to a lower-level and manually specify all formatting, spacing, etc.
Command | Code |
---|---|
simple text |
Navigating Code
The selector (e.g., ). Since the command is so common, if you just say a selector, like or , Serenade will implicitly use the command.
command moves your cursor around the file. With this command, you can jump to any text in your file (e.g., ), or anyBelow are just some examples of selector. All commands have the same form:
commands—you can use anyCommand | Code |
---|---|
def random(low, high): return 4 | |
def random(low, high): return 4 | |
def random(low, high): return 4 | |
def random(low, high): return 4 |
To move your cursor to the literal text matching a selector name, rather than the selector itself, you can say
. For instance, you might want to move your cursor to the literal word "parameter" rather than a parameter to a function, so you could say . This is similar to how works in and commands.Finally, you can move your cursor by speaking a direction:
, , , and .Editing Code
In this section, we'll take a look at voice commands you can use for editing existing code, like
, and , as well as more powerful refactoring commands.Changing Code
The
command selects the nearest match to the cursor and replaces it with some text.Command | Code |
---|---|
set_color("foreground", "blue") set_color("background", "blue") | |
def fly(height: int): pass def fly(speed: int): pass | |
class Install: pass class Setup: pass |
You can also copy, cut, and paste code.
Command | Code |
---|---|
all too well | |
this is a long line of text | |
shake it off | |
Deleting Code
You can delete code with the selector. All commands have the same form:
command. Below are just some examples of commands—you can use anyCommand | Code |
---|---|
class Bird: def fly(self): // TODO return | |
class Bird: def fly(self): // TODO return | |
class Bird: def fly(self): // TODO return |
Refactoring Code
Serenade supports a variety of commands for refactoring code. All refactoring commands have the same form:
Command | Code |
---|---|
# def random(): # return 4 | |
url = "serenade.ai" // pages = 3 // download(url, pages) | |
y = f(x) z = g(y) y = f(x) z = g(y) | |
y = f(x) z = g(y) y = f(x) z = g(y) | |
message = Hello world message = "Hello world" | |
value++ print(value); value++ print(value); | |
def initialize(): buffer.reset() def initialize(): buffer.reset() | |
first = "a"; second = "b"; second = "b"; first = "a"; | |
z = f(x, y) z = f(y, x) | |
list = [ 1, 2, 3 ] list = [1, 2, 3] |
System Commands
Serenade doesn't just work for applications that have a native Serenade plugin—you can control any application with voice using Serenade. No matter what application you're using, you can use commands like
to insert text, to press keys (to trigger shortcuts), and to switch apps.Keyboard & Mouse
Command | Description |
---|---|
Press a key combination | |
Type a string using keystrokes | |
Type a string and press enter | |
Trigger a mouse click |
Application Control
Command | Description |
---|---|
Pause Serenade | |
Repeat the last command matching some text | |
Copy to the clipboard | |
Cut to the clipboard | |
Paste from the clipboard | |
Create a new tab | |
Close the active tab | |
Switch tabs | |
Trigger an undo | |
Trigger an redo | |
Bring an app to the foreground | |
Launch an app | |
Close an app |
Editor Integrations
Command | Description |
---|---|
Save the current file | |
Format the current file | |
Open a file | |
Create a breakpoint | |
Remove a breakpoint | |
Toggle a breakpoint | |
Start a debugger session | |
Stop the current debugger session | |
Move the debugger step-by-step | |
Continue the debugger to the next breakpoint |
Revision Box
Serenade uses a combination of plugins and OS-level accessibility APIs to manipulate text no matter what application you're using. However, some applications don't properly implement accessibility APIs, and so Serenade can't read their text fields. When you're using one of these applications, you can use Serenade's Revision Box to format your text. Inside of the Revision Box, all of Serenade's commands will work properly, and when you're done, Serenade can copy the text in the Revision Box back into the application you had focused.
The Revision Box will open automatically when Serenade can't read the current field (if enabled in settings). You can also say
to open the revision box yourself. Or, say to copy the current text field into the revision box.When Revision Box is open, you can say
to close and and ts contents into the field you were editing. You can also say to also press enter after inserting (e.g., for sending a message) or to copy the text to the clipboard rather than inserting it.For more information on customizing the behavior of the revision box, see the API docs
.Command | Description |
---|---|
Open an empty revision box | |
Open a revision box with the current text field | |
Close the revision box and copy its contents to the clipboard | |
Close the revision box and paste its contents into the current text field | |
Same as close, but also press enter afterward |
Command Modes
Serenade has a few different configurable modes to change how your voice commands are interpreted.
Command/Dictate Mode
Serenade's default mode is Command Mode. In this mode, if you say something that isn't a valid Serenade command, Serenade will show an x next to the command and won't do anything. To enable command mode, just say
.Sometimes, like when dictating a longer block of text, you want Serenade to simply type out everything you're saying, rather than listen for other commands. Serenade's Dictate Mode does just that. To enable Dictate Mode, just say
, and then Serenade will type out everything you say, rather than listening for valid commands. Some commands, like , , and , will also be presented as alternatives so you don't have to leave Dictate Mode to use them. To get back to normal mode, just say .Language Modes
By default, Serenade will auto-detect which programming language is being used based on your editor's filename or active language setting. Sometimes, you might want to override this behavior and specify which language Serenade should use. To do so, simply say
, , and so on. To get re-enable auto-detection, say .Symbols & Formatting
Serenade's speech-to-code engine handles many symbols and formatting details automatically, and you can also manually specify text styles and symbols.
Symbols List
When speaking any command, you can also include symbols. Here's a list of all of the symbols supported by Serenade:
Transcript | Symbol | Transcript | Symbol | Transcript | Symbol |
---|---|---|---|---|---|
plus | + | dash, minus | - | star, times | * |
slash, divided by | / | less than or equal to | <= | less than | < |
greater than or equal to | >= | greater than | > | not equal | != |
double equal | == | triple equal | === | equal | = |
left shift | << | right shift | >> | and | && |
or | || | comma | , | colon | : |
dot, period | . | underscore | _ | semicolon | ; |
bang, exclam | ! | question mark | ? | tilde | ~ |
percent, mod | % | at | @ | dollar | $ |
right arrow | -> | arrow | -> | space | |
backslash | \ | hash | # | caret | ^ |
ampersand | & | backtick | ` | pipe | | |
left brace | { | right brace | } | left bracket | [ |
right bracket | ] | single quote | ' | quote, double quote | " |
You can also enclose text in symbols like braces, brackets, and parens. Here's a list of all of the enclosure symbols supported by Serenade:
Transcript | Symbol | Transcript | Symbol |
---|---|---|---|
braces | { } | brackets | [ ] |
comparators, angle brackets | < > | quotes, string | " " |
single quotes | ' ' | triple quotes | """ """ |
of, parens | ( ) | underscores | _ _ |
double underscores | __ __ |
If you want to use the literal text representation of a symbol (e.g., the word dash
rather than the -
character, you can escape it by saying .
Below are just a few examples of commands using symbols—you can use any of the symbols above.
Command | Code |
---|---|
this.get(key) | |
first = array[0] | |
plus |
Text Formatting
To specify camel case, underscores, and so on, you can specify a style in any
, , etc. command. Below is a list of text styles:Command | Description |
---|---|
sing song | |
singSong | |
sing_song | |
SingSong | |
SING_SONG | |
sing-song | |
singsong |
When writing code with
and , you can specify text styles:Command | Code |
---|---|
create(SomeClass) | |
myAge = your_age + 1 |
You can also style existing text by describing a style, followed by a selector to change:
Command | Code |
---|---|
foo Foo | |
one two three oneTwo three |
Reference
This section has a few difference references that you can use as cheat sheets while learning Serenade.
Code Selectors
Code selectors can be used to describe a block of code you want to reference, like a function, argument, or class. You can use any of these selectors in commands like
, , , or any command that contains a selector.The following selectors work for supported languages:
argument list | argument | annotation | assert |
assignment | assignment value | assignment variable | attribute |
attribute value | attribute name | attribute text | body |
break | case | catch | class |
close tag | comment | comment text | condition |
constructor | content | continue | declaration |
decorator | dictionary | element | else if |
else | entry | enum | except |
export | extends | field | finally |
for | function | generator | if |
import | include | interface | implementation |
keyword argument | keyword parameter | key | lambda |
line | list | member | method |
mixin | modifier | namespace | object |
open tag | parameter list | parameter value | parameter |
parent | property | prototype | return |
return type | return value | ruleset | set |
setter | statement | string | string text |
struct | switch | tag | throw |
trait | tuple | try | type |
with | with alias | with item | while |
value | variable |
Text Selectors
Text selectors can be used to describe a block of text you want to reference, independent of any programming language. You can use any of these selectors in commands like
, , , or any command that contains a selector.The following selectors work in any file, regardless of whether or not Serenade supports the language:
all | block | character |
file | letter | line |
number | phrase | word |
Selector Modifiers
Below is a list of common modifiers you can use with any selector above. Modifiers can also be combined (e.g.,
).Command | Description | Examples |
---|---|---|
next | previous | The next or previous instance | |
first | second | ... | The index in a list | |
one | two | ... | The index in a list | |
start | end | The start or end | |
<number> <objects> | Multiple objects at once | |
X to Y | A range of instances | |
to start, to end | From the cursor to the start or end | |
<object> <name> | The object with the given name | |
phrase | Escaped, literal text |