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
29 changes: 29 additions & 0 deletions .github/actions/setup-go/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Setup Go
description: 'Sets up Go environment with private modules'
inputs:
stainless-api-key:
required: false
description: the value of the STAINLESS_API_KEY secret
runs:
using: composite
steps:
- uses: stainless-api/retrieve-github-access-token@v1
if: github.repository == 'stainless-sdks/beeper-desktop-api-cli'
id: get_token
with:
repo: stainless-sdks/beeper-desktop-api-go
stainless-api-key: ${{ inputs.stainless-api-key }}

- name: Configure Git for access to the Go SDK's staging repo
if: github.repository == 'stainless-sdks/beeper-desktop-api-cli'
shell: bash
run: git config --global url."https://x-access-token:${{ steps.get_token.outputs.github_access_token }}@github.com/stainless-sdks/beeper-desktop-api-go".insteadOf "https://github.com/stainless-sdks/beeper-desktop-api-go"

- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: ./go.mod

- name: Bootstrap
shell: bash
run: ./scripts/bootstrap
47 changes: 32 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
name: CI
on:
push:
branches-ignore:
- 'generated'
- 'codegen/**'
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
branches:
- '**'
- '!integrated/**'
- '!stl-preview-head/**'
- '!stl-preview-base/**'
- '!generated'
- '!codegen/**'
- 'codegen/stl/**'
pull_request:
branches-ignore:
- 'stl-preview-head/**'
- 'stl-preview-base/**'

env:
GOPRIVATE: github.com/beeper/desktop-api-go,github.com/stainless-sdks/beeper-desktop-api-go

jobs:
lint:
timeout-minutes: 10
Expand All @@ -22,10 +27,14 @@ jobs:
steps:
- uses: actions/checkout@v6

- name: Setup go
uses: actions/setup-go@v5
- uses: ./.github/actions/setup-go
with:
go-version-file: ./go.mod
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}

- name: Link staging branch
if: github.repository == 'stainless-sdks/beeper-desktop-api-cli'
run: |
./scripts/link 'github.com/stainless-sdks/beeper-desktop-api-go@${{ github.ref_name }}' || true

- name: Bootstrap
run: ./scripts/bootstrap
Expand All @@ -44,10 +53,14 @@ jobs:
steps:
- uses: actions/checkout@v6

- name: Setup go
uses: actions/setup-go@v5
- uses: ./.github/actions/setup-go
with:
go-version-file: ./go.mod
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}

- name: Link staging branch
if: github.repository == 'stainless-sdks/beeper-desktop-api-cli'
run: |
./scripts/link 'github.com/stainless-sdks/beeper-desktop-api-go@${{ github.ref_name }}' || true

- name: Bootstrap
run: ./scripts/bootstrap
Expand Down Expand Up @@ -87,10 +100,14 @@ jobs:
steps:
- uses: actions/checkout@v6

- name: Setup go
uses: actions/setup-go@v5
- uses: ./.github/actions/setup-go
with:
go-version-file: ./go.mod
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}

- name: Link staging branch
if: github.repository == 'stainless-sdks/beeper-desktop-api-cli'
run: |
./scripts/link 'github.com/stainless-sdks/beeper-desktop-api-go@${{ github.ref_name }}' || true

- name: Bootstrap
run: ./scripts/bootstrap
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.2.0"
".": "0.3.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 23
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/beeper%2Fbeeper-desktop-api-5a8ac7b545c48dc892e5c680303e305254921554dabee848e40a808659dbcf1e.yml
openapi_spec_hash: 0103975601aac1445d3a4ef418c5d17a
config_hash: aa49273410d42fb96c5515dbce1f182f
config_hash: ca148af6be59ec54295b2c5f852a38d1
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# Changelog

## 0.3.0 (2026-03-19)

Full Changelog: [v0.2.0...v0.3.0](https://github.com/beeper/desktop-api-cli/compare/v0.2.0...v0.3.0)

### Features

* **api:** manual updates ([0770d3a](https://github.com/beeper/desktop-api-cli/commit/0770d3ad509df79341bb1067de910a4ececdc07e))


### Bug Fixes

* avoid reading from stdin unless request body is form encoded or json ([040b555](https://github.com/beeper/desktop-api-cli/commit/040b5552613ef61130225e1f6cf81ab213d3a4a9))
* better support passing client args in any position ([9100cf6](https://github.com/beeper/desktop-api-cli/commit/9100cf6e1ee5b4e7c7bcb262636fe3f458224cd4))
* fix for test cases with newlines in YAML and better error reporting ([c997492](https://github.com/beeper/desktop-api-cli/commit/c9974925c5d60aa534b8d619e51594cab0d622f0))
* improve linking behavior when developing on a branch not in the Go SDK ([c5964a1](https://github.com/beeper/desktop-api-cli/commit/c5964a17c6203b0de179d6c73c62665c8c33e364))
* improved workflow for developing on branches ([e7e8488](https://github.com/beeper/desktop-api-cli/commit/e7e84887ed26fb2de032a1960ea881fb15c7b3c4))
* no longer require an API key when building on production repos ([f38af96](https://github.com/beeper/desktop-api-cli/commit/f38af96666a55ffd4014c4f6190f5807df8b740e))
* only set client options when the corresponding CLI flag or env var is explicitly set ([923b0eb](https://github.com/beeper/desktop-api-cli/commit/923b0ebdeeafe5aa17f416651d82ee20c643fd16))


### Chores

* **internal:** codegen related update ([2a0195e](https://github.com/beeper/desktop-api-cli/commit/2a0195ef893339e931434cc30db149f45a0479aa))
* **internal:** tweak CI branches ([e727f07](https://github.com/beeper/desktop-api-cli/commit/e727f07b8f5f6792c0e67fd6a048cfdd91ab3ba3))

## 0.2.0 (2026-03-06)

Full Changelog: [v0.1.1...v0.2.0](https://github.com/beeper/desktop-api-cli/compare/v0.1.1...v0.2.0)
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

The official CLI for the [Beeper Desktop REST API](https://developers.beeper.com/desktop-api/).

It is generated with [Stainless](https://www.stainless.com/).

<!-- x-release-please-start-version -->

## Installation
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/beeper/desktop-api-cli
go 1.25

require (
github.com/beeper/desktop-api-go v0.4.0
github.com/beeper/desktop-api-go v0.5.0
github.com/charmbracelet/bubbles v0.21.0
github.com/charmbracelet/bubbletea v1.3.6
github.com/charmbracelet/lipgloss v1.1.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiE
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
github.com/aymanbagabas/go-udiff v0.2.0 h1:TK0fH4MteXUDspT88n8CKzvK0X9O2xu9yQjWpi6yML8=
github.com/aymanbagabas/go-udiff v0.2.0/go.mod h1:RE4Ex0qsGkTAJoQdQQCA0uG+nAzJO/pI/QwceO5fgrA=
github.com/beeper/desktop-api-go v0.4.0 h1:cSZLj1pSVD7pAdBOwiHkSzpXDoWjzJCRfb7lDtW5POM=
github.com/beeper/desktop-api-go v0.4.0/go.mod h1:y9Mk83OdQWo6ldLTcPyaUPrwjkmvy/3QkhHqZLhU/mA=
github.com/beeper/desktop-api-go v0.5.0 h1:0Myrz8eop5dC3/QseUrbYVIyWkHPGLyU47/lffw/kT4=
github.com/beeper/desktop-api-go v0.5.0/go.mod h1:y9Mk83OdQWo6ldLTcPyaUPrwjkmvy/3QkhHqZLhU/mA=
github.com/charmbracelet/bubbles v0.21.0 h1:9TdC97SdRVg/1aaXNVWfFH3nnLAwOXr8Fn6u6mfQdFs=
github.com/charmbracelet/bubbles v0.21.0/go.mod h1:HF+v6QUR4HkEpz62dx7ym2xc71/KBHg+zKwJtMw+qtg=
github.com/charmbracelet/bubbletea v1.3.6 h1:VkHIxPJQeDt0aFJIsVxw8BQdh/F/L2KKZGsK6et5taU=
Expand Down
8 changes: 8 additions & 0 deletions internal/requestflag/requestflag.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,14 @@ func (f *Flag[T]) Count() int {
return f.count
}

// Implementation for the cli.LocalFlag interface
var _ cli.LocalFlag = (*Flag[any])(nil) // Type assertion to ensure interface compliance

func (f Flag[T]) IsLocal() bool {
// By default, all request flags are local, i.e. can be provided at any part of the CLI command.
return true
}

// cliValue is a generic implementation of cli.Value for common types
type cliValue[
T []any | []map[string]any | []DateTimeValue | []DateValue | []TimeValue | []string | []float64 |
Expand Down
3 changes: 2 additions & 1 deletion pkg/cmd/account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import (
func TestAccountsList(t *testing.T) {
t.Run("regular flags", func(t *testing.T) {
mocktest.TestRunMockTestWithFlags(
t, "accounts", "list",
t,
"--access-token", "string",
"accounts", "list",
)
})
}
6 changes: 4 additions & 2 deletions pkg/cmd/accountcontact_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import (
func TestAccountsContactsList(t *testing.T) {
t.Run("regular flags", func(t *testing.T) {
mocktest.TestRunMockTestWithFlags(
t, "accounts:contacts", "list",
t,
"--access-token", "string",
"accounts:contacts", "list",
"--max-items", "10",
"--account-id", "accountID",
"--cursor", "1725489123456|c29tZUltc2dQYWdl",
Expand All @@ -26,8 +27,9 @@ func TestAccountsContactsList(t *testing.T) {
func TestAccountsContactsSearch(t *testing.T) {
t.Run("regular flags", func(t *testing.T) {
mocktest.TestRunMockTestWithFlags(
t, "accounts:contacts", "search",
t,
"--access-token", "string",
"accounts:contacts", "search",
"--account-id", "accountID",
"--query", "x",
)
Expand Down
21 changes: 14 additions & 7 deletions pkg/cmd/asset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import (
func TestAssetsDownload(t *testing.T) {
t.Run("regular flags", func(t *testing.T) {
mocktest.TestRunMockTestWithFlags(
t, "assets", "download",
t,
"--access-token", "string",
"assets", "download",
"--url", "mxc://example.org/Q4x9CqGz1pB3Oa6XgJ",
)
})
Expand All @@ -21,17 +22,19 @@ func TestAssetsDownload(t *testing.T) {
// Test piping YAML data over stdin
pipeData := []byte("url: mxc://example.org/Q4x9CqGz1pB3Oa6XgJ")
mocktest.TestRunMockTestWithPipeAndFlags(
t, pipeData, "assets", "download",
t, pipeData,
"--access-token", "string",
"assets", "download",
)
})
}

func TestAssetsServe(t *testing.T) {
t.Run("regular flags", func(t *testing.T) {
mocktest.TestRunMockTestWithFlags(
t, "assets", "serve",
t,
"--access-token", "string",
"assets", "serve",
"--url", "x",
)
})
Expand All @@ -40,8 +43,9 @@ func TestAssetsServe(t *testing.T) {
func TestAssetsUpload(t *testing.T) {
t.Run("regular flags", func(t *testing.T) {
mocktest.TestRunMockTestWithFlags(
t, "assets", "upload",
t,
"--access-token", "string",
"assets", "upload",
"--file", "Example data",
"--file-name", "fileName",
"--mime-type", "mimeType",
Expand All @@ -55,17 +59,19 @@ func TestAssetsUpload(t *testing.T) {
"fileName: fileName\n" +
"mimeType: mimeType\n")
mocktest.TestRunMockTestWithPipeAndFlags(
t, pipeData, "assets", "upload",
t, pipeData,
"--access-token", "string",
"assets", "upload",
)
})
}

func TestAssetsUploadBase64(t *testing.T) {
t.Run("regular flags", func(t *testing.T) {
mocktest.TestRunMockTestWithFlags(
t, "assets", "upload-base64",
t,
"--access-token", "string",
"assets", "upload-base64",
"--content", "x",
"--file-name", "fileName",
"--mime-type", "mimeType",
Expand All @@ -79,8 +85,9 @@ func TestAssetsUploadBase64(t *testing.T) {
"fileName: fileName\n" +
"mimeType: mimeType\n")
mocktest.TestRunMockTestWithPipeAndFlags(
t, pipeData, "assets", "upload-base64",
t, pipeData,
"--access-token", "string",
"assets", "upload-base64",
)
})
}
9 changes: 6 additions & 3 deletions pkg/cmd/beeperdesktopapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import (
func TestFocus(t *testing.T) {
t.Run("regular flags", func(t *testing.T) {
mocktest.TestRunMockTestWithFlags(
t, "focus",
t,
"--access-token", "string",
"focus",
"--chat-id", "!NCdzlIaMjZUmvmvyHU:beeper.com",
"--draft-attachment-path", "draftAttachmentPath",
"--draft-text", "draftText",
Expand All @@ -28,17 +29,19 @@ func TestFocus(t *testing.T) {
"draftText: draftText\n" +
"messageID: messageID\n")
mocktest.TestRunMockTestWithPipeAndFlags(
t, pipeData, "focus",
t, pipeData,
"--access-token", "string",
"focus",
)
})
}

func TestSearch(t *testing.T) {
t.Run("regular flags", func(t *testing.T) {
mocktest.TestRunMockTestWithFlags(
t, "search",
t,
"--access-token", "string",
"search",
"--query", "x",
)
})
Expand Down
Loading
Loading