Skip to content

Commit 23bdaf0

Browse files
committed
Rewrite serpapi-cli in Go (v0.2.0)
Complete rewrite from Rust to Go. Maintains the same CLI interface (serpapi search/account/archive/locations/login) while simplifying the build and enabling homebrew-core distribution. Changes: - Remove Rust source (src/, Cargo.toml, Cross.toml, tests/*.rs) - Add Go module with minimal deps: cobra, tidwall/pretty, briandowns/spinner, BurntSushi/toml, gojq, golang.org/x/term - cmd/serpapi/main.go: entry point - pkg/api/client.go: HTTP client; io.LimitReader(100MB); raw json.RawMessage responses to preserve key order; SetEscapeHTML(false) throughout - pkg/cmd/: cobra commands for search (single + --all-pages pagination), account, archive, locations, login - pkg/config/: atomic config write (0600), Windows-safe os.Remove before rename - pkg/output/: tidwall/pretty color output on TTY, plain JSON on pipes - pkg/errors/: redacts api_key from error messages - pkg/spinner/: briandowns/spinner on stderr, TTY-aware - pkg/jq/: gojq integration with UseNumber() for integer fidelity - pkg/params/: key=value CLI arg parser - tests/e2e_test.go: 10 end-to-end tests covering all commands - .gitignore: root-anchor /serpapi binary, add tmp/
1 parent 570395c commit 23bdaf0

Some content is hidden

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

47 files changed

+1810
-3687
lines changed

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
/target
1+
# Go binary
2+
/serpapi
3+
/serpapi-test-bin
4+
5+
# IDE
6+
.idea/
7+
.vscode/
8+
tmp/

0 commit comments

Comments
 (0)