Skip to content

Commit f2150c0

Browse files
authored
Merge pull request #1 from Bandwidth/feature/rebrand-to-cli
Hello, world: initial code drop for the Bandwidth CLI
2 parents 81d2d64 + 4c137be commit f2150c0

152 files changed

Lines changed: 13789 additions & 0 deletions

File tree

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest, macos-latest, windows-latest]
14+
runs-on: ${{ matrix.os }}
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v6
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v6
21+
with:
22+
go-version-file: go.mod
23+
24+
- name: Build
25+
run: go build -o band ./cmd/band
26+
27+
- name: Test
28+
run: go test ./... -v
29+
30+
lint:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v6
35+
36+
- name: Set up Go
37+
uses: actions/setup-go@v6
38+
with:
39+
go-version-file: go.mod
40+
41+
- name: Run golangci-lint
42+
uses: golangci/golangci-lint-action@v7
43+
44+
security:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Checkout
48+
uses: actions/checkout@v6
49+
50+
- name: Set up Go
51+
uses: actions/setup-go@v6
52+
with:
53+
go-version-file: go.mod
54+
55+
- name: Install govulncheck
56+
run: go install golang.org/x/vuln/cmd/govulncheck@latest
57+
58+
- name: Run govulncheck
59+
run: govulncheck ./...
60+
61+
docs-check:
62+
if: github.event_name == 'pull_request'
63+
runs-on: ubuntu-latest
64+
steps:
65+
- name: Checkout
66+
uses: actions/checkout@v6
67+
with:
68+
fetch-depth: 0
69+
70+
- name: Check for doc updates
71+
run: |
72+
BASE=${{ github.event.pull_request.base.sha }}
73+
HEAD=${{ github.event.pull_request.head.sha }}
74+
CHANGED=$(git diff --name-only "$BASE" "$HEAD")
75+
76+
CODE_CHANGED=false
77+
DOCS_CHANGED=false
78+
79+
# Check if command surface or flags changed
80+
if echo "$CHANGED" | grep -qE '^cmd/|^internal/cmdutil/'; then
81+
CODE_CHANGED=true
82+
fi
83+
84+
# Check if any docs were touched
85+
if echo "$CHANGED" | grep -qE '^README\.md$|^AGENTS\.md$'; then
86+
DOCS_CHANGED=true
87+
fi
88+
89+
if [ "$CODE_CHANGED" = true ] && [ "$DOCS_CHANGED" = false ]; then
90+
echo "::warning::Command code changed without documentation updates. If this PR adds, removes, or changes commands/flags, please update README.md and/or AGENTS.md."
91+
fi

.github/workflows/release.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
packages: write
11+
12+
jobs:
13+
test:
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest, macos-latest, windows-latest]
17+
runs-on: ${{ matrix.os }}
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v6
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Set up Go
25+
uses: actions/setup-go@v6
26+
with:
27+
go-version-file: go.mod
28+
29+
- name: Run tests
30+
run: go test ./... -v
31+
32+
release:
33+
needs: [test]
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v6
38+
with:
39+
fetch-depth: 0
40+
41+
- name: Set up Go
42+
uses: actions/setup-go@v6
43+
with:
44+
go-version-file: go.mod
45+
46+
- name: Set up Docker Buildx
47+
uses: docker/setup-buildx-action@v3
48+
49+
- name: Log in to GHCR
50+
uses: docker/login-action@v3
51+
with:
52+
registry: ghcr.io
53+
username: ${{ github.actor }}
54+
password: ${{ secrets.GITHUB_TOKEN }}
55+
56+
- name: Run GoReleaser
57+
uses: goreleaser/goreleaser-action@v6
58+
with:
59+
version: "~> v2"
60+
args: release --clean
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# General macOS
2+
.DS_Store
3+
4+
# Local test helpers
5+
bxml_server.py
6+
callback_server.py
7+
8+
# Go build output
9+
/band
10+
dist/
11+
*.test
12+
13+
# Documentation (generated)
14+
docs/
15+
16+
# IDE/tooling
17+
.serena/
18+
.claude/
19+
.obsidian/
20+
.worktrees

.golangci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: "2"
2+
3+
linters:
4+
default: standard
5+
disable:
6+
- errcheck

.goreleaser.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
version: 2
2+
3+
builds:
4+
- main: ./cmd/band
5+
binary: band
6+
env:
7+
- CGO_ENABLED=0
8+
goos:
9+
- linux
10+
- darwin
11+
- windows
12+
goarch:
13+
- amd64
14+
- arm64
15+
ldflags:
16+
- -s -w -X github.com/Bandwidth/cli/cmd.version={{.Version}}
17+
18+
archives:
19+
- format: tar.gz
20+
name_template: "band_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
21+
format_overrides:
22+
- goos: windows
23+
format: zip
24+
25+
checksum:
26+
name_template: "checksums.txt"
27+
28+
dockers:
29+
- image_templates:
30+
- "ghcr.io/bandwidth/cli:{{ .Version }}-amd64"
31+
use: buildx
32+
build_flag_templates:
33+
- "--platform=linux/amd64"
34+
goarch: amd64
35+
dockerfile: Dockerfile.goreleaser
36+
- image_templates:
37+
- "ghcr.io/bandwidth/cli:{{ .Version }}-arm64"
38+
use: buildx
39+
build_flag_templates:
40+
- "--platform=linux/arm64"
41+
goarch: arm64
42+
dockerfile: Dockerfile.goreleaser
43+
44+
docker_manifests:
45+
- name_template: "ghcr.io/bandwidth/cli:{{ .Version }}"
46+
image_templates:
47+
- "ghcr.io/bandwidth/cli:{{ .Version }}-amd64"
48+
- "ghcr.io/bandwidth/cli:{{ .Version }}-arm64"
49+
- name_template: "ghcr.io/bandwidth/cli:latest"
50+
image_templates:
51+
- "ghcr.io/bandwidth/cli:{{ .Version }}-amd64"
52+
- "ghcr.io/bandwidth/cli:{{ .Version }}-arm64"
53+
54+
brews:
55+
- repository:
56+
owner: Bandwidth
57+
name: homebrew-tap
58+
token: "{{ .Env.HOMEBREW_TAP_TOKEN }}"
59+
pull_request:
60+
enabled: true
61+
base:
62+
owner: Bandwidth
63+
name: homebrew-tap
64+
branch: main
65+
homepage: "https://github.com/Bandwidth/cli"
66+
description: "Bandwidth CLI — manage voice, messaging, numbers, and more from the command line"
67+
license: "MIT"
68+
install: |
69+
bin.install "band"
70+
test: |
71+
system "#{bin}/band", "version"
72+
73+
changelog:
74+
sort: asc
75+
filters:
76+
exclude:
77+
- "^docs:"
78+
- "^test:"
79+
- "^chore:"

0 commit comments

Comments
 (0)