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.

Metadata

Release files for ovos-skill-cmd 0.9.0a4

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.9.0a4
File Size Uploaded Provenance Actions
ovos_skill_cmd-0.9.0a4.tar.gz 20.7 kB Without provenance Details for ovos_skill_cmd-0.9.0a4.tar.gz

Built distribution (wheel)

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

Total release size: 66.4 kB

Release files / ovos_skill_cmd-0.9.0a4.tar.gz

Download URL ovos_skill_cmd-0.9.0a4.tar.gz
Size 20.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b2f36a20ee5149544402df5be33b1c3399c7173d91c01763bca8bd47d719f5ee
BLAKE2b-256 checksum
How to use checksums
41a8c34635ffdc00f1a24cc4b256f16150a93af3975115a48fa5619c1bf61255
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / ovos_skill_cmd-0.9.0a4-py3-none-any.whl

Download URL ovos_skill_cmd-0.9.0a4-py3-none-any.whl
Size 45.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1fbbad1aa3adca262001c32630014913f03ed69e25b1e7dc8b979c50879e7a7e
BLAKE2b-256 checksum
How to use checksums
da32f8e69e6a2c9675ac417fe610a46dc4597fcf0910dd09b9ae34044a897479
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for ovos-skill-cmd 0.9.0a4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
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