Skip to main content

Crate prompter

Crate prompter 

Source
Expand description

Prompter: A CLI tool for composing reusable prompt snippets.

This library provides functionality for managing and rendering prompt snippets from a structured library using TOML configuration files. It supports recursive profile dependencies, file deduplication, and customizable output formatting.

Modules§

completions
Shell completion generation with dynamic profile suggestions.

Structs§

Cli
Command-line interface structure for the prompter tool.
Config
Configuration structure holding profile definitions and their dependencies.
TreeNode
Tree node representing a profile or fragment in the dependency tree
TreeOutput
Complete tree structure for JSON output

Enums§

AppMode
Application execution modes after parsing command-line arguments.
Commands
Available subcommands for the prompter CLI.
ResolveError
Errors that can occur during profile resolution.
TreeNodeType
Node type in the dependency tree

Functions§

available_profiles
List available profile names.
init_scaffold
Initialize default configuration and library structure.
list_profiles
List all available profiles to a writer.
parse_args_from
Parse command-line arguments and return the resolved application mode.
parse_config_toml
Parse TOML configuration into a Config structure.
render_to_vec
Render composed profiles to a byte vector.
render_to_writer
Render one or more profiles’ content to a writer.
resolve_app_mode
Resolve a parsed Cli value into the executable AppMode.
resolve_profile
Recursively resolve a profile’s dependencies into a list of file paths.
run_list_stdout
List profiles to stdout.
run_render_stdout
Render one or more profiles to stdout.
run_tree_stdout
Show tree structure to stdout
run_validate_stdout
Validate configuration and output results to stdout.
show_tree
Show tree structure for all profiles
unescape
Unescape special characters in strings.
validate
Validate configuration and library file references.