> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mirage.strukto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# hf

> Set up the Hugging Face CLI with Python or TypeScript.

Create a token in [HF Models setup](/home/setup/hf_models), then register it on
an existing `ws`. Commands: [Python](/python/cli/hf) ·
[TypeScript](/typescript/cli/hf).

<Tabs>
  <Tab title="Python" icon="https://mintcdn.com/struktoai/F9Lv_nTaj6By6crk/images/python-logo.svg?fit=max&auto=format&n=F9Lv_nTaj6By6crk&q=85&s=cf5b268d330f7db46ea5cf6083f309a1" width="110" height="110" data-path="images/python-logo.svg">
    ```python theme={null}
    from mirage.commands.cli.builtin.hf import HF

    ws.register_cli("hf", HF, {"token": "hf_..."})
    ```
  </Tab>

  <Tab title="TypeScript" icon="https://mintcdn.com/struktoai/F9Lv_nTaj6By6crk/images/typescript-logo.svg?fit=max&auto=format&n=F9Lv_nTaj6By6crk&q=85&s=63a620cb702b16103c53ea361a17504a" width="512" height="512" data-path="images/typescript-logo.svg">
    ```typescript theme={null}
    import { HF } from '@struktoai/mirage-node'

    ws.registerCli('hf', HF, { token: 'hf_...' })
    ```
  </Tab>
</Tabs>

A Hub mount reads; `hf` writes. Editing a Hub file is download into a local
mount, edit it there, then upload, because a Hub write is a commit and the
filesystem has no way to say where one ends.
