diff --git a/README.md b/README.md index 26084b1..a3b1a6e 100644 --- a/README.md +++ b/README.md @@ -15,20 +15,6 @@ A command-line tool for interacting with the X (formerly Twitter) API, supportin curl -fsSL https://raw.githubusercontent.com/xdevplatform/xurl/main/install.sh | sudo bash ``` -## Configuration - -Add the following to your environment variables if you want to use OAuth 2.0: - -```env -export CLIENT_ID=your_client_id -export CLIENT_SECRET=your_client_secret -``` - -Optional environment variables: -- `REDIRECT_URI` (default: http://localhost:8080/callback) -- `AUTH_URL` (default: https://x.com/i/oauth2/authorize) -- `TOKEN_URL` (default: https://api.x.com/2/oauth2/token) -- `API_BASE_URL` (default: https://api.x.com) ## Usage @@ -36,16 +22,12 @@ Optional environment variables: You must have a developer account and app to use this tool. -App authentication: +#### App authentication: ```bash xurl auth app --bearer-token BEARER_TOKEN ``` -OAuth 2.0 authentication: -```bash -xurl auth oauth2 -``` - +#### OAuth 2.0 User-Context **Note:** For OAuth 2.0 authentication, you must specify the redirect URI in the [X API developer portal](https://developer.x.com/en/portal/dashboard). 1. Create an app at the [X API developer portal](https://developer.x.com/en/portal/dashboard). @@ -53,12 +35,20 @@ xurl auth oauth2 ![Setup](./assets/setup.png) ![Redirect URI](./assets/callback.png) 3. Set the client ID and secret in your environment variables. - -OAuth 1.0a authentication: +```env +export CLIENT_ID=your_client_id +export CLIENT_SECRET=your_client_secret +``` +4. Get your access keys: +```bash +xurl auth oauth2 +``` +#### OAuth 1.0a authentication: ```bash xurl auth oauth1 --consumer-key KEY --consumer-secret SECRET --access-token TOKEN --token-secret SECRET ``` +### Authentication Management View authentication status: ```bash xurl auth status