mirror of
https://github.com/coollabsio/coolify-cli.git
synced 2026-06-19 07:35:04 +00:00
feat: installable via go and update gorealeser
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
coolify-cli
|
||||
coolify
|
||||
/coolify
|
||||
config.json
|
||||
.claude
|
||||
|
||||
|
||||
+7
-4
@@ -1,8 +1,13 @@
|
||||
version: 2
|
||||
|
||||
before:
|
||||
hooks:
|
||||
- go mod tidy
|
||||
|
||||
builds:
|
||||
- binary: coolify
|
||||
- id: coolify
|
||||
binary: coolify
|
||||
main: ./coolify
|
||||
goos:
|
||||
- darwin
|
||||
- linux
|
||||
@@ -11,6 +16,4 @@ builds:
|
||||
- amd64
|
||||
- arm64
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
# Build all platforms in parallel using all available CPU cores
|
||||
parallelism: -1
|
||||
- CGO_ENABLED=0
|
||||
+4
-1
@@ -550,7 +550,10 @@ c.httpClient = &http.Client{
|
||||
|
||||
```bash
|
||||
# Local build
|
||||
go build -o coolify .
|
||||
go build -o coolify ./coolify
|
||||
|
||||
# Install locally
|
||||
go install ./coolify
|
||||
|
||||
# Multi-platform release
|
||||
goreleaser release --clean
|
||||
|
||||
@@ -21,7 +21,7 @@ All commands in this CLI are wrappers around API endpoints defined in the OpenAP
|
||||
|
||||
### Command Structure
|
||||
The codebase follows Cobra's command pattern with a root command and subcommands:
|
||||
- Entry point: `main.go` calls `cmd.Execute()`
|
||||
- Entry point: `coolify/main.go` calls `cmd.Execute()`
|
||||
- Root command: `cmd/root.go` - contains core utilities (HTTP client, authentication, version checking, config management)
|
||||
- Subcommands: Each command is in its own file in `cmd/`:
|
||||
- `context.go` - manage Coolify context (add, remove, list, set default/token)
|
||||
@@ -62,23 +62,23 @@ Three output modes supported via `--format` flag:
|
||||
|
||||
### Build
|
||||
```bash
|
||||
go build -o coolify .
|
||||
go build -o coolify ./coolify
|
||||
```
|
||||
|
||||
### Run locally
|
||||
```bash
|
||||
go run main.go [command]
|
||||
go run ./coolify [command]
|
||||
```
|
||||
|
||||
### Test a command
|
||||
```bash
|
||||
go run main.go instances list
|
||||
go run main.go servers list --debug
|
||||
go run ./coolify context list
|
||||
go run ./coolify servers list --debug
|
||||
```
|
||||
|
||||
### Install locally
|
||||
```bash
|
||||
go install
|
||||
go install ./coolify
|
||||
```
|
||||
|
||||
### Run tests
|
||||
|
||||
+3
-1
@@ -69,6 +69,7 @@ Once you publish the release:
|
||||
4. The release becomes available at:
|
||||
- GitHub: `https://github.com/coollabsio/coolify-cli/releases/tag/v1.x.x`
|
||||
- Install script: `curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash`
|
||||
- `go install`: `go install github.com/coollabsio/coolify-cli/coolify@v1.x.x`
|
||||
|
||||
### 5. Verify the Release
|
||||
|
||||
@@ -128,10 +129,11 @@ After creating a release:
|
||||
|
||||
The release process uses these configuration files:
|
||||
|
||||
- `.goreleaser.yml` - GoReleaser configuration (build matrix, archives, etc.)
|
||||
- `.goreleaser.yml` - GoReleaser configuration (build matrix, archives, etc.) - points to `/coolify` as entry point
|
||||
- `.github/workflows/release-cli.yml` - GitHub Actions workflow
|
||||
- `scripts/install.sh` - User-facing install script
|
||||
- `cmd/root.go` - Contains `CliVersion` variable (line 22)
|
||||
- `coolify/main.go` - Binary entry point for `go install` support
|
||||
|
||||
## Notes
|
||||
|
||||
|
||||
@@ -8,6 +8,17 @@ curl -fsSL https://raw.githubusercontent.com/coollabsio/coolify-cli/main/scripts
|
||||
|
||||
It will install the CLI in `/usr/local/bin/coolify` and the configuration file in `~/.config/coolify/config.json`
|
||||
|
||||
### Using `go install`
|
||||
|
||||
```bash
|
||||
go install github.com/coollabsio/coolify-cli/coolify@latest
|
||||
```
|
||||
|
||||
This will install the `coolify` binary in your `$GOPATH/bin` directory (usually `~/go/bin`). Make sure this directory is in your `$PATH`.
|
||||
|
||||
### Using the install script
|
||||
|
||||
|
||||
## Getting Started
|
||||
1. Get a `<token>` from your Coolify dashboard (Cloud or self-hosted) at `/security/api-tokens`
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
)
|
||||
|
||||
// CliVersion is the CLI version
|
||||
const CliVersion = "1.0.3"
|
||||
const CliVersion = "1.0.4"
|
||||
|
||||
// CheckInterval for version checking
|
||||
const CheckInterval = 10 * time.Minute
|
||||
|
||||
Reference in New Issue
Block a user