Rename twitter-cli to bird
- Rename package from twitter-cli to bird - Update all CLI references and documentation - Add read command to README
This commit is contained in:
@@ -3,3 +3,4 @@ dist/
|
||||
*.log
|
||||
.DS_Store
|
||||
twitter-cli.bin
|
||||
bird
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
# twitter-cli
|
||||
# bird
|
||||
|
||||
A command-line tool for posting tweets and replies via Twitter's GraphQL API.
|
||||
A command-line tool for posting tweets and replies via Twitter/X's GraphQL API.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
cd ~/Projects/twitter-cli
|
||||
cd ~/Projects/bird
|
||||
pnpm install
|
||||
pnpm run binary # Creates the 'bird' executable
|
||||
```
|
||||
|
||||
## Usage
|
||||
@@ -14,23 +15,31 @@ pnpm install
|
||||
### Post a tweet
|
||||
|
||||
```bash
|
||||
./twitter-cli tweet "Hello from twitter-cli!"
|
||||
bird tweet "Hello from bird!"
|
||||
```
|
||||
|
||||
### Reply to a tweet
|
||||
|
||||
```bash
|
||||
# Using tweet URL
|
||||
./twitter-cli reply "https://x.com/user/status/1234567890" "This is my reply"
|
||||
bird reply "https://x.com/user/status/1234567890" "This is my reply"
|
||||
|
||||
# Using tweet ID directly
|
||||
./twitter-cli reply 1234567890 "This is my reply"
|
||||
bird reply 1234567890 "This is my reply"
|
||||
```
|
||||
|
||||
### Read a tweet
|
||||
|
||||
```bash
|
||||
# Get tweet content by URL or ID
|
||||
bird read "https://x.com/user/status/1234567890"
|
||||
bird read 1234567890 --json
|
||||
```
|
||||
|
||||
### Check credentials
|
||||
|
||||
```bash
|
||||
./twitter-cli check
|
||||
bird check
|
||||
```
|
||||
|
||||
## Authentication
|
||||
@@ -39,14 +48,14 @@ The tool resolves credentials in the following order of priority:
|
||||
|
||||
1. **CLI arguments** (highest priority)
|
||||
```bash
|
||||
./twitter-cli --auth-token "xxx" --ct0 "yyy" tweet "Hello"
|
||||
bird --auth-token "xxx" --ct0 "yyy" tweet "Hello"
|
||||
```
|
||||
|
||||
2. **Environment variables**
|
||||
```bash
|
||||
export AUTH_TOKEN="xxx"
|
||||
export CT0="yyy"
|
||||
./twitter-cli tweet "Hello"
|
||||
bird tweet "Hello"
|
||||
```
|
||||
|
||||
Alternative env var names: `TWITTER_AUTH_TOKEN`, `TWITTER_CT0`
|
||||
|
||||
+4
-4
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "twitter-cli",
|
||||
"name": "bird",
|
||||
"version": "0.1.0",
|
||||
"description": "CLI tool for tweeting and replying via Twitter GraphQL API",
|
||||
"description": "CLI tool for tweeting and replying via Twitter/X GraphQL API",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
"bin": {
|
||||
"twitter-cli": "dist/index.js"
|
||||
"bird": "dist/index.js"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
@@ -15,7 +15,7 @@
|
||||
"lint": "biome check .",
|
||||
"lint:fix": "biome check --write .",
|
||||
"format": "biome format --write .",
|
||||
"binary": "bun build --compile --minify src/index.ts --outfile twitter-cli"
|
||||
"binary": "bun build --compile --minify src/index.ts --outfile bird"
|
||||
},
|
||||
"dependencies": {
|
||||
"commander": "^12.1.0"
|
||||
|
||||
+6
-5
@@ -1,11 +1,12 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* twitter-cli - CLI tool for posting tweets and replies
|
||||
* bird - CLI tool for posting tweets and replies
|
||||
*
|
||||
* Usage:
|
||||
* twitter-cli tweet "Hello world!"
|
||||
* twitter-cli reply <tweet-id> "This is a reply"
|
||||
* twitter-cli reply <tweet-url> "This is a reply"
|
||||
* bird tweet "Hello world!"
|
||||
* bird reply <tweet-id> "This is a reply"
|
||||
* bird reply <tweet-url> "This is a reply"
|
||||
* bird read <tweet-id-or-url>
|
||||
*/
|
||||
|
||||
import { Command } from 'commander';
|
||||
@@ -14,7 +15,7 @@ import { TwitterClient } from './lib/twitter-client.js';
|
||||
|
||||
const program = new Command();
|
||||
|
||||
program.name('twitter-cli').description('Post tweets and replies via Twitter GraphQL API').version('0.1.0');
|
||||
program.name('bird').description('Post tweets and replies via Twitter/X GraphQL API').version('0.1.0');
|
||||
|
||||
// Global options for authentication
|
||||
program
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# twitter-cli - CLI tool for posting tweets and replies
|
||||
# Requires Node.js 20+ and pnpm
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
cd "$SCRIPT_DIR" && exec pnpm exec tsx src/index.ts "$@"
|
||||
Reference in New Issue
Block a user