There is a global variable Settings under which all settings are contained. They are typically organized by package name, although there are a few root-level settings. Each package can define settings, and you can edit the settings of any package.

We have included a shorthand notation where Settings.somePackage = {...} will do a "deep merge", merging the new values with the existing values.

Editing settings

You can edit any package's settings from your own file or from any other user-code (.coffee or .js) file:

Settings.somePackage = {
  someSetting: ['arrays', 'will', 'merge'],
  otherSetting: {
    objects: {
      will: 'deep merge too'
  booleanSetting: false

If you want to delete a certain setting

delete Settings.somePackage.someSetting


If a package name has a space or dash in its name it needs to be accessed using bracket-notation instead of dot-notation, since javascript variable names can only contain alphanumeric characters and underscores:

Settings['some package with a space']

Using existing settings

If you need to access a setting in order for your code to make a decision, you can directly access any setting from any package using Settings.packageName.settingName such as:

if (Settings.dragon_darwin.version === 5) {
  // do something
} else {
  // do something else

Inspecting existing settings

If you want to poke around with your live instance of VoiceCode, and all its runtime settings:

  • start up the VoiceCode CLI
  • type Settings.somePackage
  • hit 'Return' and you will see the current values for that package's settings
  • If you want to drill down to a specific setting, type Settings.somePackage.someSetting
  • If you want to see the entire Settings object, just type Settings

Settings examples:

The main ~/voicecode/ is where most basic settings should be placed:

# ~/voicecode/
_.extend Settings,
    license: ''
    email: ''
        development: ["localhost", 31337]
      applicationsThatNeedExplicitModifierPresses: [
        'Screen Sharing'
      applicationsThatCanNotHandleBlankSelections: [
        default: ['scrolling:up', 'scrolling:down']

VoiceCode lets you create any directory structure you want for your settings and commands. We recommend creating a directory at ~/voicecode/settings under which you could put all your different settings files.

For any specific package settings that might have a long list of options (i.e. websites, abbreviations, etc.) we recommend creating a file just for that package. This is so that your main settings file does not get really long and unwieldy, makes it easier to find the file/setting you are looking for. You can use JavaScript or CoffeeScript, Here's some examples:

// ~/voicecode/settings/vocabulary.js
Settings.vocabulary = {
  vocabulary: [ // teach dragon new words
    'node js',
    'npm install',
  vocabularyAlternate: { // text replacement on dragon side
    'a sink': 'async'
  translations: { // text replacement on VoiceCode side
    'consul': 'console'
  sequences: { // common sequences of commands (to boost accuracy)
    'symbols:slash': [
      'repetition:command-2', // reinforcing 🔉slash soup🔉  for javascript comments
      'bin', // reinforce the phrase 🔉slash bin🔉 => `/bin`
# ~/voicecode/settings/
Settings.web =
    "atom": ""
    "facebook": ""
    "digital ocean": ""
# ~/voicecode/settings/
Settings.insert =
    voicecode: ""
    gmail: ""
    instagram: "bcoolinsta"
    administrator: "admin"
    administrators: "admins"
    allocate: "alloc"
    alternate: "alt"
    gmail: "password123"
    microsoft: "123password"
    amazon: "pass123word"

Add some more applications, and some single word app shortcuts

# ~/voicecode/settings/
Settings.application =
    'vox': 'VOX'
    'table' : 'LightTable' ,
    'fusion' : 'VMware Fusion' ,
    'torrent' : 'Transmission',
    'spotify' : 'Spotify'
    'vlc' : 'VLC'
    'finder' : 'Path Finder'
    'notes' : 'Notes'
    'telegram': 'Telegram'
    'hub': 'MongoHub'
    'slack': 'Slack'
    chromie: "Google Chrome"
    termite: "iTerm"
    atom: "Atom"
    canary: 'Google Chrome Canary'
    telegram: 'Telegram'
    finder: 'Path Finder'
    vivi: 'Vivaldi'
    foxy: 'FirefoxDeveloperEdition'

Add some more directories

# ~/voicecode/settings/
Settings.os =
    code: "~/code"
    projects: "~/Documents/projects"
    voicecode: "~/voicecode"
    "voicecode settings": "~/voicecode/settings"

Add some more shell commands

# ~/voicecode/settings/
Settings['command-line'] =
    "atom publish": "apm publish minor"
    "push and deploy": "git push\n modulus deploy\n"
    "soft link": "ln -s "

Will boost recognition of certain words by creating a dragon command, but still process the word as plain dictation on VoiceCode side

# ~/voicecode/settings/
Settings.words =
  words: [

Add some editor code snippet completions

# ~/voicecode/settings/
Settings.editor =
  codeSnippetTriggers: [
    if: "if"
    "if else": "ife"

results matching ""

    No results matching ""