feat: scaffold Go-based hf CLI
This commit is contained in:
11
.gitignore
vendored
11
.gitignore
vendored
@@ -1,6 +1,7 @@
|
|||||||
dist/
|
|
||||||
bin/
|
bin/
|
||||||
node_modules/
|
dist/
|
||||||
*.log
|
coverage.out
|
||||||
.env
|
*.test
|
||||||
.env.*
|
*.exe
|
||||||
|
*.out
|
||||||
|
vendor/
|
||||||
|
|||||||
40
README.md
40
README.md
@@ -1,6 +1,40 @@
|
|||||||
# HarborForge.Cli
|
# 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.
|
## Current status
|
||||||
Future commands and packaging can be added here.
|
|
||||||
|
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
24
cmd/hf/main.go
Normal 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
3
go.mod
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
module git.hangman-lab.top/zhi/HarborForge.Cli
|
||||||
|
|
||||||
|
go 1.22
|
||||||
0
internal/client/.gitkeep
Normal file
0
internal/client/.gitkeep
Normal file
3
internal/client/doc.go
Normal file
3
internal/client/doc.go
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
package client
|
||||||
|
|
||||||
|
// Package client will host HarborForge HTTP client helpers.
|
||||||
0
internal/commands/.gitkeep
Normal file
0
internal/commands/.gitkeep
Normal file
3
internal/commands/doc.go
Normal file
3
internal/commands/doc.go
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
package commands
|
||||||
|
|
||||||
|
// Package commands will define the hf command tree.
|
||||||
0
internal/config/.gitkeep
Normal file
0
internal/config/.gitkeep
Normal file
3
internal/config/doc.go
Normal file
3
internal/config/doc.go
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
// Package config will resolve and manage .hf-config.json.
|
||||||
0
internal/help/.gitkeep
Normal file
0
internal/help/.gitkeep
Normal file
3
internal/help/doc.go
Normal file
3
internal/help/doc.go
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
package help
|
||||||
|
|
||||||
|
// Package help will render help and help-brief output.
|
||||||
0
internal/mode/.gitkeep
Normal file
0
internal/mode/.gitkeep
Normal file
3
internal/mode/doc.go
Normal file
3
internal/mode/doc.go
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
package mode
|
||||||
|
|
||||||
|
// Package mode will detect padded-cell/manual runtime behavior.
|
||||||
0
internal/passmgr/.gitkeep
Normal file
0
internal/passmgr/.gitkeep
Normal file
3
internal/passmgr/doc.go
Normal file
3
internal/passmgr/doc.go
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
package passmgr
|
||||||
|
|
||||||
|
// Package passmgr will integrate with pass_mgr when available.
|
||||||
Reference in New Issue
Block a user