Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Phillezi authored Sep 12, 2024
1 parent 0119dc4 commit f71fef3
Showing 1 changed file with 31 additions and 35 deletions.
66 changes: 31 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,78 +119,74 @@ Before running the install command again.
```bash
./bin/kthcloud
```
> [!TIP]
> Alternatively you can add it to the PATH to be able to use it globally, TODO: Make static .config location, the current configuration and session files will break otherwise.
> [!TIP]
> Alternatively you can add it to the PATH to be able to use it globally. The installation script automatically does this.

<!--
Alternatively you can move it to a location and add it to the path to be able to use it globally. **(dont do it yet, not ready)**
```bash
sudo cp ./bin/kthcloud /usr/local/bin/
```
Also make sure that `/usr/local/bin` is on the `PATH`.
```bash
echo $PATH | grep /usr/local/bin
```
-->
### Commands

## Usage
#### `login`

### Logging In
Logs in to kthcloud and retrieves an authentication token, the token gets saved to a file named `session.json` inside the configuration path. It opens a browser window to let you login through the kthcloud keycloak login page.

To log in to kthcloud using keycload, use the `login` command:
**Usage:**

```bash
kthcloud login
```

This will bring up your browser and prompt you to login.
#### `compose`

### Compose
Parses a `docker-compose.yaml` or `docker-compose.yml` file and gives the ability to bring up these services on `kthcloud`.

To parse a Docker Compose file, and deploy to the cloud. Use the `compose up` command:
**Usage:**

```bash
kthcloud compose parse
kthcloud compose # lists all options
```

### Commands
**Sub-Commands:**

#### `login`
- `parse`: Parses a Docker Compose file and prints the Services, Envs, Ports and Volumes.
- `up`: Brings up the services defined in the Docker Compose file.
- `down`: (**TODO**) Brings down the services defined in the Docker Compose file.

Logs in to kthcloud and retrieves an authentication token, the token gets saved to a file named session.json.
#### `update`

Checks for newer releases than the release of the binary running the command. If a newer release is found it will prompt you to install it, (can be bypassed wit the `-y` flag).

> [!WARNING]
> This currently doesnt work as expected on Windows.

**Usage:**

```bash
kthcloud login
kthcloud update
```

#### `compose`
#### `version`

Parses a `docker-compose.yaml` or `docker-compose.yml` file and displays the services, environment variables, ports, and volumes.
Displays the version of the binary.

**Usage:**

```bash
kthcloud compose
kthcloud version
```

**Sub-Commands:**

- `parse`: Parses a Docker Compose file and prints the Services, Envs, Ports and Volumes.
- `up`: (TODO)Brings up the services defined in the Docker Compose file.
- `down`: (TODO)Brings down the services defined in the Docker Compose file.

## Configuration

The `kthcloud-cli` uses a configuration file named `config.yaml`. You can specify the following fields:
The `kthcloud-cli` uses a configuration file named `config.yaml` it is located in the configuration directory. You can specify the following fields:

- `api-url`: The URL of the API endpoint.
- `auth-token`: The authentication token from keycloak to access the API.
- `api-token`: The api token from kthcloud.
- `loglevel`: The logging level (info, warn, error, debug) (default "info")
- `session-path`: The filepath where the session should be loaded and saved to (default "~/.config/.kthcloud/session.json")
- `zone`: The preferred kthcloud zone to use, will use `se-flem2` by default

Example `config.yaml`:

```yaml
api-url: https://api.example.com
auth-token: your-auth-token-from-keycloak
api-token: your-api-key-from-kthcloud
loglevel: error
```

0 comments on commit f71fef3

Please sign in to comment.