Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

OVOS Cmd Skill

This OVOS skill runs shell scripts and other commands. The commands run without asking for confirmation.

Install

pip install ovos-skill-cmd

Usage

Trigger a command with a spoken phrase:

  • "Hey Mycroft, launch command echo TEST"
  • "Hey Mycroft, run script generate report"

Configuration

Configure the skill in settings.json. Map a spoken phrase to a script or command under alias. For example:

{
  "alias": {
    "generate report": "/home/forslund/scripts/generate_report.sh"
  }
}

With this setting, the phrase "run script generate report" makes the skill execute /home/forslund/scripts/generate_report.sh.

user

Set user to run commands under a specific user's privileges:

{
  "user": "ovos"
}

shell

Set shell to control whether commands run through a shell. It defaults to true:

{
  "shell": false
}

Full example

{
  "user": "ovos",
  "alias": {
    "generate report": "/home/forslund/scripts/generate_report.sh",
    "update system": "sudo apt update && sudo apt upgrade -y",
    "reboot device": "sudo reboot"
  },
  "shell": true
}

Security notes

  • Running commands through a shell allows complex operations but can expose security risks. If your commands do not need shell features, set shell to false.
  • A command can run under a specific user through the user field. Make sure that user has the permissions the command needs.
  • Do not configure dangerous commands, such as rm -rf, without additional safeguards.

Docker containers

Commands run only inside the Docker container. If a command also needs an effect outside the container, use an additional mechanism, such as a named pipe.

This example steers Kodi, which runs outside the container, from ovos-skill-cmd:

{
    "alias": {
        "kodi restart": "echo \"systemctl restart kodi\" > /home/ovos/.config/mycroft/joespipe",
        "kodi mute": "echo \"kodi-send --action=\\\"Mute\\\"\" > /home/ovos/.config/mycroft/joespipe",
        "kodi unmute": "echo \"kodi-send --action=\\\"Mute\\\"\"  > /home/ovos/.config/mycroft/joespipe",
        "kodi louder": "echo \"kodi-send --action=\\\"VolumeUp\\\"\" > /home/ovos/.config/mycroft/joespipe",
        "kodi lower": "echo \"kodi-send --action=\\\"VolumeDown\\\"\" > /home/ovos/.config/mycroft/joespipe",
        "kodi pause": "echo \"kodi-send --action=\\\"PlayerControl(Play)\\\"\" > /home/ovos/.config/mycroft/joespipe",
        "kodi resume": "echo \"kodi-send --action=\\\"PlayerControl(Play)\\\"\" > /home/ovos/.config/mycroft/joespipe",
        "kodi stop": "echo \"kodi-send --action=\\\"PlayerControl(Stop)\\\"\" > /home/ovos/.config/mycroft/joespipe"
    },
    "shell": true,
    "__mycroft_skill_firstrun": false
}

/home/ovos/.config/mycroft/joespipe is a named pipe in the shared volume of the OVOS config folder. Outside the container, a small script watches the pipe for commands:

#!/bin/bash
while true; do eval "$(cat /storage/ovos/config/joespipe)"; done

Read more about this named-pipe approach on Stack Overflow.

License

Apache License 2.0. See LICENSE.txt.

Release files for ovos-skill-cmd 0.8.5a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ovos-skill-cmd 0.8.5a1
File Size Uploaded
ovos_skill_cmd-0.8.5a1.tar.gz 15.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ovos-skill-cmd 0.8.5a1
File Interpreter ABI Platform
ovos_skill_cmd-0.8.5a1-py3-none-any.whl Python 3 none any Details

Total release size: 48.3 kB

Release files / ovos_skill_cmd-0.8.5a1.tar.gz

Download URL ovos_skill_cmd-0.8.5a1.tar.gz
Size 15.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8b3e13ffa6591b86d4732ccb5d348fdbe5df698cf076b6206b55da5d5a5f2068
BLAKE2b-256 checksum
How to use checksums
6172a3c01438e77729152108142a8de795dc53961cf16c5f027c4fa043f98065
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / ovos_skill_cmd-0.8.5a1-py3-none-any.whl

Download URL ovos_skill_cmd-0.8.5a1-py3-none-any.whl
Size 32.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
700cd393cd3caf668915eb026bddff05f4947760639c83d1bd59c255a61160cf
BLAKE2b-256 checksum
How to use checksums
c62724ad6dbc0c7dc5b36298a996d03f0bdf0fdbbb2f185515f86c78e760dfc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.8.5a1 This release

2 release files

0.2.10

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.3

2 release files

0.2.1

2 release files

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page