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

# Upsun SDK for Go

> This section describe how to use Upsun SDK for Go.

Upsun SDK for Go.\
This SDK maps the Upsun CLI commands. For more information, read [the documentation](https://docs.upsun.com).

## Install

```bash theme={null}
go get upsun-sdk-go
```

## Usage

```Go theme={null}

import "github.com/upsun/upsun-sdk-go";

config := NewUpsunConfig(nil)
upsun := NewUpsunClient(*config)

orgs := upsun.organization.List()
prjs := upsun.project.list("name=MyOrganizationName");
result := upsun.environment.redeploy("MyProjectId", "main");
```

## Devel

Clone repository:

```bash theme={null}
git clone git@github.com:upsun/upsun-sdk-go.git
```

Install Dep:

```bash theme={null}
go install
```

Generate API Client (Low-level) base on OpenAPI spec.

```bash theme={null}
./scripts/gen_golang.sh
```

Build the stack:

```bash theme={null}
go build .
```
