mirror of
https://gitcode.com/JianFeeeee/homeagent-sdk.git
synced 2026-09-20 17:08:01 +00:00
- Add 'plugindev sdk' subcommand with list/install/use/path/current/latest - Replace runtime.Caller(0) path detection with managed SDK store - SDK stored at ~/.homeagent/plugindev/sdk/<version>/ - Active version tracked via current file - Lazy initialization to avoid blocking other subcommands
45 lines
863 B
Go
45 lines
863 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
func main() {
|
|
if len(os.Args) < 2 {
|
|
help()
|
|
return
|
|
}
|
|
switch os.Args[1] {
|
|
case "init":
|
|
cmdInit(os.Args[2:])
|
|
case "build":
|
|
cmdBuild(os.Args[2:])
|
|
case "clean":
|
|
cmdClean(os.Args[2:])
|
|
case "debug":
|
|
cmdDebug(os.Args[2:])
|
|
case "sdk":
|
|
cmdSDK(os.Args[2:])
|
|
default:
|
|
help()
|
|
}
|
|
}
|
|
|
|
func help() {
|
|
fmt.Print(`HomeAgent Plugin Dev Tool
|
|
|
|
Usage:
|
|
plugindev init <name> Scaffold a new plugin project
|
|
plugindev build [flags] Compile and package plugin
|
|
plugindev clean Clean build/dist artifacts
|
|
plugindev debug [dir] Interpret and debug plugin source
|
|
plugindev sdk <command> Manage SDK versions
|
|
|
|
Flags:
|
|
--outdir Output directory (default: dist)
|
|
--target Target OS/arch (e.g. linux/amd64), repeatable
|
|
--lua Create Lua plugin (for init)
|
|
`)
|
|
}
|