Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.cache/**
**/mozcloud-chart-migration-workspace/**
tools/**/bin
4 changes: 3 additions & 1 deletion go.work
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
go 1.25.3
go 1.25.5

use ./tools/render-diff

use ./tools/mozcloud-mcp

use ./tools/mzcld
5 changes: 3 additions & 2 deletions go.work.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMo
github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g=
github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/bits-and-blooms/bitset v1.22.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao=
github.com/cilium/ebpf v0.9.1/go.mod h1:+OhNOIXx/Fnu1IE8bJz2dzOA+VSfyTfdNUVdlQnxUFY=
github.com/cncf/xds/go v0.0.0-20250121191232-2f005788dc42/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8=
github.com/containerd/aufs v1.0.0/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU=
Expand All @@ -36,7 +38,6 @@ github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03V
github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/denisenkom/go-mssqldb v0.9.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/envoyproxy/go-control-plane v0.13.4/go.mod h1:kDfuBlDVsSj2MjrLEtRWtHlsWIFcGyB2RMO44Dc5GZA=
github.com/envoyproxy/go-control-plane/envoy v1.32.4/go.mod h1:Gzjc5k8JcJswLjAx1Zm+wSYE20UrLtt7JZMWiWQXQEw=
github.com/envoyproxy/go-control-plane/ratelimit v0.1.0/go.mod h1:Wk+tMFAFbCXaJPzVVHnPgRKdUdwW/KdbRt94AzgRee4=
Expand Down Expand Up @@ -96,6 +97,7 @@ github.com/pquerna/cachecontrol v0.1.0/go.mod h1:NrUG3Z7Rdu85UNR3vm7SOsl1nFIeSiQ
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww=
github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY=
github.com/sahilm/fuzzy v0.1.1/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y=
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY=
github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0=
github.com/spiffe/go-spiffe/v2 v2.5.0/go.mod h1:P+NxobPc6wXhVtINNtFjNWGBTreew1GBUCwT2wPmb7g=
Expand Down Expand Up @@ -124,7 +126,6 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.6
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.44.0/go.mod h1:013i+Nw79BMiQiMsOPcVCB5ZIJbYkerPrGnOa00tvmc=
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY=
golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.46.0/go.mod h1:Q9BGdFy1y4nkUwiLvT5qtyhAnEHgnQ/zd8PfU6nc210=
golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
Expand Down
40 changes: 40 additions & 0 deletions tools/mzcld/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
LOCALBIN ?= $(shell pwd)/bin
$(LOCALBIN):
mkdir -p $(LOCALBIN)

VERSION ?= dev
LDFLAGS = -ldflags "-X github.com/mozilla/mozcloud/tools/mzcld/cmd.Version=$(VERSION)"

.PHONY: all build install lint vet fmt test

all: build

build: $(LOCALBIN)
go build $(LDFLAGS) -o $(LOCALBIN)/mzcld .

install:
go install $(LDFLAGS) .

lint: $(LOCALBIN)/golangci-lint
$(LOCALBIN)/golangci-lint run

vet:
go vet ./...

fmt:
go fmt ./...

test:
go test ./...

## golangci-lint

GOLANGCI_LINT_VERSION ?= v2.6.0
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint-$(GOLANGCI_LINT_VERSION)

$(LOCALBIN)/golangci-lint: $(GOLANGCI_LINT)
ln -sf $(GOLANGCI_LINT) $(LOCALBIN)/golangci-lint

$(GOLANGCI_LINT): $(LOCALBIN)
GOBIN=$(LOCALBIN) go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
mv $(LOCALBIN)/golangci-lint $(GOLANGCI_LINT)
63 changes: 63 additions & 0 deletions tools/mzcld/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# mzcld

Unified CLI for the MozCloud platform.

## Install

```bash
go install github.com/mozilla/mozcloud/tools/mzcld@latest
```

Or build locally:

```bash
make build # outputs bin/mzcld
make install # installs to $GOPATH/bin
```

## Commands

### `mzcld init`

Check that your local environment has the required tools installed and that OCI registry authentication is configured.

```bash
mzcld init
```

### `mzcld claude install`

Interactively install Claude Code skills, agents, and the `mozcloud-mcp` server from this repository. Run from anywhere inside the mozcloud repo.

```bash
mzcld claude install
```

Non-interactive:

```bash
mzcld claude install --all --scope user
```

Update the MCP binary to the latest published version:

```bash
mzcld claude install --update
```

### `mzcld claude uninstall`

Remove installed skills, agents, and the MCP server.

```bash
mzcld claude uninstall
```

## Development

```bash
make vet # go vet
make fmt # go fmt
make test # go test
make lint # golangci-lint
```
11 changes: 11 additions & 0 deletions tools/mzcld/cmd/chart/Chart.yaml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v2
name: {{ .Name }}
description: {{ .Description }}
type: application
version: 0.1.0

dependencies:
- name: mozcloud
version: "{{ .MozcloudVersion }}"
repository: "oci://us-west1-docker.pkg.dev/moz-fx-platform-artifacts/mozcloud-charts"
condition: mozcloud.enabled
14 changes: 14 additions & 0 deletions tools/mzcld/cmd/chart/chart.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Package chart implements the `mzcld chart` subcommand group.
package chart

import "github.com/spf13/cobra"

// Cmd is the `mzcld chart` parent command.
var Cmd = &cobra.Command{
Use: "chart",
Short: "Work with MozCloud Helm charts",
}

func init() {
Cmd.AddCommand(newCmd)
}
Loading