Skip to content

Commit 2d7c6fb

Browse files
committed
Initial v1 release
0 parents  commit 2d7c6fb

File tree

8 files changed

+680
-0
lines changed

8 files changed

+680
-0
lines changed

.github/workflows/release.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Release
2+
3+
# on tag push
4+
on:
5+
push:
6+
tags:
7+
- 'v*'
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
14+
release:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v4
21+
with:
22+
go-version: '1.22.4'
23+
24+
- name: Build
25+
run: VERSION=${{ github.ref_name }} make release
26+
27+
- name: Release
28+
uses: softprops/action-gh-release@v2
29+
with:
30+
draft: true
31+
files: |
32+
dist/usewebhook_darwin_amd64.tar.gz
33+
dist/usewebhook_darwin_arm64.tar.gz
34+
dist/usewebhook_linux_amd64.tar.gz
35+
dist/usewebhook_linux_arm64.tar.gz

.gitignore

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# OS files
2+
.DS_Store
3+
4+
# Visual Studio Code files
5+
.vscode/*
6+
!.vscode/settings.json
7+
!.vscode/tasks.json
8+
!.vscode/launch.json
9+
10+
#Jetbrains project files
11+
.idea/
12+
13+
# Compiled Object files, Static and Dynamic libs (Shared Objects)
14+
*.o
15+
*.a
16+
*.so
17+
18+
# Folders
19+
_obj
20+
_test
21+
22+
# Architecture specific extensions/prefixes
23+
*.[568vq]
24+
[568vq].out
25+
26+
*.cgo1.go
27+
*.cgo2.c
28+
_cgo_defun.c
29+
_cgo_gotypes.go
30+
_cgo_export.*
31+
32+
_testmain.go
33+
34+
*.exe
35+
*.test
36+
*.prof
37+
38+
# Output of the go coverage tool, specifically when used with LiteIDE
39+
*.out
40+
41+
# Dist
42+
dist
43+
usewebhook
44+
*.tar.gz
45+
46+
# Tmp files
47+
tmp

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Figstra Software GmbH
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
PKG = github.com/figstra/usewebhook-cli
2+
VERSION ?= dev
3+
LDFLAGS = -ldflags "-X 'main.Version=$(VERSION)'"
4+
5+
deps:
6+
go get ./...
7+
8+
install:
9+
go install $(LDFLAGS)
10+
11+
test: deps
12+
go test ./... -timeout 60s $(LDFLAGS) -v
13+
14+
cover: deps
15+
go test ./... -race -v -timeout 15s -coverprofile=coverage.out
16+
go tool cover -html=coverage.out
17+
18+
fmt:
19+
go fmt ./...
20+
21+
bench: deps
22+
go test $(LDFLAGS) -benchmem -bench=. -benchtime=5s ./...
23+
24+
race: deps
25+
go test ./... -v -race -timeout 15s
26+
27+
release: release-linux release-darwin
28+
29+
ensure-dist: deps
30+
mkdir -p dist
31+
32+
release-linux: ensure-dist
33+
GOOS=linux GOARCH=amd64 go build -o dist/usewebhook $(LDFLAGS) && cd dist && tar -czf usewebhook_linux_amd64.tar.gz usewebhook && rm usewebhook
34+
GOOS=linux GOARCH=arm64 go build -o dist/usewebhook $(LDFLAGS) && cd dist && tar -czf usewebhook_linux_arm64.tar.gz usewebhook && rm usewebhook
35+
36+
release-darwin: ensure-dist
37+
GOOS=darwin GOARCH=amd64 go build $(LDFLAGS) -o dist/usewebhook && cd dist && tar -czf usewebhook_darwin_amd64.tar.gz usewebhook && rm usewebhook
38+
GOOS=darwin GOARCH=arm64 go build $(LDFLAGS) -o dist/usewebhook && cd dist && tar -czf usewebhook_darwin_arm64.tar.gz usewebhook && rm usewebhook

README.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# UseWebhook CLI
2+
3+
[UseWebhook](https://usewebhook.com/) is a free tool to capture webhooks from your browser.
4+
5+
- ⚡️ Test webhooks without a server
6+
- 🔍 Inspect and diff incoming requests
7+
- 👨‍💻 Forward to localhost, or replay from history
8+
- ✅ Debug webhooks from Stripe, Paddle, Slack, or anywhere else
9+
10+
No sign up required. Just send HTTP requests to your webhook URL.
11+
12+
## Installation
13+
14+
The easiest way to install is using the automated script:
15+
16+
```
17+
curl -sSL https://usewebhook.com/install.sh | bash
18+
```
19+
20+
It will detect your OS and architecture, download the corresponding executable, and add it to your PATH.
21+
22+
Alternatively, you can download the binary for your operating system from the [releases page](https://github.com/figstra/usewebhook-cli/releases), or [build from source](#build-from-source) if you'd like.
23+
24+
## Usage
25+
26+
Create a new webhook and start listening:
27+
28+
```bash
29+
$ usewebhook
30+
31+
> Dashboard: https://usewebhook.com/?id=123
32+
> Webhook URL: https://usewebhook.com/123
33+
```
34+
35+
Listen for requests to a specific webhook:
36+
37+
```bash
38+
$ usewebhook <webhook-URL>
39+
```
40+
41+
Forward incoming requests to localhost:
42+
43+
```bash
44+
$ usewebhook <webhook-URL> --forward-to http://localhost:8080/your-endpoint
45+
```
46+
47+
Replay a specific request from the webhook's history:
48+
49+
```bash
50+
$ usewebhook <webhook-URL> --request-id <request-ID> -f http://localhost:8080/your-endpoint
51+
```
52+
53+
54+
## Build from source
55+
56+
1. Ensure you have Go installed on your system.
57+
2. Clone the repository:
58+
```
59+
git clone https://github.com/figstra/usewebhook-cli
60+
```
61+
3. Navigate to the project directory:
62+
```
63+
cd usewebhook-cli
64+
```
65+
4. Build the binary:
66+
```
67+
go build -o usewebhook
68+
```
69+
5. Move the binary to your PATH:
70+
```
71+
sudo mv ./usewebhook /usr/local/bin/
72+
```
73+
74+
75+
## Contributing
76+
77+
Contributions are welcome! In case you want to add a feature, please create a new issue and briefly explain what the feature would consist of.
78+
79+
Simply follow the next steps:
80+
81+
- Fork the project.
82+
- Create a new branch.
83+
- Make your changes and write tests when practical.
84+
- Commit your changes to the new branch.
85+
- Send a pull request, it will be reviewed shortly.
86+
87+
## Change log
88+
89+
- **1.0.0:** Release v1
90+
91+
## License
92+
93+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

go.mod

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module github.com/figstra/usewebhook-cli
2+
3+
go 1.22.4
4+
5+
require (
6+
github.com/fatih/color v1.17.0
7+
github.com/spf13/cobra v1.8.1
8+
)
9+
10+
require (
11+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
12+
github.com/mattn/go-colorable v0.1.13 // indirect
13+
github.com/mattn/go-isatty v0.0.20 // indirect
14+
github.com/spf13/pflag v1.0.5 // indirect
15+
golang.org/x/sys v0.18.0 // indirect
16+
)

go.sum

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
2+
github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
3+
github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
4+
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
5+
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
6+
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
7+
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
8+
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
9+
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
10+
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
11+
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
12+
github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
13+
github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y=
14+
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
15+
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
16+
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
17+
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
18+
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
19+
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
20+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
21+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 commit comments

Comments
 (0)