# Welcome

## What is Retrodeep?

Retrodeep is a robust, cutting-edge platform, ideal for deploying a diverse range of services such as web applications, APIs, and SPAs with ease and reliability. Deploy with confidence and scale effortlessly allowing you to go from local to global in seconds.

####

{% content-ref url="/pages/urfyFx5qJcbeNUjnFO1C" %}
[Retrodeep CLI](/retrodeep-cli)
{% endcontent-ref %}


# Retrodeep CLI

Learn more about the Retrodeep CLI

The Retrodeep CLI allows you to interact with Retrodeep directly from your terminal. The retrodeep command can be used to do a wide array of functions and can be used from either the dir of the project or by providing a dir path.

### What can it do?

The Retrodeep CLI can be used to:

* **Deploy Applications:** Quickly deploy your projects directly from your local directories or via repository links with minimal setup.
* **Streamline Development:** Use the `dev` command to run your projects locally, simplifying testing and debugging before deployment.
* **View Logs:** Easily access detailed logs for your deployments to monitor their performance and troubleshoot issues in real-time.
* **Manage Projects:** Create, list, and delete your projects within Retrodeep. This includes viewing all deployments linked to a specific project.
* **Control Deployments:** Manage and remove deployments directly from the CLI, giving you full control over your live applications.
* **Authenticate Seamlessly:** Securely log in and out of your Retrodeep account using GitHub OAuth for a streamlined authentication process.
* **Interactive Help:** Access detailed command descriptions and usage guidelines directly through the CLI to help you navigate and utilize its full potential.


# Install Retrodeep

Retrodeep install instructions

## Homebrew

You can install the CLI using [Homebrew](http://brew.sh/) by running:

<pre class="language-sh"><code class="lang-sh"><strong>brew tap retrodeep-io/homebrew-retrodeep-cli
</strong><strong>brew install retrodeep-cli
</strong></code></pre>

To upgrade an existing installation of the Retrodeep CLI, run:

```sh
brew upgrade retrodeep-cli
```

## Shell (Mac, Linux)

For a more streamlined installation of the Retrodeep CLI, you can utilize the provided install script. This method places the retrodeep binary conveniently in the \~/.retrodeep folder within your home directory.

{% code overflow="wrap" %}

```sh
curl https://get.retrodeep.com -fsSL | bash
```

{% endcode %}

## Checking the version

The `--version` option can be used to verify the version of Retrodeep CLI currently being used.

```bash
retrodeep --version
```


# Authentication

Sign in to Retrodeep CLI

### Overview

To streamline your experience with RetroDeep CLI, we've implemented a simple authentication process that integrates directly with GitHub. This section will guide you through logging into your RetroDeep account using the `retrodeep login` command.\
\
To authenticate with the RetroDeep CLI, simply run the following command in your terminal:

```bash
retrodeep login
```

Executing this command initiates the authentication process via GitHub OAuth, the current sole method of authentication for RetroDeep. Once you enter the command, your default web browser will open and prompt you to authorize the RetroDeep CLI to access your GitHub account.

### Authentication Methods

As of now, RetroDeep supports the following authentication method:

* **GitHub OAuth**: Securely log in with your GitHub account to start using RetroDeep services.

We are working on adding more authentication options to provide you with a flexible and convenient way to log in. Stay tuned for updates on additional authentication methods.

### Confirm login and Identity

The `retrodeep whoami` command is a quick and easy way to confirm the identity of the user currently logged into the RetroDeep CLI. This command is particularly useful in environments where multiple users might access the same development system or when you need to verify that the correct GitHub OAuth credentials are being used.

```bash
retrodeep whoami
```

When executed, this command displays the username of the user currently authenticated. This helps in ensuring that operations performed via the CLI are attributed to the correct user account, which is crucial for teams with multiple developers or for those who manage multiple RetroDeep accounts.

By integrating the `retrodeep whoami` command into your regular workflow, you maintain greater control and visibility over who is executing commands and managing projects within the RetroDeep ecosystem.

### Logging Out

When you're done with your work, or if you need to switch accounts, logging out is just as straightforward using `retrodeep logout`.

To authenticate with the RetroDeep CLI, simply run the following command in your terminal:

```bash
retrodeep logout
```

In case you need assistance with the login or logout process, you can always invoke the help command for more detailed instructions:

```bash
retrodeep login help
```


# Version

The `retrodeep help` command provides a comprehensive list of all the available RetroDeep CLI commands directly in your terminal.&#x20;

Here's an example of using these help features:

```bash
retrodeep help
```

Pairing it with a second argument - a specific RetroDeep CLI command - you'll receive detailed instructions and information about that particular command.

For convenience, appending the `--help` global option to any RetroDeep CLI command will offer immediate guidance and insights about the usage of the command.

```bash
retrodeep help [command]
```

To get more detailed help about a specific command, such as `deploy`, you would use:

```bash
retrodeep help deploy
```

Or, alternatively:

```bash
retrodeep deploy --help
```

These commands ensure that you have quick access to all the information you need to make the most out of the RetroDeep CLI, facilitating a smoother development workflow.


# Deploy

The `retrodeep` command provides an efficient way to deploy your projects. Whether you're deploying from a local machine or a version control repository.

The `retrodeep deploy` command facilitates the deployment of your projects directly from the terminal. You can choose to deploy from your local directory or directly from a repository.

To quickly deploy your project, you can use the `retrodeep` command:

```bash
retrodeep
```

Upon running this command, you will be presented with prompts to choose between deploying from your GitHub repository or local machine. Follow the subsequent prompts to specify the project details and configurations for deployment.

### Deploying from a Local Directory

For direct deployment from a local directory, you can specify the path to your project:

```bash
retrodeep deploy [project-path]
```

To deploy a project from the current directory, you can use:

```bash
retrodeep deploy .
```


# Dev

The `retrodeep dev` command spins up a local development server, allowing you to test and develop your project in an environment similar to Retrodeep's production servers.

## Usage

To start the development server for your project, you can run:

```bash
retrodeep dev
```

This command will serve the current directory on a local server. If you need to serve a different directory or specify a port, you can use the additional flags provided.

#### Specifying a Custom Directory

To start a development server with a custom directory path:

```bash
retrodeep dev --dir /path/to/your/project
```

#### Specifying a Custom Port

By default, `retrodeep dev` serves your application on port `3000`. To specify a different port, use the `-p` or `--port` option:

```bash
retrodeep dev --port 5000
```

This will start the development server on port `5000`.

### Interactive Development

While the `retrodeep dev` server is running, any changes made to your project files will automatically be reloaded in the development server, providing a real-time development experience.

### Available Options

* `-p, --port <port>` - Specify a custom port to listen on.
* `-d, --dir <dir_path>` - Specify a custom directory path for the server to serve.
* `-h, --help` - Display help information for the `dev` command.


# Projects

A **project** in RetroDeep represents a specific application or a service that you are developing under which all related deployments are grouped. Each project can have multiple environments or versions deployed at different stages of development, such as testing, staging, and production.

The `retrodeep projects` command is your hub for managing all your RetroDeep projects from the terminal.

## Usage

To list all projects associated with your RetroDeep account:

```bash
retrodeep projects
```

This command fetches and displays a list of all your projects, making it easy to keep track of what you have deployed or are working on.

## Deleting a Project

To delete a project, use the `retrodeep rm` command with the project's name or ID:

```bash
retrodeep rm [Project Name] 
```

{% hint style="danger" %}
Using`retrodeep rm`with a project name, the entire project and all its deployment will be removed.
{% endhint %}

## Additional Help

For more detailed instructions or help with specific commands, you can use the help option:

```bash
retrodeep help projects
```

This command will provide a detailed guide and usage instructions right in your terminal.


# Logs

Viewing Logs with RetroDeep CLI

The `retrodeep logs` command enables you to easily access and monitor the logs of your deployments directly from the command line. This feature is crucial for debugging and understanding the behavior of your applications in real-time.

## Usage

View Logs for a Deployment:

```bash
retrodeep logs [deployment URL | deployment ID]
```

Specify either the deployment URL or the unique deployment ID to view logs associated with that deployment.

{% hint style="info" %}
Using `retrodeep logs` with a production url would display logs for the most recent deployment.
{% endhint %}

### Extended Usage

This command supports viewing logs for both current and past deployments, helping you troubleshoot issues or monitor ongoing operations.

#### Examples

**View Logs Using Deployment URL:**

To see the logs for a specific deployment using its URL:

```bash
retrodeep logs example_deployment_url
```

**View Logs Using Deployment ID:**

If you know the deployment ID, you can directly use it:

```bash
retrodeep logs deploymentID
```

{% hint style="info" %}
For comprehensive troubleshooting and audit purposes, reviewing logs frequently can provide insights into the health and performance of your applications.
{% endhint %}


# Deployments

Listing Deployments with RetroDeep CLI

A D**eployment** is an instance of your project that is running on the RetroDeep platform. Each time you push updates or modifications to your project through the RetroDeep CLI or connected repositories, a new deployment is created. This allows you to maintain historical versions of your project, test new features in isolation, and roll back to previous versions if necessary.

The `retrodeep ls` command is utilized to list all deployments associated with a specific project. This allows you to quickly view the status of all deployments, aiding in management and oversight of your deployed applications.

## Usage

**List Deployments for a Project:**

```bash
retrodeep ls [project name]
```

Enter the name of the project to see all active and historical deployments. If no project name is provided, it will prompt you to specify a project.

#### Examples

**List All Deployments for a Project:**

To list all deployments for a specific project named `test-app`:

```bash
retrodeep ls test-app
```

This will display all deployments under the `test-app` project, including details such as deployment IDs, status, and creation dates.

### Deleting Deployments

The `retrodeep rm` command allows users to effectively manage their project's resources by removing unwanted or obsolete deployments. This command supports deleting individual deployments as well as all deployments associated with a specified project, providing flexibility in managing deployment lifecycles.

Remove a specific deployment using the command:

```bash
retrodeep rm [deployment-url]
```

Specify the URL or ID of the deployment you wish to remove. This action will delete the specified deployment, freeing up resources and cleaning up your project space.

**Remove All Deployments for a Specific Project:**

By specifying a project name, you can remove all deployments associated with that project. This is useful for project termination or major overhauls where starting fresh is necessary.

```bash
retrodeep rm [project-name]
```

### **Examples**

**Remove a Single Deployment:**

To remove a specific deployment with its URL:

```bash
retrodeep rm example_deployment_url
```

**Remove All Deployments for a Specific Project:**

To remove all deployments associated with the `test-app` project:

```bash
retrodeep rm test-app
```

To display help information about the retrodeep rm command:

```
retrodeep help rm
```


