Hwaro::CLI::Commands::ServeCommand
Inherits Reference / Object
Constants
DESCRIPTION = "Serve the project and watch for changes"
FLAGS = [INPUT_DIR_FLAG, BASE_URL_FLAG, ENV_FLAG, DRAFTS_FLAG, INCLUDE_EXPIRED_FLAG, INCLUDE_FUTURE_FLAG, MINIFY_FLAG, JOBS_FLAG, FlagInfo.new(short: nil, long: "--cache", description: "Enable build caching (skip unchanged files)"), FlagInfo.new(short: nil, long: "--stream", description: "Enable streaming build to reduce memory usage"), FlagInfo.new(short: nil, long: "--memory-limit", description: "Memory limit for streaming build (e.g. 2G, 512M)", takes_value: true, value_hint: "SIZE"), FlagInfo.new(short: nil, long: "--fast-start", description: "Render homepage + latest N pages first, then background-render the rest"), FlagInfo.new(short: nil, long: "--fast-start-count", description: "Number of recent pages to render up front with --fast-start (default: 20)", takes_value: true, value_hint: "N"), FlagInfo.new(short: "-b", long: "--bind", description: "Bind address (default: 127.0.0.1)", takes_value: true, value_hint: "HOST"), FlagInfo.new(short: "-p", long: "--port", description: "Port to listen on (default: 3000)", takes_value: true, value_hint: "PORT"), OPEN_BROWSER_FLAG, NO_OPEN_BROWSER_FLAG, FlagInfo.new(short: nil, long: "--access-log", description: "Show HTTP access log (e.g. GET requests)"), FlagInfo.new(short: nil, long: "--no-error-overlay", description: "Disable error overlay in browser"), FlagInfo.new(short: nil, long: "--live-reload", description: "Enable live reload on file changes (default: enabled)"), FlagInfo.new(short: nil, long: "--no-live-reload", description: "Disable live reload on file changes"), FlagInfo.new(short: nil, long: "--header", description: "Add custom response header (repeatable, e.g. --header 'X-Frame-Options: SAMEORIGIN')", takes_value: true, value_hint: "NAME: VALUE"), SKIP_OG_IMAGE_FLAG, SKIP_IMAGE_PROCESSING_FLAG, SKIP_CACHE_BUSTING_FLAG, FlagInfo.new(short: nil, long: "--fast", description: "Fast dev mode: equivalent to --skip-og-image --skip-image-processing (great with -q)"), VERBOSE_FLAG, QUIET_FLAG, PROFILE_FLAG, DEBUG_FLAG, JSON_FLAG, HELP_FLAG]
Flags defined here are used both for OptionParser and completion generation
NAME = "serve"
Single source of truth for command metadata
POSITIONAL_ARGS = [] of String
POSITIONAL_CHOICES = [] of String
Class methods
metadata
SourceInstance methods
run(args : Array(String))
Source