Command Templates

Save, share, and reuse the scripts you run from the Commands screen. A command template is a named, categorised snippet — PowerShell, Batch, Shell, or Executable — that any operator can load into the command editor with a single click instead of pasting the same script every time.

Overview#

Command templates are managed from the Commands › Templates screen (/commands/templates), reachable from the Command Templates quick-action card on the Commands page. The screen lists every template you can see, with counts for All, Predefined, Shared, and My Templates, plus search and a category filter.

Each template carries the following fields:

FieldNotes
NameRequired. Display name shown in the list.
DescriptionOptional. Shown under the name.
CategoryRequired. Defaults to General. Pick an existing category from the drop-down, or choose New category... to type a new one (see Choosing a category).
CommandTypeOne of PowerShell, Batch, Shell, or Executable. Defaults to PowerShell.
CommandRequired. The script or command body.
Share with all usersWhen enabled, all users can use this template. When off, the template is private to its creator.

Templates are a convenience library for the Commands screen. They store command text only — creating or editing a template never runs anything on an agent. Execution still happens through the Commands flow, subject to its own role and audit controls.

Visibility & ownership#

Every template falls into one of three states, shown as a status badge:

StateWho can see itEditable?
PredefinedEveryone — shipped with the server.No — predefined templates cannot be edited or deleted.
SharedEveryone — a user-created template with Share with all users enabled.Yes — by any user who can open the Templates screen, not only its creator.
PrivateOnly the user who created it.Yes, by its owner (other users never see it in the list).

The default listing returns shared and predefined templates; your own private templates are also included on the Templates screen. Attempting to edit or delete a predefined template is rejected by the server, and the UI surfaces a “Cannot delete predefined templates” message.

Using a template#

  1. Open Commands › Templates and find a template using search, the category filter, or the state tabs.
  2. Click the Use Template (run) icon on the row. Athena opens the command editor at /commands/execute with the template's CommandType and command body pre-loaded.
  3. Pick your target agents (or a collection), choose Run as SYSTEM or an alternate credential, adjust the timeout, and execute.

Loading a template only fills in the editor — you can still edit the script before running it, and nothing executes until you press Execute.

Dynamic variables#

The template editor's hint lists a set of placeholder tokens that describe an agent. The recognised tokens are:

TokenResolves to
{{hostname}}Agent hostname
{{ip}}Agent IP address
{{os}}Operating system
{{osVersion}}OS version
{{domain}}Domain name
{{agentVersion}}Installed agent version
{{agentId}}Agent identifier

The predefined Agent Info Report template uses them:

Write-Output 'Agent Report for {{hostname}}'
Write-Output 'IP Address: {{ip}}'
Write-Output 'OS: {{os}} {{osVersion}}'
Write-Output 'Agent Version: {{agentVersion}}'

Tokens are not replaced when you run from the Commands screen. Loading a template with Use Template and pressing Execute sends the script exactly as written — a {{hostname}} token reaches the device as the literal text {{hostname}}, and the Agent Info Report prints the tokens rather than values. For per-device values in a script you run from the console, read them on the device itself (for example $env:COMPUTERNAME in PowerShell or hostname in a shell).

Predefined templates#

On first start the server seeds a read-only library of predefined templates if none exist yet. Seeding is non-fatal — if it fails the server continues without them. The shipped set is grouped into the following categories:

CategoryTypeExamples
System InfoPowerShellGet System Information, Get Disk Space, Get Running Processes, Get Installed Software, Get Uptime
NetworkPowerShellGet IP Configuration, Get Active Connections, Test Network Connectivity, Get DNS Cache
ServicesPowerShellGet Running Services, Get Failed Services, Restart Service
SecurityPowerShellGet Windows Updates, Get Local Admins, Get Firewall Rules, Get Login Events
Linux SystemShellSystem Info, Disk Usage, Memory Usage, Top Processes, Active Services, Network Info
MaintenancePowerShellClear Temp Files, Flush DNS Cache, Check Disk Health
AgentPowerShellAgent Info Report (uses dynamic variables)

Predefined templates are owned by System and are always shared. You cannot modify or remove them — clone the command into a new template if you need a variant.

Creating, editing & deleting#

Use Create Template to add your own. Name and Command are required; the editor validates both before saving. New templates are stamped with your username as Created by and start un-shared unless you tick Share with all users.

Choosing a category

In both Create Template and Edit Template, Category is a drop-down list:

Categories are simply the distinct values already in use, so a new category appears in the filter as soon as one template uses it.

Access & roles#

The Templates screen — and creating, editing, and deleting templates — requires the commands.templates.manage permission (Create, edit and delete the saved command templates other operators run). It is part of the Operator and Admin role bundles; Viewer and Helpdesk users do not have it. See the Permission Model for every permission and its default holders.

Running a template is a separate grant: Use Template opens the command editor, which requires commands.execute, and every run is written to the audit log. Creating, editing, and deleting templates is recorded in the server log (with the template id and the user) rather than as audit events.

Command templates are a built-in server feature — no external service, plug-in, or internet access is required. They work the same way on a fully air-gapped deployment.