Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
run: go test ./...

- name: Build CLI
run: go build ./cmd/metorial
run: go build ./cmd/metorial && go build ./cmd/metorial-admin

- name: Install npm workspace dependencies
run: bun install --frozen-lockfile
Expand Down
96 changes: 75 additions & 21 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,40 @@ builds:
- amd64
- arm64

- id: metorial-admin
main: ./cmd/metorial-admin
binary: metorial-admin
env:
- CGO_ENABLED=0
ldflags:
- -s -w
- -X github.com/metorial/cli/internal/version.Version={{ .Version }}
- -X github.com/metorial/cli/internal/version.Commit={{ .Commit }}
- -X github.com/metorial/cli/internal/version.Date={{ .Date }}
goos:
- darwin
- linux
- windows
goarch:
- amd64
- arm64

archives:
- id: default
- id: metorial
builds:
- metorial
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
name_template: 'metorial_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
formats:
- tar.gz
format_overrides:
- goos: windows
formats:
- zip

- id: metorial-admin
builds:
- metorial-admin
name_template: 'metorial-admin_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
formats:
- tar.gz
format_overrides:
Expand All @@ -52,6 +81,8 @@ checksum:

brews:
- name: metorial
ids:
- metorial
repository:
owner: metorial
name: homebrew-tap
Expand All @@ -61,7 +92,7 @@ brews:
enabled: true
directory: Formula
homepage: https://metorial.com
description: Official CLI for the Metorial platform
description: Official CLI for Metorial integrations and MCP tools
license: MIT
commit_author:
name: metorial-bot
Expand All @@ -71,8 +102,32 @@ brews:
install: |
bin.install "metorial"

- name: metorial-admin
ids:
- metorial-admin
repository:
owner: metorial
name: homebrew-tap
token: '{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}'
branch: goreleaser-homebrew-admin-{{ .Version }}
pull_request:
enabled: true
directory: Formula
homepage: https://metorial.com
description: Official admin CLI for the Metorial Magnetar API
license: MIT
commit_author:
name: metorial-bot
email: hey@metorial.com
test: |
system "#{bin}/metorial-admin", "version"
install: |
bin.install "metorial-admin"

scoops:
- name: metorial
ids:
- metorial
repository:
owner: metorial
name: scoop-bucket
Expand All @@ -81,29 +136,28 @@ scoops:
pull_request:
enabled: true
homepage: https://metorial.com
description: Official CLI for the Metorial platform
description: Official CLI for Metorial integrations and MCP tools
license: MIT
commit_author:
name: metorial-bot
email: hey@metorial.com

# chocolateys:
# - name: metorial
# title: Metorial CLI
# authors: Metorial Inc.
# project_url: https://metorial.com
# url_template: 'https://github.com/metorial/cli/releases/download/{{ .Tag }}/{{ .ArtifactName }}'
# copyright: 2026 Metorial Inc.
# license_url: https://github.com/metorial/cli/blob/main/LICENSE
# project_source_url: https://github.com/metorial/cli
# docs_url: https://metorial.com/docs
# bug_tracker_url: https://github.com/metorial/cli/issues
# release_notes: https://github.com/metorial/cli/releases/tag/{{ .Tag }}
# summary: Official CLI for the Metorial platform
# description: The Metorial CLI lets you authenticate, inspect resources, and work with the Metorial platform from your terminal.
# tags: metorial cli ai mcp
# api_key: '{{ .Env.CHOCOLATEY_API_KEY }}'
# source_repo: https://push.chocolatey.org/
- name: metorial-admin
ids:
- metorial-admin
repository:
owner: metorial
name: scoop-bucket
token: '{{ .Env.SCOOP_BUCKET_GITHUB_TOKEN }}'
branch: goreleaser-scoop-admin-{{ .Version }}
pull_request:
enabled: true
homepage: https://metorial.com
description: Official admin CLI for the Metorial Magnetar API
license: MIT
commit_author:
name: metorial-bot
email: hey@metorial.com

changelog:
sort: asc
Expand Down
17 changes: 13 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
CLI_NAME := metorial
ADMIN_NAME := metorial-admin
BIN_DIR := bin
BIN := $(BIN_DIR)/$(CLI_NAME)
ADMIN_BIN := $(BIN_DIR)/$(ADMIN_NAME)
PKG := ./cmd/metorial
ADMIN_PKG := ./cmd/metorial-admin

.PHONY: help build run fmt test tidy check install clean completion-bash completion-zsh completion-fish completion-powershell release snapshot public
.PHONY: help build run fmt test tidy check install clean completion-bash completion-zsh completion-fish completion-powershell generate release snapshot public

help:
@printf "%s\n" \
"Available targets:" \
" make build Build the CLI into ./bin/metorial" \
" make run Run the CLI locally" \
" make build Build both CLIs into ./bin" \
" make run Run the consumer CLI locally" \
" make generate Generate admin commands from Magnetar introspect" \
" make fmt Format all Go code" \
" make test Run CLI tests" \
" make tidy Sync go.mod and go.sum" \
" make check Run fmt, tidy, and tests" \
" make install Install the CLI into GOPATH/bin" \
" make install Install both CLIs into GOPATH/bin" \
" make clean Remove local build output" \
" make completion-bash Print bash completions" \
" make completion-zsh Print zsh completions" \
Expand All @@ -27,10 +31,14 @@ help:
build:
mkdir -p $(BIN_DIR)
go build -o $(BIN) $(PKG)
go build -o $(ADMIN_BIN) $(ADMIN_PKG)

run:
go run $(PKG)

generate:
cd generator && bun run generate $${API_URL:-http://metorial-root.localhost:4310}

fmt:
gofmt -w $$(find . -name '*.go' -print)

Expand All @@ -44,6 +52,7 @@ check: fmt tidy test

install:
go install $(PKG)
go install $(ADMIN_PKG)

clean:
rm -rf $(BIN_DIR)
Expand Down
Loading
Loading