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

# Install Gobi CLI

> Get Gobi CLI installed and configured for command-line AI coding assistance and automation

<iframe width="100%" height="400" src="https://www.youtube.com/embed/vm9RcP9xM4o" title="Install Gobi CLI" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen />

<Info>
  Make sure you have [Node.js 18 or higher
  installed](https://nodejs.org/en/download/).
</Info>

## Installation

Install Gobi CLI globally using npm:

```bash theme={null}
npm i -g @gourmanddev/cli
```

## Two Ways to Use Gobi CLI

<Info>
  **Quick Overview**: Gobi CLI works in two modes - TUI for interactive
  conversations or headless for automated commands.
</Info>

<Tabs>
  <Tab title="TUI Mode">
    **Interactive development sessions**

    Start a conversation with AI in your terminal:

    ```bash theme={null}
    cn
    > @src/app.js Generate unit tests for this component
    ```

    Perfect for exploration, debugging, and iterative development.
  </Tab>

  <Tab title="Headless Mode">
    **Automation and scripting**

    Single commands that return results:

    ```bash theme={null}
    cn -p "Generate a commit message for current changes"
    cn -p "Review the last 5 commits for issues"
    ```

    Perfect for CI/CD, git hooks, and automated workflows.
  </Tab>
</Tabs>

## Setup

<Tabs>
  <Tab title="cn TUI Mode">
    For interactive development and exploration:

    <Steps>
      <Step title="Login to Gobi CLI">
        ```bash theme={null}
        cn login
        ```

        This will open your browser to authenticate with Gobi Hub.
      </Step>

      <Step title="Test TUI Mode">
        Start an interactive session:

        ```bash theme={null}
        cn
        ```

        Try asking a question:

        ```
        > Tell me about the CLI
        ```
      </Step>
    </Steps>
  </Tab>

  <Tab title="cn Headless Mode">
    For automation workflows and scripting:

    <Steps>
      <Step title="Get API Key for Automation">
        For automation workflows, get an API key:

        1. Visit [Gobi Hub API Keys](https://hub.gourmand.dev/settings/api-keys)
        2. Click **"+ New API Key"**
        3. Copy the API key immediately (you won't see it again!)
        4. Login using your Gobi account
      </Step>

      <Step title="Add Secrets for Workflows">
        Store secure credentials for CLI workflows:

        1. Visit [Gobi Hub Secrets](https://hub.gourmand.dev/settings/secrets)
        2. Add your API keys and sensitive data
        3. Reference in configurations with `${{ secrets.SECRET_NAME }}`
      </Step>

      <Step title="Test Headless Mode">
        Try headless mode for automation:

        ```bash theme={null}
        cn -p "Generate a conventional commit message for the current git changes"
        ```
      </Step>
    </Steps>
  </Tab>
</Tabs>

## What's Next?

<CardGroup cols={2}>
  <Card title="Quick Start Guide" icon="rocket" href="/cli/quick-start">
    Learn basic usage with practical examples
  </Card>

  <Card title="Create your first workflow" icon="gear" href="/guides/posthog-github-continuous-ai">
    Build automated workflows with Gobi CLI
  </Card>
</CardGroup>

## Getting Help

If you encounter issues:

* Ask for help in [our discussions](https://github.com/gourmand/gobi/discussions)
* Report bugs on [GitHub](https://github.com/gourmand/gobi)
