# CLI overview

hq connects this computer to your AI Team Cloud Computers. Sign in once, then follow sessions in your terminal and forward ports.



`hq` is the command-line companion to HQ. Your AI Team Cloud Computers keep running in HQ; `hq` lets this
computer reach them without copying keys or passwords around.

## What hq does [#what-hq-does]

* **Sign in** with `hq login`. You approve this computer in HQ in your browser, and the login
  renews itself on this device.
* **Attach** to an HQ session with `hq attach`. You follow it live in your own terminal; the
  person who started it is the only one who types.
* **Forward a port** with `hq forward`, so a dev server on the AI Team Cloud Computer answers on
  `localhost` here.
* **Start, stop and restart sessions** with `hq start`, `hq stop` and `hq restart`, and list them
  with `hq sessions`. The same rules as in HQ: the session owner or a team owner operates it.
* **Wake a team** with `hq up`, so a sleeping Cloud Computer is ready before you attach.

To work on a team's files in your editor, use the
[AI Workforce One HQ extension](/docs/vscode/) for VS Code, Cursor, Windsurf or VSCodium.

## Before you start [#before-you-start]

* **Node.js 20 or newer** on this computer.
* **An HQ account** in at least one organization.
* **Developer access on** for your organization. An organization owner turns it on in HQ, under
  Settings, Security, Developer access.
* **Access to the team.** Attaching needs viewer, editor or owner access to the team. Port
  forwarding needs editor or owner access and an active plan. `hq status` shows what each team
  allows you.

## Quick start [#quick-start]

<Steps>
  <Step title="Install">
    ```bash
    npm i -g @aiworkforceoneofficial/hq --ignore-scripts
    ```
  </Step>

  <Step title="Sign in">
    Run `hq login` and approve this computer in the browser window it opens.
  </Step>

  <Step title="See your teams">
    Run `hq status`. Each team has an `hq-…` name you use in every other command.
  </Step>

  <Step title="Connect">
    Attach to a session with `hq attach`, or forward a port with `hq forward`.
  </Step>
</Steps>

## Next [#next]

<Cards>
  <Card title="Install" href="/docs/cli/install/">
    Requirements, updating, and removing hq.
  </Card>

  <Card title="Sign in" href="/docs/cli/sign-in/">
    The device approval, and where the login is kept.
  </Card>

  <Card title="CLI reference" href="/docs/cli/reference/">
    Every command, flag and exit code.
  </Card>
</Cards>
