Hwaro::CLI::Commands::NewCommand
Inherits Reference / Object
Constants
ARCHETYPES_DIR = "archetypes"
DESCRIPTION = "Create a new content file"
FLAGS = [FlagInfo.new(short: "-t", long: "--title", description: "Content title", takes_value: true, value_hint: "TITLE"), FlagInfo.new(short: nil, long: "--date", description: "Content date (default: now, e.g. 2026-03-22)", takes_value: true, value_hint: "DATE"), FlagInfo.new(short: nil, long: "--draft", description: "Mark as draft"), FlagInfo.new(short: nil, long: "--tags", description: "Comma-separated tags", takes_value: true, value_hint: "TAGS"), FlagInfo.new(short: "-s", long: "--section", description: "Section directory (e.g. blog, docs)", takes_value: true, value_hint: "NAME"), FlagInfo.new(short: "-a", long: "--archetype", description: "Archetype to use", takes_value: true, value_hint: "NAME"), FlagInfo.new(short: nil, long: "--bundle", description: "Create a leaf-bundle directory (foo/index.md) instead of a single file"), FlagInfo.new(short: nil, long: "--no-bundle", description: "Create a single file (foo.md); overrides config default"), FlagInfo.new(short: nil, long: "--list-archetypes", description: "List archetypes available in the current project and exit"), FlagInfo.new(short: nil, long: "--json", description: "Emit machine-readable JSON output"), QUIET_FLAG, HELP_FLAG]
Flags defined here are used both for OptionParser and completion generation
NAME = "new"
Single source of truth for command metadata
POSITIONAL_ARGS = ["path"]
POSITIONAL_CHOICES = [] of String
Class methods
metadata
SourceInstance methods
parse_options(args : Array(String)) : Tuple(Config::Options::NewOptions, Bool)
Sourcerun(args : Array(String))
Source