Add Go CLI with container expansion parser and development server

- Implement Go-based CLI for build-time HTML enhancement
- Add container expansion: div.insertr auto-expands to viable children
- Create servedev command with live development workflow
- Add Air configuration for automatic rebuilds and serving
- Enable transition from runtime JS to build-time enhancement approach
This commit is contained in:
2025-09-02 22:58:59 +02:00
parent afd4879cef
commit 0e84af98bc
13 changed files with 1429 additions and 1 deletions

31
insertr-cli/cmd/root.go Normal file
View File

@@ -0,0 +1,31 @@
package cmd
import (
"fmt"
"os"
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{
Use: "insertr",
Short: "Insertr CLI - HTML enhancement for static sites",
Long: `Insertr CLI adds editing capabilities to static HTML sites by detecting
editable elements and injecting content management functionality.
The tool parses HTML files, finds elements with the 'insertr' class,
and enhances them with editing capabilities while preserving
static site performance.`,
Version: "0.0.1",
}
func Execute() {
if err := rootCmd.Execute(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}
func init() {
rootCmd.AddCommand(parseCmd)
}