feat: implement core CLI packages and Phase 3 commands
- config: resolve binary dir, load/save .hf-config.json - mode: detect padded-cell vs manual mode via pass_mgr - client: HTTP client wrapper with auth header support - passmgr: pass_mgr integration (get-secret, set, generate) - output: human-readable + JSON output formatting with tables - help: help and help-brief renderer for groups/commands - commands: version, health, config (--url, --acc-mgr-token, show) - auth: token resolution helper (padded-cell auto / manual explicit) - main: command dispatcher with --json global flag support - README: updated with current package layout and status
This commit is contained in:
19
internal/commands/version.go
Normal file
19
internal/commands/version.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"git.hangman-lab.top/zhi/HarborForge.Cli/internal/output"
|
||||
)
|
||||
|
||||
// Version is the CLI version string, set at build time via ldflags.
|
||||
var Version = "dev"
|
||||
|
||||
// RunVersion prints the CLI version.
|
||||
func RunVersion() {
|
||||
if output.JSONMode {
|
||||
output.PrintJSON(map[string]string{"version": Version})
|
||||
} else {
|
||||
fmt.Printf("hf %s\n", Version)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user