Commit 23bdaf0
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
File tree
47 files changed
+1810
-3687
lines changed- cmd/serpapi
- pkg
- api
- cmd
- config
- errors
- jq
- output
- params
- spinner
- version
- src
- commands
- tests
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| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
0 commit comments