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

Skip to content

tamnd/segmentfault-cli

Repository files navigation

segmentfault

Browse questions from the SegmentFault Q&A community from the command line.

segmentfault is a single pure-Go binary. No API key required.

Install

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

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

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

Usage

# List newest questions
segmentfault questions

# List questions sorted by votes, 2 pages (~60 questions)
segmentfault questions --sort votes --pages 2

# Table output with limit
segmentfault questions -n 10 -o table

# Output formats
segmentfault questions -o json
segmentfault questions -o csv -n 50
segmentfault questions -o jsonl

Commands

Command Description
questions List questions from SegmentFault
version Show version information

Questions flags

-s, --sort string    sort order: newest|votes|unanswered (default "newest")
-p, --pages int      number of pages to fetch (~30 items per page) (default 1)

Global flags

-o, --output string    output format: table|json|jsonl|csv|tsv|url|raw (default "auto")
-n, --limit int        limit number of records (0 = all on fetched pages)
    --fields strings   comma-separated columns to include
    --no-header        omit header row
    --template string  Go text/template per record
    --timeout duration per-request timeout (default 30s)
    --delay duration   minimum spacing between requests
    --retries int      retry attempts on 429/5xx (default 3)

License

Apache-2.0. See LICENSE.

About

Browse SegmentFault questions, answers, and tags as JSON, CSV, or JSONL from the terminal

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors