From 103e84d847262830bbaa550b37218e9ca8b317d3 Mon Sep 17 00:00:00 2001 From: Himanshu Sardana Date: Thu, 26 Mar 2026 21:26:35 +0000 Subject: refactor: split into cmd, pkg --- cmd/root.go | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 cmd/root.go (limited to 'cmd/root.go') diff --git a/cmd/root.go b/cmd/root.go new file mode 100644 index 0000000..79bb257 --- /dev/null +++ b/cmd/root.go @@ -0,0 +1,58 @@ +package cmd + +import ( + "fmt" + "os" + + "github.com/HimanshuSardana/kite/internal/build" +) + +const ( + DefaultTheme = "modern-light" + DefaultPort = "8000" +) + +func Execute() { + args := os.Args + if len(args) < 2 { + build.ShowHelpMessage() + return + } + + switch args[1] { + case "build": + runBuild(args) + case "serve": + runServe(args) + case "list-themes": + runListThemes(args) + default: + build.ShowHelpMessage() + } +} + +func ShowHelp() { + fmt.Println(` +Kite — A lightweight static site generator + +USAGE: + kite [options] + +COMMANDS: + build Build the static site into the output directory + serve Start a local development server with live reload + list-themes List all available themes + +OPTIONS: + -h, --help Show this help message + +EXAMPLES: + kite build + kite build gruvbox + kite serve + kite list-themes + +DESCRIPTION: + Kite converts your content into a static website using themes and templates. +`) +} -- cgit v1.3.1