zhi 57af1512d1 feat: implement role, permission, project, milestone, and task command groups
- Add role commands: list, get, create, update, delete, set/add/remove-permissions
- Add permission list command
- Add project commands: list, get, create, update, delete, members, add/remove-member
- Add milestone commands: list, get, create, update, delete, progress
- Add task commands: list, get, create, update, transition, take, delete, search
- Wire all new command groups into main.go dispatcher
- All commands support --json output mode and --token manual auth
- Passes go build and go vet cleanly
2026-03-21 14:50:43 +00:00
2026-03-21 13:34:41 +00:00
2026-03-21 13:34:41 +00:00
2026-03-21 14:37:42 +00:00

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_mgr is available, auth tokens are resolved automatically. Manual --token flags are rejected.
  • Manual mode: When pass_mgr is not available, --token must 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_mgr present/absent)
  • Top-level and group/leaf help rendering system (--help / --help-brief / not permitted stubs)
  • Permission-aware command visibility via /auth/me/permissions when a token is available
  • 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
  • Rich per-command help/usage text beyond the current stub renderer
Description
CLI tools for HarborForge
Readme 208 KiB
Languages
Go 99.7%
Makefile 0.3%