Browse your timeline while looking like you're debugging JSON data.
Sometimes you want to check X without it being obvious. xjson displays tweets as JSON API responses - to anyone watching, you're just inspecting some API data.
{
"id": "1234567890",
"type": "status_update",
"endpoint": "/v2/statuses/1234567890",
"payload": {
"content": "Hello world!",
"author": {
"handle": "user123",
"display_name": "User Name"
},
"metrics": {
"impressions": 1520,
"likes": 45
}
}
}- View home timeline as JSON
- Search tweets
- Syntax-highlighted JSON output
- Vim-style navigation
- OAuth 2.0 authentication
- Rate limit handling
git clone https://github.com/YOUR_USERNAME/xjson.git
cd xjson
go build -o xjson .- Go 1.21+
- X Developer Account (free tier works)
- Go to X Developer Portal
- Create a Project and App
- In User authentication settings:
- Enable OAuth 2.0
- Set callback URL:
http://localhost:8080/callback - Request Read permissions
- Copy your Client ID
Create xjson.yaml in the project directory:
client_id: YOUR_CLIENT_ID
client_secret: YOUR_CLIENT_SECRET # optional for public clients
redirect_url: http://localhost:8080/callback./xjsonOn first run, it will open an auth URL - authorize in your browser and you're in.
| Key | Action |
|---|---|
j / ↓ |
Scroll down |
k / ↑ |
Scroll up |
n |
Next tweet |
p |
Previous tweet |
g |
Go to top |
G |
Go to bottom |
Ctrl+d |
Half page down |
Ctrl+u |
Half page up |
/ |
Search |
r |
Refresh |
t |
Back to timeline |
? |
Toggle help |
q |
Quit |
./xjson # Start the app
./xjson init # Create default config
./xjson auth # Manually authenticate
./xjson help # Show helpxjson/
├── main.go # Entry point & CLI
├── xjson.yaml # Config file
├── config/
│ └── config.go # Config loading
└── internal/
├── api/
│ ├── client.go # X API client
│ ├── auth.go # OAuth 2.0 PKCE
│ └── types.go # API types
├── transform/
│ └── json.go # Tweet → JSON transform
└── ui/
├── app.go # TUI application
├── keys.go # Keybindings
└── styles.go # Colors & styles
X API Free tier has strict limits (~15 requests per 15 min). If you hit 429 errors, wait a few minutes.
MIT License - see LICENSE for details.
Built with:
- Bubble Tea - TUI framework
- Lip Gloss - Styling
- X API v2
