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

# CLI-based deployments

> Learn how to deploy your applications with Valyent CLI.

The Valyent CLI provides a powerful way to deploy and manage your applications directly from your terminal. This guide will walk you through the process of deploying applications using the CLI.

## Installation

First, install the Valyent CLI:

```bash theme={"system"}
curl -L https://cli.valyent.cloud | sh
```

## Authentication

Before deploying applications, authenticate with Valyent:

<Steps>
  <Step title="Get your API key">
    Generate an API key from the [Valyent Console](https://console.valyent.cloud) under API Keys section.
  </Step>

  <Step title="Log in">
    ```bash theme={"system"}
    valyent auth login --api-key <your-api-key>
    ```
  </Step>
</Steps>

## Project Setup

Let's prepare your application for deployment:

<Steps>
  <Step title="Initialize your project">
    Navigate to your project directory and ensure it has a Dockerfile:

    ```bash theme={"system"}
    cd your-project
    ```
  </Step>

  <Step title="Create a Valyent configuration">
    Create a `valyent.yaml` file in your project root:

    ```bash theme={"system"}
    valyent init
    ```
  </Step>
</Steps>

## Deployment Commands

Here are the essential commands for managing your deployments:

### Deploy an Application

```bash theme={"system"}
valyent deploy
```

### Expose your application

To make your application accessible from the internet, create a gateway:

```bash theme={"system"}
valyent gateways create
```

Your application will be accessible at `<gateway_name>.valyent.app`.

## Environment Variables

Manage your application's environment variables:

```bash theme={"system"}
# Set environment variables
valyent env set KEY1=value1 KEY2=value2

# List environment variables
valyent env list
```

## Next Steps

* Set up continuous deployment with [GitHub Actions](./github)
* Explore the [Go SDK](/infrastructure-as-code/go) for programmatic control
* Learn about advanced deployment patterns
* Configure monitoring and alerts

Need help? Join our [Discord community](https://discord.gg/valyent) or check out our [documentation](https://docs.valyent.cloud).
