Add CLI install documentation

This commit is contained in:
zhi
2026-03-21 18:44:26 +00:00
parent cc649a7fe2
commit 49b54beace

View File

@@ -39,6 +39,67 @@ go build -ldflags "-X git.hangman-lab.top/zhi/HarborForge.Cli/internal/commands.
./bin/hf version --json
```
## Install
### Local install into a user bin directory
```bash
mkdir -p "$HOME/.local/bin"
go build -o "$HOME/.local/bin/hf" ./cmd/hf
chmod +x "$HOME/.local/bin/hf"
```
Make sure `~/.local/bin` is on `PATH` before invoking `hf` directly.
### OpenClaw profile install target
The planned OpenClaw plugin installer flow will place the binary at:
```text
~/.openclaw/bin/hf
```
Until that installer support lands, the equivalent manual install is:
```bash
mkdir -p "$HOME/.openclaw/bin"
go build -o "$HOME/.openclaw/bin/hf" ./cmd/hf
chmod +x "$HOME/.openclaw/bin/hf"
```
### Config location
`hf` resolves `.hf-config.json` relative to the binary directory, not the current working directory.
Examples:
- if the binary is `~/.local/bin/hf`, config lives at `~/.local/bin/.hf-config.json`
- if the binary is `~/.openclaw/bin/hf`, config lives at `~/.openclaw/bin/.hf-config.json`
This matters when testing multiple copies of the CLI side by side.
### Quick start after install
```bash
hf config --url http://127.0.0.1:8000
hf --help-brief
hf health
```
### Auth modes after install
- **Padded-cell mode** (`pass_mgr` available): run commands directly and let `hf` resolve secrets automatically.
- **Manual mode** (`pass_mgr` unavailable): pass `--token` to authenticated commands.
Examples:
```bash
# padded-cell mode
hf task list
# manual mode
hf task list --token "$HF_TOKEN"
```
## Package Layout
```text