Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A powerful text templating tool.

License

NotificationsYou must be signed in to change notification settings

cchexcode/complate

Repository files navigation

complate is a general purpose text templating CLI program that supports interactive mode, prompting the user for values via TUI behaviour and headless mode for use in automation such as CI pipelines.

Installation

  • The rusty way:
    cargo install complate
  • The manual way:
    Download and install from the GitHub releases.

Config example

version: 0.15templates:  zero:    content:      inline: |-        {{ a.alpha }}        {{ b.bravo }}    variables:      a.alpha:        static: alpha      b.bravo: arg  one:    content:      file: ./.complate/templates/arbitraty-template-file.tpl    variables:      a.pwd:        env: "PWD"  two:    content:      inline: |-        {{ a.alpha }}        {{ b.bravo }}        {{ c.charlie }}        {{ d.delta }}        {{ e.echo }}    variables:      a.alpha:        prompt: "alpha"      b.bravo:        shell: "printf bravo"      c.charlie:        static: "charlie"      d.delta:        select:          text: Select the version level that shall be incremented          options:            alpha:              display: alpha              value:                static: alpha            bravo:              display: bravo              value:                shell: printf bravo      e.echo:        check:          text: Select the components that are affected          separator: ", "          options:            alpha:              display: alpha              value:                static: alpha            bravo:              display: bravo              value:                shell: printf bravo      f.foxtrot:        env: "FOXTROT"  three:    content:      inline: |-        {{ test }}        {{ _decode "dGVzdA==" }}    helpers:      "_decode": printf "$(printf $VALUE | base64 -D)"    variables:      test:        static: "test"
KeyBehaviourInput
argExpects input as argument via command line inputNone
envRetrieves value from the specified env varNone
staticSimply replaces the variable with a static valueNone
promptAsks the user for text input (can be empty)The prompt
shellInvokes a shell command to resolve the variable (read fromSTDOUT)None
selectAsks the user to select one item from a listtext: string (context),options: list (available options to select from)
checkAsks the user to select0..n item(s) from a list (multiselect)text: string (context),options: list of options {display: str, value: str} (the available options to select from)

Since theshell value provider is able to run arbitrary shell commands, it is only allowed if and only if theSHELL_TRUST argument is explicitly set. See therender command reference for possible values for this setting. Ifnot set, the provider will throw an unrecoverable error and the program will abort.

Command reference

Disclaimer

All features that are marked asexperimental arenot considered a public API and therefore eplicitly not covered by the backwards-compatibility policy inside a major version (seehttps://semver.org[semver v2]). Use these features on your own risk!

About

A powerful text templating tool.

Topics

Resources

License

Stars

Watchers

Forks

Contributors2

  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp