Skip to content

Commit 64367f3

Browse files
feat: add GoReleaser, install script, and distribution channels (#122)
* feat: add GoReleaser, install script, and distribution channels Replace manual cross-compilation and release workflow with GoReleaser for consistent artifact naming, checksums, and automatic publishing to Homebrew tap and Scoop bucket. Add a curl|sh install script for easy Linux/macOS installation. Rewrite README installation section with platform-specific one-liners and fix badge links. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: remove Homebrew tap, Scoop bucket, and extra token config Keep everything self-contained in this repo — no separate tap/bucket repos or additional token secrets needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: restore original release trigger and versioning flow Keep push-to-main trigger and PR-label-based semver calculation via release-version action. GoReleaser runs after the version is calculated and the tag is created. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add output formatting, MCP tools, tests, and security fixes (#123) * feat: add output formatting, enhanced MCP tools, unit tests, and security fixes - Add output formatting package (json/yaml/table) with --output flag support - Update code generator to use output.Print() for all 326 generated commands - Add composite MCP tools: get_security_posture_summary, get_findings_for_repo - Add triage tools for SCA, secrets, and DAST findings - Add --repo flag to MCP serve with git remote auto-detection - Add unit tests for auth, MCP server helpers, output formatters, API client - Fix: config file permissions changed from 0644 to 0600 - Fix: add HTTP status code check in device token polling - Fix: show manual URL message when browser can't be opened - Fix: remove token value from debug log output Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: replace device flow with localhost callback auth (#124) * feat: replace device code polling with localhost callback auth Rewrite login flow: CLI starts a localhost HTTP server, opens browser to Cognito, receives callback with session ID, fetches tokens from backend. No more code confirmation or polling delay. - Replace DeviceFlowLogin() with Login() using localhost callback - Use http.NewRequestWithContext for proper context propagation - Add tracer spans to all auth functions - Simplify get_token.go to delegate to auth.GetValidToken() Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: harden login with CSRF check, duplicate guard, and ctx cancellation - Verify received session_id matches expected one (CSRF protection) - Use sync.Once to guard against duplicate callback invocations - Add ctx.Done() case to select for proper Ctrl+C cancellation - Improve success HTML with checkmark SVG - Create session before starting server to have expected session ID Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix duplicate callback handling: serve success page on repeated requests Previously, a second callback to the CLI localhost server after sync.Once would return an empty response. Now it returns the success HTML page. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add signal handling for graceful Ctrl+C during login Wrap login context with signal.NotifyContext so Ctrl+C triggers the ctx.Done() select case, printing "authentication cancelled" cleanly instead of an abrupt process termination. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix go.mod: run go mod tidy to sync dependencies Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Migrate CLI from go-arg to cobra and clean up struct tags - Replace go-arg-based main.go with cobra command structure - Remove go-arg struct tags from DAST and auth models - Add HTTP client timeout to NullifyClient - Add generate-api Makefile target Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix Makefile build target for cobra package structure Change ./cmd/cli/... to ./cmd/cli since the cobra cmd subpackage is not a separate binary target. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix lint errors: errcheck and gofmt issues Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * fix: address security review findings - Fail install if no checksum tool available instead of silently bypassing - Create config dir with 0700 permissions, config file with 0600 - Sanitize host value before JSON interpolation - URL-encode refresh token in query parameter Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0f2f746 commit 64367f3

65 files changed

Lines changed: 30052 additions & 166 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release.yml

Lines changed: 16 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
name: Release
22
on:
33
workflow_dispatch:
4-
inputs:
5-
releaseType:
6-
description: Create a draft release
7-
required: true
8-
type: boolean
9-
default: false
104
push:
115
branches:
126
- main
@@ -32,45 +26,28 @@ jobs:
3226
- run: |
3327
echo "**Version:** ${{ steps.get-version.outputs.version }}" >> $GITHUB_STEP_SUMMARY
3428
echo "**Short SHA:** $(git rev-parse --short HEAD)" >> $GITHUB_STEP_SUMMARY
35-
build:
36-
if: ${{ needs.get-version.outputs.version != 'undefined' || (github.event_name == 'workflow_dispatch' && needs.get-version.outputs.version != 'undefined') }}
37-
name: Build
38-
needs: [ get-version ]
29+
goreleaser:
30+
if: ${{ needs.get-version.outputs.version != 'undefined' }}
31+
name: GoReleaser
32+
needs: [get-version]
3933
runs-on: blacksmith-4vcpu-ubuntu-2404
4034
steps:
4135
- uses: actions/checkout@v6
36+
with:
37+
fetch-depth: 0
4238
- uses: actions/setup-go@v6
4339
with:
4440
go-version-file: go.mod
45-
- name: Set Release Variables
46-
run: echo "VERSION=${{ needs.get-version.outputs.version }}" >> $GITHUB_ENV
47-
- name: Build CLI
48-
run: make package
49-
- name: Upload Binaries
50-
uses: actions/upload-artifact@v6
51-
with:
52-
name: binaries
53-
retention-days: 2
54-
path: bin/*
55-
release:
56-
if: ${{ needs.get-version.outputs.version != 'undefined' || (github.event_name == 'workflow_dispatch' && needs.get-version.outputs.version != 'undefined') }}
57-
name: Release
58-
runs-on: blacksmith-4vcpu-ubuntu-2404
59-
needs: [ get-version, build ]
60-
steps:
61-
- name: Download Binaries
62-
uses: actions/download-artifact@v7
63-
with:
64-
path: ${{ github.workspace }}
65-
- name: Generate Release
66-
uses: softprops/action-gh-release@v2
41+
- name: Create and push tag
6742
env:
6843
VERSION: ${{ needs.get-version.outputs.version }}
44+
run: |
45+
git tag "v${VERSION}"
46+
git push origin "v${VERSION}"
47+
- name: Run GoReleaser
48+
uses: goreleaser/goreleaser-action@v6
6949
with:
70-
draft: false
71-
generate_release_notes: true
72-
append_body: true
73-
tag_name: v${{ env.VERSION }}
74-
token: ${{ github.token }}
75-
files: |
76-
${{ github.workspace }}/binaries/*
50+
version: latest
51+
args: release --clean
52+
env:
53+
GITHUB_TOKEN: ${{ github.token }}

.goreleaser.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
version: 2
2+
3+
project_name: nullify
4+
5+
before:
6+
hooks:
7+
- go mod tidy
8+
9+
builds:
10+
- main: ./cmd/cli
11+
binary: nullify
12+
env:
13+
- CGO_ENABLED=0
14+
ldflags:
15+
- -X 'github.com/nullify-platform/logger/pkg/logger.Version={{ .Version }}'
16+
goos:
17+
- linux
18+
- darwin
19+
- windows
20+
goarch:
21+
- amd64
22+
- arm64
23+
ignore:
24+
- goos: windows
25+
goarch: arm64
26+
27+
archives:
28+
- format: tar.gz
29+
name_template: "nullify_{{ .Os }}_{{ .Arch }}"
30+
format_overrides:
31+
- goos: windows
32+
format: zip
33+
files:
34+
- LICENSE*
35+
- README*
36+
37+
checksum:
38+
name_template: "checksums.txt"
39+
40+
changelog:
41+
use: github-native
42+
43+
release:
44+
github:
45+
owner: Nullify-Platform
46+
name: cli
47+
draft: false
48+
prerelease: auto

Makefile

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: build clean deploy
1+
.PHONY: build clean
22

33
# set the version as the latest commit sha if it's not already defined
44
ifndef VERSION
@@ -16,19 +16,7 @@ GOFLAGS := -ldflags "-X 'github.com/nullify-platform/logger/pkg/logger.Version=$
1616
all: build
1717

1818
build:
19-
$(GOENV) go build $(GOFLAGS) -o bin/cli ./cmd/cli/...
20-
21-
package:
22-
# linux
23-
$(GOENV) GOOS=linux GOARCH=amd64 go build $(GOFLAGS) -o bin/nullify_linux_amd64_$(VERSION) ./cmd/cli/...
24-
$(GOENV) GOOS=linux GOARCH=arm64 go build $(GOFLAGS) -o bin/nullify_linux_arm64_$(VERSION) ./cmd/cli/...
25-
$(GOENV) GOOS=linux GOARCH=386 go build $(GOFLAGS) -o bin/nullify_linux_386_$(VERSION) ./cmd/cli/...
26-
# mac
27-
$(GOENV) GOOS=darwin GOARCH=amd64 go build $(GOFLAGS) -o bin/nullify_macos_amd64_$(VERSION) ./cmd/cli/...
28-
$(GOENV) GOOS=darwin GOARCH=arm64 go build $(GOFLAGS) -o bin/nullify_macos_arm64_$(VERSION) ./cmd/cli/...
29-
# windows
30-
$(GOENV) GOOS=windows GOARCH=amd64 go build $(GOFLAGS) -o bin/nullify_windows_amd64_$(VERSION).exe ./cmd/cli/...
31-
$(GOENV) GOOS=windows GOARCH=386 go build $(GOFLAGS) -o bin/nullify_windows_386_$(VERSION).exe ./cmd/cli/...
19+
$(GOENV) go build $(GOFLAGS) -o bin/cli ./cmd/cli
3220

3321
clean:
3422
rm -rf ./bin ./vendor Gopkg.lock coverage.*
@@ -46,6 +34,9 @@ lint-docker:
4634
docker build --quiet --target hadolint -t hadolint:latest .
4735
docker run --rm -v $(shell pwd):/app -w /app hadolint hadolint Dockerfile demo_server/Dockerfile
4836

37+
generate-api:
38+
go run ./scripts/generate/main.go --spec ../public-docs/specs/merged-openapi.yml --output internal/api --cmd-output internal/commands
39+
4940
unit:
5041
go test -v -skip TestIntegration ./...
5142

README.md

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
<a href="https://github.com/Nullify-Platform/cli/releases">
99
<img src="https://img.shields.io/github/v/release/Nullify-Platform/cli" alt="GitHub release" />
1010
</a>
11-
<a href="https://github.com/Nullify-Platform/Kuat-Shipyards/actions/workflows/release.yml">
12-
<img src="https://github.com/Nullify-Platform/Kuat-Shipyards/actions/workflows/release.yml/badge.svg" alt="Release Status" />
11+
<a href="https://github.com/Nullify-Platform/cli/actions/workflows/release.yml">
12+
<img src="https://github.com/Nullify-Platform/cli/actions/workflows/release.yml/badge.svg" alt="Release Status" />
1313
</a>
1414
<a href="https://docs.nullify.ai/features/api-scanning/cli/">
1515
<img src="https://img.shields.io/badge/docs-docs.nullify.ai-purple" alt="Documentation" />
@@ -29,9 +29,40 @@
2929

3030
[Nullify](https://nullify.ai) CLI dynamically tests and fuzzes your endpoints for security vulnerabilities.
3131

32-
## Getting Started
33-
* Download the [latest release](https://github.com/Nullify-Platform/cli/releases) or build from source
34-
* See our [quickstart guide](https://docs.nullify.ai/features/api-testing) for more info
32+
## Installation
33+
34+
### macOS / Linux
35+
36+
```sh
37+
curl -sSfL https://raw.githubusercontent.com/Nullify-Platform/cli/main/install.sh | sh
38+
```
39+
40+
### Windows
41+
42+
Download the latest `.zip` archive for your platform from the [GitHub Releases](https://github.com/Nullify-Platform/cli/releases) page and add the binary to your `PATH`.
43+
44+
### GitHub Actions
45+
46+
Download the latest release in your workflow:
47+
48+
```yaml
49+
- name: Install Nullify CLI
50+
run: curl -sSfL https://raw.githubusercontent.com/Nullify-Platform/cli/main/install.sh | sh
51+
```
52+
53+
### Manual Download
54+
55+
Download the latest binary for your platform from the [GitHub Releases](https://github.com/Nullify-Platform/cli/releases) page.
56+
57+
### Verify Installation
58+
59+
```sh
60+
nullify --version
61+
```
62+
63+
### Getting Started
64+
65+
See our [quickstart guide](https://docs.nullify.ai/features/api-testing) for more info.
3566

3667
## Usage
3768

0 commit comments

Comments
 (0)