Skip to content

Building Commands

The Specialists --- Commands are the staff members who each know how to do one thing expertly. The chef cooks, the accountant balances the books, the gardener tends the grounds. When someone makes a request, the right specialist steps forward.

Commands are the core extension point of Jarvis. Every voice interaction -- "What's the weather?", "Play some jazz", "Turn off the lights" -- is handled by a command: a Python class that implements the IJarvisCommand interface.

How It Works

When a user speaks a voice command, the pipeline looks like this:

  1. Speech-to-text converts audio to text
  2. The command center sends the text to the LLM with all registered command schemas
  3. The LLM selects a command and extracts parameters
  4. The node executes the command's run() method
  5. The response flows back through the command center to the user

Commands live as Python files in jarvis-node-setup/commands/. Drop in a new file, implement the interface, and run install_command.py -- that's it.

Minimal Skeleton

Every command follows this pattern:

from typing import List

from core.ijarvis_command import IJarvisCommand, CommandExample
from core.ijarvis_parameter import JarvisParameter
from core.ijarvis_secret import IJarvisSecret
from core.command_response import CommandResponse
from core.request_information import RequestInformation


class MyCommand(IJarvisCommand):

    @property
    def command_name(self) -> str:
        return "my_command"

    @property
    def description(self) -> str:
        return "Short description of what this command does"

    @property
    def keywords(self) -> List[str]:
        return ["keyword1", "keyword2"]

    @property
    def parameters(self) -> List[JarvisParameter]:
        return []

    @property
    def required_secrets(self) -> List[IJarvisSecret]:
        return []

    def generate_prompt_examples(self) -> List[CommandExample]:
        return [
            CommandExample(
                voice_command="Example voice input",
                expected_parameters={},
                is_primary=True,
            ),
        ]

    def generate_adapter_examples(self) -> List[CommandExample]:
        return self.generate_prompt_examples()

    def run(self, request_info: RequestInformation, **kwargs) -> CommandResponse:
        return CommandResponse.final_response(
            context_data={"message": "Hello from my command!"}
        )

Built-in Commands

These commands ship with Jarvis and are available on every node by default:

Command Name Description
CalculatorCommand calculate Two-number arithmetic (add, subtract, multiply, divide)
ControlDeviceCommand control_device Smart home device control (Home Assistant + direct WiFi)
GetDeviceStatusCommand get_device_status Query smart home device state
ChatCommand chat Open-ended conversation with the LLM
AnswerQuestionCommand answer_question Factual Q&A
TimerCommand set_timer Set countdown timers
CheckTimersCommand check_timers List active timers
CancelTimerCommand cancel_timer Cancel a running timer
ReminderCommand reminder Set, list, delete, and snooze reminders (with recurrence support)
TellAJokeCommand tell_a_joke Random jokes
MeasurementConversionCommand convert_measurement Unit conversions
TimezoneCommand get_current_time Current time in any timezone
RoutineCommand routine Multi-step automations
WhatsUpCommand whats_up Morning briefing (weather + calendar + news)

Pantry-Installable Commands

The following commands have been extracted to standalone Pantry packages. Install them with jarvis pantry install <name>:

Command Name Description
OpenWeatherCommand get_weather Current weather and forecasts via OpenWeather API
NewsCommand get_news News headlines
SportsCommand get_sports_scores Live sports scores via ESPN
WebSearchCommand search_web Web search with deep research
StoryCommand tell_a_story Generate stories
BluetoothCommand bluetooth Bluetooth device management
MusicCommand music Play content and control playback via Music Assistant
EmailCommand email List, read, search, send, reply, archive email (Gmail/IMAP)
ReadCalendarCommand get_calendar_events Calendar events (iCloud)

Device families (Kasa, LIFX, Govee, Apple, Nest) are also available as Pantry packages.

Guides

Reference