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:
| Field | Notes |
|---|---|
Name | Required. Display name shown in the list. |
Description | Optional. Shown under the name. |
Category | Free-text grouping, defaults to General. The category picker offers existing categories, and you can type a new one. |
CommandType | One of PowerShell, Batch, Shell, or Executable. Defaults to PowerShell. |
Command | Required. The script or command body. |
IsShared | When 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:
| State | Who can see it | Editable? |
|---|---|---|
| Predefined | Everyone — shipped with the server. | No — predefined templates cannot be edited or deleted. |
| Shared | Everyone — a user-created template with Share with all users enabled. | Yes, by operators/admins. |
| Private | Only the user who created it. | Yes, by its owner. |
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#
- Open Commands › Templates and find a template using search, the category filter, or the state tabs.
- Click Use Template. Athena opens the command editor at
/commands/executewith the template'sCommandTypeand command body pre-loaded. - 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#
Template bodies can include placeholder tokens that Athena can resolve against the target agent. The supported tokens are:
| Token | Resolves to |
|---|---|
{{hostname}} | Agent hostname |
{{ip}} | Agent IP address |
{{os}} | Operating system |
{{osVersion}} | OS version |
{{domain}} | Domain name |
{{agentVersion}} | Installed agent version |
{{agentId}} | Agent identifier |
Token matching is case-insensitive. The predefined Agent Info Report template demonstrates the syntax:
Write-Output 'Agent Report for {{hostname}}'
Write-Output 'IP Address: {{ip}}'
Write-Output 'OS: {{os}} {{osVersion}}'
Write-Output 'Agent Version: {{agentVersion}}'
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:
| Category | Type | Examples |
|---|---|---|
System Info | PowerShell | Get System Information, Get Disk Space, Get Running Processes, Get Installed Software, Get Uptime |
Network | PowerShell | Get IP Configuration, Get Active Connections, Test Network Connectivity, Get DNS Cache |
Services | PowerShell | Get Running Services, Get Failed Services, Restart Service |
Security | PowerShell | Get Windows Updates, Get Local Admins, Get Firewall Rules, Get Login Events |
Linux System | Shell | System Info, Disk Usage, Memory Usage, Top Processes, Active Services, Network Info |
Maintenance | PowerShell | Clear Temp Files, Flush DNS Cache, Check Disk Health |
Agent | PowerShell | Agent 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.
- Edit updates any field and records who last modified it and when. Predefined templates are blocked from editing.
- Delete removes a template after confirmation. Predefined templates cannot be deleted.
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 requires the Operator or Admin policy — the same class of users who run commands. See Roles & Permissions for the full policy model. Because templates only stage command text, the guardrails that matter are on the command execution path, where every run is written to the audit log.
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.