feat: scaffold Go-based hf CLI

This commit is contained in:
zhi
2026-03-21 13:34:41 +00:00
parent ddaea1c15b
commit cb0b7669b3
16 changed files with 88 additions and 8 deletions

11
.gitignore vendored
View File

@@ -1,6 +1,7 @@
dist/
bin/
node_modules/
*.log
.env
.env.*
dist/
coverage.out
*.test
*.exe
*.out
vendor/

View File

@@ -1,6 +1,40 @@
# HarborForge.Cli
CLI tools for HarborForge.
`HarborForge.Cli` is the home of the new Go-based `hf` binary for HarborForge.
This repository is intentionally initialized with a minimal scaffold.
Future commands and packaging can be added here.
## Current status
This repository now contains the initial Go scaffold required by the cross-project plan:
- Go module initialization
- binary entrypoint at `cmd/hf/main.go`
- placeholder internal package layout for future implementation
- basic build instructions
## Build
```bash
go build -o ./bin/hf ./cmd/hf
```
## Run
```bash
go run ./cmd/hf --help
go run ./cmd/hf version
```
## Planned package layout
```text
cmd/hf/
internal/
client/
commands/
config/
help/
mode/
passmgr/
```
The scaffold is intentionally minimal so follow-up work can implement config loading, mode detection, help rendering, auth, and API command groups incrementally.

24
cmd/hf/main.go Normal file
View File

@@ -0,0 +1,24 @@
package main
import (
"fmt"
"os"
)
func main() {
if len(os.Args) > 1 {
switch os.Args[1] {
case "--help", "-h":
fmt.Println("hf - HarborForge CLI")
fmt.Println()
fmt.Println("This is the initial Go scaffold for the HarborForge CLI.")
fmt.Println("More command groups will be added in follow-up tasks.")
return
case "version":
fmt.Println("hf dev")
return
}
}
fmt.Println("hf - HarborForge CLI scaffold")
}

3
go.mod Normal file
View File

@@ -0,0 +1,3 @@
module git.hangman-lab.top/zhi/HarborForge.Cli
go 1.22

0
internal/client/.gitkeep Normal file
View File

3
internal/client/doc.go Normal file
View File

@@ -0,0 +1,3 @@
package client
// Package client will host HarborForge HTTP client helpers.

View File

3
internal/commands/doc.go Normal file
View File

@@ -0,0 +1,3 @@
package commands
// Package commands will define the hf command tree.

0
internal/config/.gitkeep Normal file
View File

3
internal/config/doc.go Normal file
View File

@@ -0,0 +1,3 @@
package config
// Package config will resolve and manage .hf-config.json.

0
internal/help/.gitkeep Normal file
View File

3
internal/help/doc.go Normal file
View File

@@ -0,0 +1,3 @@
package help
// Package help will render help and help-brief output.

0
internal/mode/.gitkeep Normal file
View File

3
internal/mode/doc.go Normal file
View File

@@ -0,0 +1,3 @@
package mode
// Package mode will detect padded-cell/manual runtime behavior.

View File

3
internal/passmgr/doc.go Normal file
View File

@@ -0,0 +1,3 @@
package passmgr
// Package passmgr will integrate with pass_mgr when available.