Thanks to visit codestin.com
Credit goes to github.com

Skip to content

tamnd/oschina-cli

Repository files navigation

oschina

Browse OSChina open-source news (开源中国)

oschina is a single pure-Go binary. It reads OSChina (开源中国) — China's largest open-source community — through the public XML API, shapes the responses into clean records, and pipes into the rest of your tools. No API key, nothing to run alongside it.

Install

go install github.com/tamnd/oschina-cli/cmd/oschina@latest

Or grab a prebuilt binary from the releases, or run the container image:

docker run --rm ghcr.io/tamnd/oschina:latest --help

Usage

# latest open-source news
oschina news

# most popular / hot news
oschina news --type top

# page 2, 10 items
oschina news --page 2 --page-size 10

# JSON output
oschina news -o json

# URLs only
oschina news -o url

oschina version

Development

cmd/oschina/   thin main, wires cli.Root into fang
cli/           the cobra command tree
oschina/       the library: HTTP client and data models
pkg/render/    reflection-based multi-format renderer
docs/          tago documentation site
make build      # ./bin/oschina
make test       # go test ./...
make vet        # go vet ./...

Releasing

Push a version tag and GitHub Actions runs GoReleaser, which builds the archives, Linux packages, the multi-arch GHCR image, checksums, SBOMs, and a cosign signature:

git tag v0.1.0
git push --tags

The Homebrew and Scoop steps self-disable until their tokens exist, so the first release works with no extra secrets.

License

Apache-2.0. See LICENSE.

About

Read OSChina open-source news and hot posts via the public XML API as JSON

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors