⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
c57f02a
feat(api): add cli
stainless-app[bot] Jan 24, 2026
eded84a
feat(cli): improve shell completions for namespaced commands and flags
stainless-app[bot] Jan 29, 2026
7c4554a
fix: fix mock tests with inner fields that have underscores
stainless-app[bot] Jan 29, 2026
49ca642
feat!: add support for passing files as parameters
stainless-app[bot] Jan 29, 2026
de2984b
fix: restore support for void endpoints
stainless-app[bot] Jan 29, 2026
06bc1c7
fix: use RawJSON for iterated values instead of re-marshalling
stainless-app[bot] Jan 29, 2026
5f10511
fix: fix for nullable arguments
stainless-app[bot] Jan 29, 2026
f2bddcf
chore: add build step to ci
stainless-app[bot] Jan 30, 2026
5633fad
chore: update documentation in readme
stainless-app[bot] Jan 30, 2026
f26b475
fix: fix for file uploads to octet stream and form encoding endpoints
stainless-app[bot] Jan 30, 2026
f7b1b4a
feat: add readme documentation for passing files as arguments
stainless-app[bot] Jan 30, 2026
b66f2b5
feat(api): manual updates
stainless-app[bot] Jan 31, 2026
bdf34ce
feat(client): provide file completions when using file embed syntax
stainless-app[bot] Feb 3, 2026
6987a4c
chore(internal): codegen related update
stainless-app[bot] Feb 5, 2026
eba0a3f
fix: fix for when terminal width is not available
stainless-app[bot] Feb 6, 2026
8c8fa87
feat: improved support for passing files for `any`-typed arguments
stainless-app[bot] Feb 11, 2026
c230cef
fix: preserve filename in content-disposition for file uploads
stainless-app[bot] Feb 11, 2026
d041e0b
release: 0.1.0
stainless-app[bot] Feb 11, 2026
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
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,48 @@ jobs:
- name: Run lints
run: ./scripts/lint

build:
timeout-minutes: 10
name: build
permissions:
contents: read
id-token: write
runs-on: ${{ github.repository == 'stainless-sdks/beeper-desktop-api-cli' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v6

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

- name: Bootstrap
run: ./scripts/bootstrap

- name: Run goreleaser
uses: goreleaser/goreleaser-action@v6.1.0
with:
version: latest
args: release --snapshot --clean --skip=publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get GitHub OIDC Token
if: github.repository == 'stainless-sdks/beeper-desktop-api-cli'
id: github-oidc
uses: actions/github-script@v8
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Upload tarball
if: github.repository == 'stainless-sdks/beeper-desktop-api-cli'
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
SHA: ${{ github.sha }}
run: ./scripts/utils/upload-artifact.sh

test:
timeout-minutes: 10
name: test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
release_doctor:
name: release doctor
runs-on: ubuntu-latest
if: github.repository == 'stainless-sdks/beeper-desktop-api-cli' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
if: github.repository == 'beeper/desktop-api-cli' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')

steps:
- uses: actions/checkout@v6
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.0.1"
".": "0.1.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 18
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/beeper%2Fbeeper-desktop-api-5fb80d7f97f2428d1826b9c381476f0d46117fc694140175dbc15920b1884f1f.yml
openapi_spec_hash: 06f8538bc0a27163d33a80c00fb16e86
config_hash: f10bf15270915c249c8c38316ffa83a7
configured_endpoints: 19
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/beeper%2Fbeeper-desktop-api-099d55ac0e749a64dacc1706d7d8276d1acbe52103f0419393c39e8911966cfe.yml
openapi_spec_hash: 70a1b1d513b62c6d6caabbbf360220b4
config_hash: 48ff2d23c2ebc82bd3c15787f0041684
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Changelog

## 0.1.0 (2026-02-11)

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

### ⚠ BREAKING CHANGES

* add support for passing files as parameters

### Features

* add readme documentation for passing files as arguments ([f7b1b4a](https://github.com/beeper/desktop-api-cli/commit/f7b1b4af1c7220c9cd21afc58aba32508504073b))
* add support for passing files as parameters ([49ca642](https://github.com/beeper/desktop-api-cli/commit/49ca642691b546494d700c2f782aa8ae88d9767e))
* **api:** add cli ([c57f02a](https://github.com/beeper/desktop-api-cli/commit/c57f02af602f2def16c59c1ba1db4059ff2b0fd5))
* **api:** add upload asset and edit message endpoints ([da2ca66](https://github.com/beeper/desktop-api-cli/commit/da2ca66a4910e80ffd919fd8105b026497b9a0ea))
* **api:** manual updates ([b66f2b5](https://github.com/beeper/desktop-api-cli/commit/b66f2b5c68eb90c5644faf0c1f2fc67a94f100cb))
* **client:** provide file completions when using file embed syntax ([bdf34ce](https://github.com/beeper/desktop-api-cli/commit/bdf34cecc8cdbd2e9d19dade4616970bfd43ae6a))
* **cli:** improve shell completions for namespaced commands and flags ([eded84a](https://github.com/beeper/desktop-api-cli/commit/eded84a5cc05bb700f5d0c50add30ec257738aa0))
* improved support for passing files for `any`-typed arguments ([8c8fa87](https://github.com/beeper/desktop-api-cli/commit/8c8fa8743cbfd67e8ddbf165a06c151d319e2612))


### Bug Fixes

* fix for file uploads to octet stream and form encoding endpoints ([f26b475](https://github.com/beeper/desktop-api-cli/commit/f26b475dce7f9eb0cc9fa5a20c26667e1c32fc1a))
* fix for nullable arguments ([5f10511](https://github.com/beeper/desktop-api-cli/commit/5f105117110982a972554fb9ab720b354829bae4))
* fix for when terminal width is not available ([eba0a3f](https://github.com/beeper/desktop-api-cli/commit/eba0a3f905f7eb7bc3cd9a8f571713e5bdff1f87))
* fix mock tests with inner fields that have underscores ([7c4554a](https://github.com/beeper/desktop-api-cli/commit/7c4554a35871394eeed6927ee401ce7cc6fe99b8))
* preserve filename in content-disposition for file uploads ([c230cef](https://github.com/beeper/desktop-api-cli/commit/c230cefdf540e6d49e102cbb9cb9010625be04c6))
* restore support for void endpoints ([de2984b](https://github.com/beeper/desktop-api-cli/commit/de2984b4cec53693f0b5b684cdc498c410211a82))
* use RawJSON for iterated values instead of re-marshalling ([06bc1c7](https://github.com/beeper/desktop-api-cli/commit/06bc1c7a0ba890d76e2c210476ad1d7586cd069a))


### Chores

* add build step to ci ([f2bddcf](https://github.com/beeper/desktop-api-cli/commit/f2bddcf00a9a3faacf1a1a8293f3f46b7befe187))
* configure new SDK language ([6db7b30](https://github.com/beeper/desktop-api-cli/commit/6db7b300c46fd6331b4bada5759f5e31ed5a0b56))
* configure new SDK language ([388b391](https://github.com/beeper/desktop-api-cli/commit/388b3910792deb197365fc9e5fbf266260845d9e))
* **internal:** codegen related update ([6987a4c](https://github.com/beeper/desktop-api-cli/commit/6987a4c5870caa9323a8be80124069fc5f28d45a))
* update documentation in readme ([5633fad](https://github.com/beeper/desktop-api-cli/commit/5633fad79b0a5db1d66b83a58d1d0e8fe7cf3f1d))
67 changes: 64 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,37 @@

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

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

## Installation

### Installing with Go

To test or install the CLI locally, you need [Go](https://go.dev/doc/install) version 1.22 or later installed.

```sh
go install 'github.com/beeper/desktop-api-cli/cmd/beeper-desktop-api@latest'
```

Once you have run `go install`, the binary is placed in your Go bin directory:

- **Default location**: `$HOME/go/bin` (or `$GOPATH/bin` if GOPATH is set)
- **Check your path**: Run `go env GOPATH` to see the base directory

If commands aren't found after installation, add the Go bin directory to your PATH:

```sh
go install 'github.com/stainless-sdks/beeper-desktop-api-cli/cmd/beeper-desktop-api@latest'
# Add to your shell profile (.zshrc, .bashrc, etc.)
export PATH="$PATH:$(go env GOPATH)/bin"
```

<!-- x-release-please-end -->

### Running Locally

After cloning the git repository for this project, you can use the
`scripts/run` script to run the tool locally:

```sh
./scripts/run args...
```
Expand All @@ -21,7 +42,7 @@ go install 'github.com/stainless-sdks/beeper-desktop-api-cli/cmd/beeper-desktop-
The CLI follows a resource-based command structure:

```sh
beeper-desktop-api [resource] [command] [flags]
beeper-desktop-api [resource] <command> [flags...]
```

```sh
Expand All @@ -43,7 +64,7 @@ beeper-desktop-api chats search \

For details about specific commands, use the `--help` flag.

## Global Flags
### Global Flags

- `--help` - Show command line usage
- `--debug` - Enable debug logging (includes HTTP request/response details)
Expand All @@ -53,3 +74,43 @@ For details about specific commands, use the `--help` flag.
- `--format-error` - Change the output format for errors (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)
- `--transform` - Transform the data output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)
- `--transform-error` - Transform the error output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)

### Passing files as arguments

To pass files to your API, you can use the `@myfile.ext` syntax:

```bash
beeper-desktop-api <command> --arg @abe.jpg
```

Files can also be passed inside JSON or YAML blobs:

```bash
beeper-desktop-api <command> --arg '{image: "@abe.jpg"}'
# Equivalent:
beeper-desktop-api <command> <<YAML
arg:
image: "@abe.jpg"
YAML
```

If you need to pass a string literal that begins with an `@` sign, you can
escape the `@` sign to avoid accidentally passing a file.

```bash
beeper-desktop-api <command> --username '\@abe'
```

#### Explicit encoding

For JSON endpoints, the CLI tool does filetype sniffing to determine whether the
file contents should be sent as a string literal (for plain text files) or as a
base64-encoded string literal (for binary files). If you need to explicitly send
the file as either plain text or base64-encoded data, you can use
`@file://myfile.txt` (for string encoding) or `@data://myfile.dat` (for
base64-encoding). Note that absolute paths will begin with `@file://` or
`@data://`, followed by a third `/` (for example, `@file:///tmp/file.txt`).

```bash
beeper-desktop-api <command> --arg @data://file.txt
```
27 changes: 25 additions & 2 deletions cmd/beeper-desktop-api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,29 @@ import (
"fmt"
"net/http"
"os"
"slices"

"github.com/beeper/desktop-api-cli/pkg/cmd"
"github.com/beeper/desktop-api-go"
"github.com/stainless-sdks/beeper-desktop-api-cli/pkg/cmd"
"github.com/tidwall/gjson"
"github.com/urfave/cli/v3"
)

func main() {
app := cmd.Command

if slices.Contains(os.Args, "__complete") {
prepareForAutocomplete(app)
}

if err := app.Run(context.Background(), os.Args); err != nil {
exitCode := 1

// Check if error has a custom exit code
if exitErr, ok := err.(cli.ExitCoder); ok {
exitCode = exitErr.ExitCode()
}

var apierr *beeperdesktopapi.Error
if errors.As(err, &apierr) {
fmt.Fprintf(os.Stderr, "%s %q: %d %s\n", apierr.Request.Method, apierr.Request.URL, apierr.Response.StatusCode, http.StatusText(apierr.Response.StatusCode))
Expand All @@ -30,6 +44,15 @@ func main() {
} else {
fmt.Fprintf(os.Stderr, "%s\n", err.Error())
}
os.Exit(1)
os.Exit(exitCode)
}
}

func prepareForAutocomplete(cmd *cli.Command) {
// urfave/cli does not handle flag completions and will print an error if we inspect a command with invalid flags.
// This skips that sort of validation
cmd.SkipFlagParsing = true
for _, child := range cmd.Commands {
prepareForAutocomplete(child)
}
}
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module github.com/stainless-sdks/beeper-desktop-api-cli
module github.com/beeper/desktop-api-cli

go 1.25

require (
github.com/beeper/desktop-api-go v0.1.0
github.com/beeper/desktop-api-go v0.2.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.1.0 h1:Cd8prDsvb2t3Bx50/aFtag3h7oiTefsvWmZwHK/2Esk=
github.com/beeper/desktop-api-go v0.1.0/go.mod h1:r37xr4oqM7zQ3VMCRPfnfLSmNC3VgSU+AeN4banq/P0=
github.com/beeper/desktop-api-go v0.2.0 h1:VrwB1FCEiuPycGo6TsYSVVSKQIWFg22xmlRWVJ88E0A=
github.com/beeper/desktop-api-go v0.2.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
Loading
Loading