Skip to content

Commit 013dda2

Browse files
release: 0.4.0 (#5)
* codegen metadata * codegen metadata * codegen metadata * codegen metadata * codegen metadata * feat(api): api update * codegen metadata * codegen metadata * codegen metadata * chore(cli): let `--format raw` be used in conjunction with `--transform` * codegen metadata * feat(api): api update * codegen metadata * feat(api): api update * codegen metadata * chore(cli): additional test cases for `ShowJSONIterator` * fix: fix for failing to drop invalid module replace in link script * codegen metadata * codegen metadata * chore: add documentation for ./scripts/link * chore(cli): fall back to JSON when using default "explore" with non-TTY * feat(cli): alias parameters in data with `x-stainless-cli-data-alias` * chore(cli): switch long lists of positional args over to param structs * chore(ci): support manually triggering release workflow * feat(cli): send filename and content type when reading input from files * feat(cli): add `--raw-output`/`-r` option to print raw (non-JSON) strings * chore(cli): use `ShowJSONOpts` as argument to `formatJSON` instead of many positionals * chore: sync OpenAPI spec * chore: wire production_repo for all targets * fix: escape ampersand in OpenAPI summaries for C# XML docs * chore(internal): codegen related update * chore(internal): more robust bootstrap script * release: 0.4.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent cef589d commit 013dda2

83 files changed

Lines changed: 1552 additions & 1008 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/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Link staging branch
3535
if: github.repository == 'stainless-sdks/x-twitter-scraper-cli'
3636
run: |
37-
./scripts/link 'github.com/stainless-sdks/x-twitter-scraper-go@${{ github.ref_name }}' || go mod edit -dropreplace='github.com/stainless-sdks/x-twitter-scraper-go'
37+
./scripts/link 'github.com/stainless-sdks/x-twitter-scraper-go@${{ github.ref_name }}' || true
3838
3939
- name: Bootstrap
4040
run: ./scripts/bootstrap
@@ -60,7 +60,7 @@ jobs:
6060
- name: Link staging branch
6161
if: github.repository == 'stainless-sdks/x-twitter-scraper-cli'
6262
run: |
63-
./scripts/link 'github.com/stainless-sdks/x-twitter-scraper-go@${{ github.ref_name }}' || go mod edit -dropreplace='github.com/stainless-sdks/x-twitter-scraper-go'
63+
./scripts/link 'github.com/stainless-sdks/x-twitter-scraper-go@${{ github.ref_name }}' || true
6464
6565
- name: Bootstrap
6666
run: ./scripts/bootstrap
@@ -107,7 +107,7 @@ jobs:
107107
- name: Link staging branch
108108
if: github.repository == 'stainless-sdks/x-twitter-scraper-cli'
109109
run: |
110-
./scripts/link 'github.com/stainless-sdks/x-twitter-scraper-go@${{ github.ref_name }}' || go mod edit -dropreplace='github.com/stainless-sdks/x-twitter-scraper-go'
110+
./scripts/link 'github.com/stainless-sdks/x-twitter-scraper-go@${{ github.ref_name }}' || true
111111
112112
- name: Bootstrap
113113
run: ./scripts/bootstrap

.github/workflows/publish-release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
push:
1111
tags:
1212
- "v*"
13+
workflow_dispatch: {}
1314
jobs:
1415
goreleaser:
1516
runs-on: ubuntu-latest

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.3.0"
2+
".": "0.4.0"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 117
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik%2Fx-twitter-scraper-d40c57a05527faf060d21c0e013729f371d88017b10680cea7c8fd6780ffaef5.yml
3-
openapi_spec_hash: 597ebc460cf86740b9f6f7c95478dece
4-
config_hash: 30ce23c9cfbf8fb8be9e5dd28a2124fa
1+
configured_endpoints: 110
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik%2Fx-twitter-scraper-2adc33156b4b42a4be18cc20c0205b38f0432d7958da99c65ee9b3f6a555ea0e.yml
3+
openapi_spec_hash: be760f5620a268521d6793f65576a61f
4+
config_hash: 320a9cb2f1293d1a7b73c63ab5865af5

CHANGELOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,44 @@
11
# Changelog
22

3+
## 0.4.0 (2026-04-25)
4+
5+
Full Changelog: [v0.3.0...v0.4.0](https://github.com/Xquik-dev/x-twitter-scraper-cli/compare/v0.3.0...v0.4.0)
6+
7+
### Features
8+
9+
* **api:** api update ([e9d6bea](https://github.com/Xquik-dev/x-twitter-scraper-cli/commit/e9d6beaf3b434b0c063fb0a25d92da9aebc8c970))
10+
* **api:** api update ([607c495](https://github.com/Xquik-dev/x-twitter-scraper-cli/commit/607c49591bc8d2f0c93a99ba360f46540373b4c4))
11+
* **api:** api update ([7197e8f](https://github.com/Xquik-dev/x-twitter-scraper-cli/commit/7197e8f7ae0b37957eec880dd03a9786eb23caa8))
12+
* **cli:** add `--raw-output`/`-r` option to print raw (non-JSON) strings ([28be4fa](https://github.com/Xquik-dev/x-twitter-scraper-cli/commit/28be4fac015d4fa532e8714b15634baafab111c0))
13+
* **cli:** alias parameters in data with `x-stainless-cli-data-alias` ([96d1bfc](https://github.com/Xquik-dev/x-twitter-scraper-cli/commit/96d1bfca315fcfa3b602b6007e6452efc7ef869b))
14+
* **cli:** send filename and content type when reading input from files ([4dc5824](https://github.com/Xquik-dev/x-twitter-scraper-cli/commit/4dc58248eec53b50faf98eb2869e27ddf15618d4))
15+
16+
17+
### Bug Fixes
18+
19+
* escape ampersand in OpenAPI summaries for C# XML docs ([6d5da37](https://github.com/Xquik-dev/x-twitter-scraper-cli/commit/6d5da374e3a40fcaf3d31945666770843d537ee5))
20+
* fix for failing to drop invalid module replace in link script ([a086faf](https://github.com/Xquik-dev/x-twitter-scraper-cli/commit/a086fafbb77d57fb4b2c1330e526c299b2c8e0de))
21+
22+
23+
### Chores
24+
25+
* add documentation for ./scripts/link ([1fe38e3](https://github.com/Xquik-dev/x-twitter-scraper-cli/commit/1fe38e359d3863fc12c588dcd2db8164a67a10e1))
26+
* **ci:** support manually triggering release workflow ([c947c68](https://github.com/Xquik-dev/x-twitter-scraper-cli/commit/c947c68b51f8141b8ed6030b641f34ef783c53e3))
27+
* **cli:** additional test cases for `ShowJSONIterator` ([3d20d69](https://github.com/Xquik-dev/x-twitter-scraper-cli/commit/3d20d69c87f77ece9fb46b3f58da0948fa21f601))
28+
* **cli:** fall back to JSON when using default "explore" with non-TTY ([f48c1f0](https://github.com/Xquik-dev/x-twitter-scraper-cli/commit/f48c1f013e9c850b7780e4d1760dca7ac16f62b8))
29+
* **cli:** let `--format raw` be used in conjunction with `--transform` ([5a0010a](https://github.com/Xquik-dev/x-twitter-scraper-cli/commit/5a0010abd09ae3e5d51b8a3536a4b662b328bd8e))
30+
* **cli:** switch long lists of positional args over to param structs ([21a0bc9](https://github.com/Xquik-dev/x-twitter-scraper-cli/commit/21a0bc997e853879adc640cc2114861ab9f4018a))
31+
* **cli:** use `ShowJSONOpts` as argument to `formatJSON` instead of many positionals ([9a34472](https://github.com/Xquik-dev/x-twitter-scraper-cli/commit/9a344724e7f20169211f27eb1f3d3122a7aa78ca))
32+
* **internal:** codegen related update ([f783c02](https://github.com/Xquik-dev/x-twitter-scraper-cli/commit/f783c028f7ca4fbd5dd87b83488930c007598a8f))
33+
* **internal:** more robust bootstrap script ([262e4d3](https://github.com/Xquik-dev/x-twitter-scraper-cli/commit/262e4d3ee4b8d64258ffda8ca1f8d283bdbc35bf))
34+
* sync OpenAPI spec ([0f0687b](https://github.com/Xquik-dev/x-twitter-scraper-cli/commit/0f0687b9a0ea1e35149eb38d2899c649a1991195))
35+
* wire production_repo for all targets ([d46e8ec](https://github.com/Xquik-dev/x-twitter-scraper-cli/commit/d46e8ecbc08aac3f02d31b6d2674a19f27393662))
36+
37+
38+
### Documentation
39+
40+
* add Contributor Covenant 2.1 Code of Conduct ([#2192](https://github.com/Xquik-dev/x-twitter-scraper-cli/issues/2192)) ([c253bcb](https://github.com/Xquik-dev/x-twitter-scraper-cli/commit/c253bcbbef2f104a891f63807058763a505162a3))
41+
342
## 0.3.0 (2026-04-08)
443

544
Full Changelog: [v0.2.0...v0.3.0](https://github.com/Xquik-dev/x-twitter-scraper-cli/compare/v0.2.0...v0.3.0)

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,23 @@ base64-encoding). Note that absolute paths will begin with `@file://` or
115115
```bash
116116
x-twitter-scraper <command> --arg @data://file.txt
117117
```
118+
119+
## Linking different Go SDK versions
120+
121+
You can link the CLI against a different version of the X Twitter Scraper Go SDK
122+
for development purposes using the `./scripts/link` script.
123+
124+
To link to a specific version from a repository (version can be a branch,
125+
git tag, or commit hash):
126+
127+
```bash
128+
./scripts/link github.com/org/repo@version
129+
```
130+
131+
To link to a local copy of the SDK:
132+
133+
```bash
134+
./scripts/link ../path/to/xtwitterscraper-go
135+
```
136+
137+
If you run the link script without any arguments, it will default to `../xtwitterscraper-go`.

cmd/x-twitter-scraper/main.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ func main() {
4343
fmt.Fprintf(os.Stderr, "%s %q: %d %s\n", apierr.Request.Method, apierr.Request.URL, apierr.Response.StatusCode, http.StatusText(apierr.Response.StatusCode))
4444
format := app.String("format-error")
4545
json := gjson.Parse(apierr.RawJSON())
46-
show_err := cmd.ShowJSON(os.Stdout, "Error", json, format, app.String("transform-error"))
46+
show_err := cmd.ShowJSON(json, cmd.ShowJSONOpts{
47+
ExplicitFormat: app.IsSet("format-error"),
48+
Format: format,
49+
Title: "Error",
50+
Transform: app.String("transform-error"),
51+
})
4752
if show_err != nil {
4853
// Just print the original error:
4954
fmt.Fprintf(os.Stderr, "%s\n", err.Error())

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/Xquik-dev/x-twitter-scraper-cli
33
go 1.25
44

55
require (
6-
github.com/Xquik-dev/x-twitter-scraper-go v0.3.0
6+
github.com/Xquik-dev/x-twitter-scraper-go v0.4.0
77
github.com/charmbracelet/bubbles v0.21.0
88
github.com/charmbracelet/bubbletea v1.3.6
99
github.com/charmbracelet/lipgloss v1.1.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github.com/Xquik-dev/x-twitter-scraper-go v0.3.0 h1:Iu2ejXyVKqikAWAlCgfGNeav5Q+3/V6lscdmUKYGB/8=
2-
github.com/Xquik-dev/x-twitter-scraper-go v0.3.0/go.mod h1:OHW3aIR8E3+ANa/mjFTZs1sG7ePzrBEmW0a8JUN+NvI=
1+
github.com/Xquik-dev/x-twitter-scraper-go v0.4.0 h1:np1LceO4i48617H41xpm6kH7e57ZV11RMwCAdeVhTzc=
2+
github.com/Xquik-dev/x-twitter-scraper-go v0.4.0/go.mod h1:OHW3aIR8E3+ANa/mjFTZs1sG7ePzrBEmW0a8JUN+NvI=
33
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
44
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
55
github.com/aymanbagabas/go-udiff v0.2.0 h1:TK0fH4MteXUDspT88n8CKzvK0X9O2xu9yQjWpi6yML8=

internal/requestflag/innerflag.go

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,29 @@ type InnerFlag[
2222
Aliases []string // aliases that are allowed for this flag
2323
Validator func(T) error // custom function to validate this flag value
2424

25-
OuterFlag cli.Flag // The flag on which this inner flag will set values
26-
InnerField string // The inner field which this flag will set
25+
OuterFlag cli.Flag // The flag on which this inner flag will set values
26+
InnerField string // The inner field which this flag will set
27+
DataAliases []string // alternate names recognized in YAML values passed as the outer flag
28+
}
29+
30+
// GetDataAliases returns the aliases recognized when parsing inner field keys from piped or flag YAML.
31+
func (f *InnerFlag[T]) GetDataAliases() []string {
32+
return f.DataAliases
33+
}
34+
35+
// GetInnerField returns the API field name that this inner flag sets on its outer flag's value.
36+
// For example, the flag --parent.foo targeting a parameter whose OpenAPI property name is "foo"
37+
// would return "foo". This is distinct from the flag's CLI name and from any DataAliases entries.
38+
func (f *InnerFlag[T]) GetInnerField() string {
39+
return f.InnerField
2740
}
2841

2942
type HasOuterFlag interface {
3043
cli.Flag
3144
SetOuterFlag(cli.Flag)
3245
GetOuterFlag() cli.Flag
46+
GetInnerField() string
47+
GetDataAliases() []string
3348
}
3449

3550
func (f *InnerFlag[T]) SetOuterFlag(flag cli.Flag) {

0 commit comments

Comments
 (0)