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.
- The four count cards are also the scope filter — click one (or focus it and press Enter or Space) to show only that group. My Templates counts only your own private templates.
- Search starts after two characters and matches the template name, description, and the command body, so you can find a template by a cmdlet or path it uses.
- The All Categories drop-down narrows the list to one category.
- Each row shows the name and description, category, command type, status (Predefined / Shared / Private), Created by, Created, and three icon actions — Use Template, Edit, and Delete (hover an icon to see its label).
Each template carries the following fields:
| Field | Notes |
|---|---|
Name | Required. Display name shown in the list. |
Description | Optional. Shown under the name. |
Category | Required. Defaults to General. Pick an existing category from the drop-down, or choose New category... to type a new one (see Choosing a category). |
CommandType | One of PowerShell, Batch, Shell, or Executable. Defaults to PowerShell. |
Command | Required. The script or command body. |
Share with all users | 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 any user who can open the Templates screen, not only its creator. |
| Private | Only 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#
- Open Commands › Templates and find a template using search, the category filter, or the state tabs.
- Click the Use Template (run) icon on the row. 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#
The template editor's hint lists a set of placeholder tokens that describe an agent. The recognised 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 |
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:
| 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.
Choosing a category
In both Create Template and Edit Template, Category is a drop-down list:
- It lists every category already in use, in alphabetical order.
A new template starts on
General. - To file a template under a category that does not exist yet, choose the last option, New category.... A text box (Select or enter category) appears below the list; whatever you type there is saved as the category.
- When you edit a template, its current category is always pre-selected — even if no other template uses it — so saving an edit never changes the category by accident.
- Edit updates any field and records who last modified it and when. Predefined templates are blocked from editing.
- Delete removes a template after a confirmation dialog that shows its name and category (“This action cannot be undone.”). 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 — 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.