- Add secure login command with smart editor detection - Implement Bearer token authentication with hidden input option - Add status command showing monthly quota and rate limits - Support for Free/Basic/Pro tier detection - Smart editor detection (nvim, vim, nano, etc.) - Secure token storage in ~/.config/xapi/config.toml - Add comprehensive README and documentation - Add .gitignore for binaries and IDE files Features: - xapi login: Configure credentials securely - xapi login --token: Hidden input mode (no bash history) - xapi status: Check quota usage and recommendations - xapi status --days N: View N-day usage history Security: - Token input without shell history exposure - Config file with 0600 permissions - HTTPS-only API communication - Clear security warnings in config Built with Cobra CLI framework for a professional CLI experience. Next: Search command with dry-run mode to preview before burning quota.
178 lines
4.8 KiB
Markdown
178 lines
4.8 KiB
Markdown
# xapi - The Quota-Intelligent X API CLI
|
||
|
||
> **Preview searches before you burn API quota.** Built for developers on X's Free and Basic tiers who need to maximize every API call.
|
||
|
||
[](https://opensource.org/licenses/MIT)
|
||
[](https://go.dev)
|
||
[](https://github.com/maxtheweb/xapi-cli)
|
||
|
||
## <¯ Why xapi?
|
||
|
||
X (Twitter) API's free tier gives you just **100 reads/month**. That's ~3 searches per day. One bad query and you've burned a day's quota.
|
||
|
||
**xapi solves this:**
|
||
- =
|
||
**Dry-run by default** - Preview results before consuming quota
|
||
- =Ê **Real-time quota tracking** - Know exactly what you have left
|
||
- =¾ **Smart caching** - Never waste quota on duplicate searches
|
||
- <¯ **Query optimization** - Get maximum data per API call
|
||
|
||
## ( Features
|
||
|
||
- **Smart Authentication**: Secure token input without shell history exposure
|
||
- **Quota Intelligence**: See exactly how many operations you have left
|
||
- **Search Preview**: Validate queries before executing (dry-run mode)
|
||
- **Multiple Editor Support**: Auto-detects nvim, vim, nano, and more
|
||
- **Rate Limit Awareness**: Shows both monthly quota and 15-min rate windows
|
||
|
||
## =æ Installation
|
||
|
||
### From Source (Recommended)
|
||
|
||
```bash
|
||
git clone https://git.maxtheweb.com/maxtheweb/xapi-cli.git
|
||
cd xapi-cli
|
||
go build -o xapi .
|
||
sudo mv xapi /usr/local/bin/
|
||
```
|
||
|
||
### Arch Linux (AUR)
|
||
|
||
```bash
|
||
# Coming soon
|
||
paru -S xapi
|
||
```
|
||
|
||
## =€ Quick Start
|
||
|
||
### 1. Get Your X API Bearer Token
|
||
|
||
1. Go to [developer.x.com](https://developer.x.com)
|
||
2. Create a new app (or use existing)
|
||
3. Navigate to "Keys and tokens"
|
||
4. Copy your Bearer Token
|
||
|
||
### 2. Configure xapi
|
||
|
||
```bash
|
||
# Option 1: Secure prompt (recommended - no shell history)
|
||
xapi login --token
|
||
Enter your X API Bearer token (input hidden): ****
|
||
|
||
# Option 2: Use your editor
|
||
xapi login # Opens $EDITOR (nvim/vim/nano)
|
||
```
|
||
|
||
### 3. Check Your Status
|
||
|
||
```bash
|
||
xapi status
|
||
|
||
=Ê MONTHLY QUOTA STATUS
|
||
PPPPPPPPPPPPPPPPPPPPPPP
|
||
|