Skip to content

Implement render subcommand and internal/render package #3

@mikkeldamsgaard

Description

@mikkeldamsgaard

Summary

Implement the render subcommand and internal/render package for template rendering with environment variable substitution and optional Go templates.

Requirements

  • internal/render package:
    • envsubst mode: replace ${VAR} and $VAR patterns with environment variable values
    • Go text/template mode: full Go template support with env vars as data
    • Mode selection via --mode envsubst|gotemplate (default: envsubst)
  • render subcommand:
    • --template flag: path to template file (required)
    • --output flag: relative output path within workdir (required)
    • --workdir flag: output directory (default /work)
    • Path traversal prevention via internal/safety
    • Create intermediate directories as needed

Acceptance Criteria

  • internal/render/render.go with envsubst and Go template implementations
  • internal/render/render_test.go with tests for: envsubst, Go templates, missing vars, empty input, special characters
  • internal/cmd/render.go with full subcommand implementation
  • internal/cmd/render_test.go with command-level tests
  • Registered in cmd/initium/main.go
  • docs/usage.md updated
  • CHANGELOG.md updated
  • All tests pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions