Skip to content

template

The template command provides comprehensive template management functionality for kasl, enabling users to create, edit, remove, and search reusable task templates. Templates streamline the creation of frequently used tasks by providing predefined values for name, comment, and completion status.

Terminal window
kasl template [COMMAND]
Terminal window
kasl template add [OPTIONS]

Options:

  • -n, --name <NAME>: Unique name identifier for the template
    • Must be unique across all templates
    • Should be descriptive enough to easily identify the template’s purpose
    • Used for referencing the template in task creation commands

Examples:

Terminal window
# Add template interactively
kasl template add
# Add template with name
kasl template add --name "daily-standup"
Terminal window
kasl template list

Displays a formatted table of all existing templates with their names, task names, comments, and default completion values.

Example:

Terminal window
kasl template list

show - Show a single template’s contents

Section titled “show - Show a single template’s contents”
Terminal window
kasl template show [NAME]

Arguments:

  • NAME: Name of the template to show (optional)

Displays the task name, comment, and default completeness stored in the template, so its effect on task creation is visible before use.

Example:

Terminal window
kasl template show "daily-standup"
Terminal window
kasl template edit [NAME]

Arguments:

  • NAME: Name of the template to edit (optional)
    • If not provided, an interactive selection interface will be presented

Examples:

Terminal window
# Edit template interactively
kasl template edit
# Edit specific template
kasl template edit "daily-standup"
Terminal window
kasl template remove [OPTIONS] [NAME]

Arguments:

  • NAME: Name of the template to remove (optional)
    • If not provided, an interactive selection interface will be presented

Options:

  • -y, --yes: Remove without asking for confirmation

Examples:

Terminal window
# Remove template with confirmation
kasl template remove "old-template"
# Remove without confirmation
kasl template remove "old-template" -y
Terminal window
kasl template search <QUERY>

Arguments:

  • QUERY: Search query string
    • Searches both template names and task names for matches
    • Case-insensitive partial matching is supported

Examples:

Terminal window
# Search for templates containing "meeting"
kasl template search "meeting"
# Search for templates containing "daily"
kasl template search "daily"
  • Add: Define new templates with predefined task values
  • Read: List and view existing templates
  • Update: Modify template properties
  • Remove: Remove templates from the system

Find templates by name or content:

  • Name Search: Find templates by template name
  • Content Search: Find templates by task name or comment
  • Partial Matching: Case-insensitive search with partial matches

User-friendly interfaces for all operations:

  • Interactive Creation: Guided template creation process
  • Interactive Selection: Choose from available templates
  • Confirmation Prompts: Prevent accidental removal

Seamless integration with task creation workflows:

Terminal window
# Use template when creating task
kasl task add --from-template
# Use specific template
kasl task add --template "daily-standup"
Terminal window
# Create daily standup template
kasl template add --name "daily-standup"
# Template: Task name: "Daily standup", Comment: "Team sync meeting", Completeness: 0
# Create daily planning template
kasl template add --name "daily-planning"
# Template: Task name: "Plan day", Comment: "Review and plan daily tasks", Completeness: 0
Terminal window
# Create client meeting template
kasl template add --name "client-meeting"
# Template: Task name: "Client meeting", Comment: "Discuss project requirements", Completeness: 0
# Create team meeting template
kasl template add --name "team-meeting"
# Template: Task name: "Team meeting", Comment: "Weekly team sync", Completeness: 0
Terminal window
# Create code review template
kasl template add --name "code-review"
# Template: Task name: "Code review", Comment: "Review pull request", Completeness: 0
# Create bug fix template
kasl template add --name "bug-fix"
# Template: Task name: "Fix bug", Comment: "Investigate and fix reported issue", Completeness: 0
Terminal window
# Create documentation template
kasl template add --name "documentation"
# Template: Task name: "Update documentation", Comment: "Update project documentation", Completeness: 0
# Create email template
kasl template add --name "email"
# Template: Task name: "Email correspondence", Comment: "Respond to emails", Completeness: 0
Terminal window
# 1. Create templates for common tasks
kasl template add --name "daily-standup"
kasl template add --name "code-review"
kasl template add --name "client-meeting"
# 2. List all templates
kasl template list
# 3. Use templates to create tasks
kasl task add --from-template
# Select from available templates
# 4. Use specific template
kasl task add --template "daily-standup"
Terminal window
# Create comprehensive template library
kasl template add --name "morning-routine"
kasl template add --name "afternoon-review"
kasl template add --name "end-of-day"
kasl template add --name "weekly-planning"
# Edit template properties
kasl template edit "morning-routine"
# Search for specific templates
kasl template search "meeting"
# Remove unused templates
kasl template remove "old-template"
Terminal window
# Interactive template creation
kasl template add
# Prompts for template name, task name, comment, and completeness
# Interactive template selection
kasl template edit
# Shows list of available templates to choose from
# Interactive template removal
kasl template remove
# Shows list and prompts for confirmation
+---------------+---------------+---------------------+-------------+
| TEMPLATE NAME | TASK NAME | COMMENT | COMPLETENESS|
+---------------+---------------+---------------------+-------------+
| daily-standup | Daily standup | Team sync meeting | 0% |
| code-review | Code review | Review PR | 0% |
| client-meeting| Client meeting| Discuss requirements| 0% |
| bug-fix | Fix bug | Investigate and fix | 0% |
| documentation | Update docs | Update documentation| 0% |
+---------------+---------------+---------------------+-------------+
Creating new template...
Template name: daily-standup
Task name: Daily standup
Comment: Team sync meeting
Default completeness (0-100): 0
✅ Template 'daily-standup' created successfully!
Searching for templates containing "meeting"...
Results:
├── client-meeting: Client meeting - Discuss requirements
├── team-meeting: Team meeting - Weekly team sync
└── daily-standup: Daily standup - Team sync meeting
Found 3 matching templates.
Editing template 'daily-standup'
Current properties:
├── Task name: Daily standup
├── Comment: Team sync meeting
└── Completeness: 0%
New task name (press Enter to keep current): Daily standup meeting
New comment (press Enter to keep current): Daily team standup meeting
New completeness (press Enter to keep current): 0
✅ Template updated successfully!
Terminal window
# Create task using template selection
kasl task add --from-template
# The command will show available templates:
# 1. daily-standup
# 2. code-review
# 3. client-meeting
# Select template: 1
Terminal window
# Use specific template
kasl task add --template "daily-standup"
# Use template with additional options
kasl task add --template "code-review" --tags "urgent,backend"
Terminal window
# Use template but override task name
kasl task add --template "bug-fix" --name "Fix login bug"
# Use template but add custom comment
kasl task add --template "client-meeting" --comment "Discuss new feature requirements"
  1. Use descriptive names: “daily-standup” instead of “ds”
  2. Be consistent: Use the same naming convention
  3. Keep it simple: Avoid overly complex template names
  4. Use lowercase: For consistency and easier typing
  1. Generic task names: Allow for customization when used
  2. Clear comments: Provide helpful default descriptions
  3. Appropriate completeness: Usually 0% for new tasks
  4. Reusable structure: Make templates flexible for different contexts
  1. Group related templates: Use consistent naming patterns
  2. Regular cleanup: Remove unused templates
  3. Document template purposes: Keep track of when to use each template
  4. Review and update: Keep templates current with your workflow
  1. Use templates frequently: For any recurring task type
  2. Customize when needed: Override template values when appropriate
  3. Combine with tags: Use templates with tags for better organization
  4. Review effectiveness: Update templates based on usage patterns

The template command works with other kasl commands:

  • task: Use templates to create tasks quickly
  • tag: Combine templates with tags for better organization
  • report: View tasks created from templates in reports
  • export: Export template data for backup or sharing

Template name already exists

Terminal window
# Check existing templates
kasl template list
# Use different name or edit existing template
kasl template edit "existing-template"

Template not found

Terminal window
# List all templates to see available options
kasl template list
# Search for similar templates
kasl template search "partial-name"

Template not working with task creation

Terminal window
# Verify template exists
kasl template list
# Check template name spelling
kasl template search "template-name"
Terminal window
# Export templates before deletion
kasl export --format json
# Review template usage before deletion
kasl template list
  • task - Create tasks using templates
  • tag - Combine templates with tags
  • report - View tasks created from templates
  • export - Export template data