Skip to content

harn files

harn files url <path> [--port 4276] [--coord-root <dir>] [--raw | --viewer] [--no-verify]

Mint the browser URL for an existing file under the dashboard’s coord root:

4276/harnery-dev/docs/codec-cards.html
harn files url harnery-dev/docs/codec-cards.html
harn files url docs/notes.md
# http://localhost:4276/files?path=docs%2Fnotes.md

The command sends .html and .htm files to the isolated files origin. The browser runs those files as pages, so their scripts and relative assets work. Other extensions go to the dashboard file viewer. Use --raw or --viewer to override that choice.

url accepts a repo-relative path or an absolute path inside the coord root. It resolves symlinks, refuses directories and files outside the root, and prints one URL to stdout. Before printing, it verifies that the dashboard on the selected port serves the same canonical repository root. If the dashboard is stopped, lacks the identity endpoint, or serves another repository, the command reports the cause and leaves stdout empty.

The check compares opaque SHA-256 digests; the dashboard does not return its absolute filesystem path. Use --no-verify only when you intentionally need to construct a URL while the dashboard is unavailable. The command does not start the dashboard or bypass the file server’s deny rules. The dashboard must already be running for the printed URL to work.

Port resolution matches harn web up: --port, then HARNERY_WEB_PORT, then .harnery/config.jsonc web.port, then 4276. Pass --coord-root when the file belongs to a different project.

Use localhost links only when the operator can reach the same machine. A host project may have a publish or sharing workflow for remote operators.