- 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
1.9 KiB
1.9 KiB
HarborForge.Cli
HarborForge.Cli is the Go-based hf binary for HarborForge.
Build
go build -o ./bin/hf ./cmd/hf
To set the version at build time:
go build -ldflags "-X git.hangman-lab.top/zhi/HarborForge.Cli/internal/commands.Version=1.0.0" -o ./bin/hf ./cmd/hf
Run
# Show help
./bin/hf --help
# Show only permitted commands
./bin/hf --help-brief
# Show version
./bin/hf version
# Check API health
./bin/hf health
# Configure API URL
./bin/hf config --url http://your-harborforge:8000
# View current config
./bin/hf config
# JSON output
./bin/hf version --json
Package Layout
cmd/hf/ CLI entrypoint
internal/
client/ HTTP client wrapper for HarborForge API
commands/ Command implementations (version, health, config, auth helpers)
config/ Config file resolution and management (.hf-config.json)
help/ Help and help-brief renderer
mode/ Runtime mode detection (padded-cell vs manual)
output/ Output formatting (human-readable, JSON, tables)
passmgr/ pass_mgr integration for secret resolution
Runtime Modes
- Padded-cell mode: When
pass_mgris available, auth tokens are resolved automatically. Manual--tokenflags are rejected. - Manual mode: When
pass_mgris not available,--tokenmust be provided explicitly to authenticated commands.
Current Status
Implemented:
- Go module and binary entrypoint
- Config file resolution relative to binary directory
- Runtime mode detection (
pass_mgrpresent/absent) - Help and help-brief rendering system
- HTTP client wrapper
- Output formatting (human-readable +
--json) hf version,hf health,hf config- Auth token resolution (padded-cell + manual)
Planned:
- User, role, project, task, milestone, meeting, support, propose, monitor commands
- Permission-aware help rendering