Templates
Templates
Section titled “Templates”Create Confluence pages from reusable templates with variable substitution and Handlebars syntax.
Prerequisites
Section titled “Prerequisites”- Authenticated profile (
atlcli auth login) - Space permission: Edit permission to create pages from templates
Overview
Section titled “Overview”The template system provides:
- Hierarchical storage: Global, profile, and space-level templates
- Precedence: Space > Profile > Global (most specific wins)
- Handlebars syntax: Full logic support (if, unless, each, with)
- Built-in variables: Date, time, user, space, and more
- Import/export: Share template packs via directories, Git, or URLs
Quick Start
Section titled “Quick Start”# Create a templateatlcli wiki template create meeting-notes --file ./meeting.md
# List available templatesatlcli wiki template list
# Create a page from templateatlcli wiki page create --template meeting-notes \ --var title="Sprint Planning" \ --var date=2025-01-14 \ --space TEAM
# Render template to stdout (preview)atlcli wiki template render meeting-notes --var title="Test"Template File Format
Section titled “Template File Format”Templates are Markdown files with YAML frontmatter:
---name: meeting-notesdescription: Template for team meetingsauthor: Your Nameversion: 1.0.0tags: - meeting - teamvariables: - name: title type: string required: true description: Meeting title - name: date type: date required: true - name: attendees type: string default: "TBD" - name: type type: select options: - standup - planning - retro required: true---# {{title}}
**Date:** {{@date}}**Type:** {{type}}**Attendees:** {{attendees}}
## Agenda
{{#if agenda}}{{agenda}}{{else}}- Item 1- Item 2{{/if}}
## Notes
<!-- Add meeting notes here -->
## Action Items
| Owner | Action | Due ||-------|--------|-----|| | | |Variable Types
Section titled “Variable Types”| Type | Description | Validation |
|---|---|---|
string | Free text | None |
number | Numeric value | Must be valid number |
date | Date value | ISO 8601 or relative (today, tomorrow) |
boolean | True/false | Accepts true/false, yes/no, 1/0 |
select | Enum from options | Must match one of options |
Built-in Variables
Section titled “Built-in Variables”Built-in variables use the @ prefix:
| Variable | Description | Example |
|---|---|---|
{{@date}} | Current date | 2025-01-14 |
{{@datetime}} | Date and time | 2025-01-14T10:30:00 |
{{@time}} | Current time | 10:30 |
{{@year}} | Current year | 2025 |
{{@month}} | Current month | 01 |
{{@day}} | Current day | 14 |
{{@weekday}} | Day of week | Tuesday |
{{@user}} | Current user | john.doe |
{{@space}} | Space key | TEAM |
{{@profile}} | Profile name | work |
{{@title}} | Page title | From context |
{{@parent.id}} | Parent page ID | 12345 |
{{@parent.title}} | Parent page title | Parent Page |
{{@uuid}} | Random UUID | 550e8400-e29b-… |
Storage Locations
Section titled “Storage Locations”atlcli stores templates at three levels with precedence (space > profile > global):
Global Templates
Section titled “Global Templates”~/.atlcli/templates/global/├── meeting-notes.md└── decision-record.mdProfile Templates
Section titled “Profile Templates”~/.atlcli/templates/profiles/└── work/ └── standup.mdSpace Templates
Section titled “Space Templates”# In synced docs folder (checked first)./my-docs/.atlcli/templates/└── runbook.md
# Or under config~/.atlcli/templates/spaces/TEAM/└── team-specific.mdCommands
Section titled “Commands”List Templates
Section titled “List Templates”# List all templatesatlcli wiki template list
# Filter by levelatlcli wiki template list --level globalatlcli wiki template list --profile workatlcli wiki template list --space TEAM
# Filter by tagatlcli wiki template list --tag meeting
# Searchatlcli wiki template list --search retro
# Include overridden templatesatlcli wiki template list --all
# JSON outputatlcli wiki template list --jsonShow Template
Section titled “Show Template”# Show template details and contentatlcli wiki template show meeting-notes
# Show from specific levelatlcli wiki template show standup --profile workCreate Template
Section titled “Create Template”# From fileatlcli wiki template create meeting-notes --file ./template.md
# Open in $EDITORatlcli wiki template create meeting-notes
# Interactive wizardatlcli wiki template create --interactive
# Create at specific levelatlcli wiki template create standup --profile work --file ./standup.mdatlcli wiki template create runbook --space TEAM --file ./runbook.md
# Overwrite existingatlcli wiki template create meeting-notes --file ./updated.md --forceEdit Template
Section titled “Edit Template”# Opens in $EDITORatlcli wiki template edit meeting-notes
# Edit at specific levelatlcli wiki template edit standup --profile workDelete Template
Section titled “Delete Template”# With confirmationatlcli wiki template delete meeting-notes
# Force deleteatlcli wiki template delete meeting-notes --force
# Delete from specific levelatlcli wiki template delete standup --profile work --forceRename Template
Section titled “Rename Template”atlcli wiki template rename old-name new-nameatlcli wiki template rename standup daily-standup --profile workValidate Template
Section titled “Validate Template”# Validate specific templateatlcli wiki template validate meeting-notes
# Validate from fileatlcli wiki template validate --file ./template.md
# Validate all templatesatlcli wiki template validate --allRender Template
Section titled “Render Template”# Render to stdoutatlcli wiki template render meeting-notes --var title="Sprint Planning"
# With multiple variablesatlcli wiki template render meeting-notes \ --var title="Planning" \ --var date=today \ --var type=planning
# Interactive prompts for missing variablesatlcli wiki template render meeting-notes --interactive
# Output to fileatlcli wiki template render meeting-notes --var title="Test" > output.md
# JSON outputatlcli wiki template render meeting-notes --var title="Test" --jsonInit Template from Existing Content
Section titled “Init Template from Existing Content”# From Confluence page IDatlcli wiki template init meeting-template --from 12345
# From page title (requires --from-space)atlcli wiki template init meeting-template --from "Team Meetings" --from-space TEAM
# From local fileatlcli wiki template init meeting-template --from ./docs/meetings.md
# Save to specific levelatlcli wiki template init retro --from 12345 --to-profile workCopy Template
Section titled “Copy Template”# Copy between levelsatlcli wiki template copy meeting-notes --from-level global --to-profile work
# Copy with renameatlcli wiki template copy meeting-notes team-meeting --from-level global --to-space TEAMImport/Export
Section titled “Import/Export”Export Templates
Section titled “Export Templates”# Export all to directoryatlcli wiki template export -o ./my-templates
# Export single template to stdoutatlcli wiki template export meeting-notes
# Export single to fileatlcli wiki template export meeting-notes -o ./meeting-notes.md
# Export from specific levelatlcli wiki template export --profile work -o ./work-templatesExport directory structure:
./my-templates/├── manifest.yml├── global/│ └── meeting-notes.md├── profiles/│ └── work/│ └── standup.md└── spaces/ └── TEAM/ └── runbook.mdImport Templates
Section titled “Import Templates”# From local directoryatlcli wiki template import ./my-templates
# From Git URLatlcli wiki template import https://github.com/user/template-pack
# From tar.gz URLatlcli wiki template import https://example.com/templates.tar.gz
# Flatten to single levelatlcli wiki template import ./templates --to-profile work
# Replace existing (default: skip)atlcli wiki template import ./templates --replace
# Import specific templates onlyatlcli wiki template import ./templates meeting-notes standupUpdate from Remote
Section titled “Update from Remote”# Update all tracked templatesatlcli wiki template update
# Update specific templatesatlcli wiki template update meeting-notes standup
# Update from specific sourceatlcli wiki template update --source https://github.com/user/template-packUsing Templates with Page Create
Section titled “Using Templates with Page Create”# Create page from templateatlcli wiki page create --template meeting-notes \ --var title="Sprint Planning" \ --var date=2025-01-14 \ --space TEAM
# Interactive prompts for variablesatlcli wiki page create --template meeting-notes --space TEAM
# Dry run (preview)atlcli wiki page create --template meeting-notes \ --var title="Test" \ --dry-runHandlebars Syntax
Section titled “Handlebars Syntax”Templates support full Handlebars syntax:
Conditionals
Section titled “Conditionals”{{#if attendees}}**Attendees:** {{attendees}}{{else}}**Attendees:** TBD{{/if}}
{{#unless draft}}This is published content.{{/unless}}{{#each items}}- {{this}}{{/each}}
{{#each tasks}}- [ ] {{this.title}} ({{this.assignee}}){{/each}}With Context
Section titled “With Context”{{#with author}}**Author:** {{name}} ({{email}}){{/with}}Default Values
Section titled “Default Values”{{attendees "TBD"}}- Use built-in variables for dynamic content like dates and user info
- Define required variables in frontmatter to ensure pages are complete
- Use tags to organize templates by category
- Export templates to share with your team or back up
- Track sources with import to enable easy updates
Troubleshooting
Section titled “Troubleshooting”Variable Not Replaced
Section titled “Variable Not Replaced”Symptom: {{variable}} appears literally in output.
Causes:
- Variable name typo
- Variable not passed with
--var - Missing
@prefix for built-in variables
Fix: Check variable names match frontmatter definitions. Use --interactive to see prompts.
Template Not Found
Section titled “Template Not Found”Symptom: Error: Template 'name' not found
Cause: Template doesn’t exist at any storage level.
Fix: List available templates with atlcli wiki template list --all and check the name.
Related Topics
Section titled “Related Topics”- Pages - Create pages from templates with
--templateflag - Macros - Use macros within template content
- Configuration - Template storage paths
Jira and Confluence are trademarks of Atlassian Corporation Plc.
atlcli is not affiliated with, endorsed by, or sponsored by Atlassian.