{"id":26648948,"url":"https://github.com/haydenkz/xcli","last_synced_at":"2025-04-11T03:02:26.103Z","repository":{"id":283594551,"uuid":"952271929","full_name":"haydenkz/xcli","owner":"haydenkz","description":"xcli is a Linux command-line tool for posting tweets via the X API.","archived":false,"fork":false,"pushed_at":"2025-03-21T15:26:42.000Z","size":10,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T22:57:41.489Z","etag":null,"topics":["cli","go","twitter","x"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haydenkz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-21T02:28:57.000Z","updated_at":"2025-03-23T17:27:32.000Z","dependencies_parsed_at":"2025-03-21T04:22:37.274Z","dependency_job_id":"eb7dfe40-fc83-4d4c-9483-b43693916a6e","html_url":"https://github.com/haydenkz/xcli","commit_stats":null,"previous_names":["haydenkz/xcli"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haydenkz%2Fxcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haydenkz%2Fxcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haydenkz%2Fxcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haydenkz%2Fxcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haydenkz","download_url":"https://codeload.github.com/haydenkz/xcli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248333605,"owners_count":21086199,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","go","twitter","x"],"created_at":"2025-03-25T00:47:25.685Z","updated_at":"2025-04-11T03:02:26.065Z","avatar_url":"https://github.com/haydenkz.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# X CLI\n\nX CLI is a command-line tool written in Go that enables you to authenticate with Twitter using the OAuth2 PKCE flow and post tweets directly from your terminal. The tool automates obtaining an access token by launching a browser for authentication, capturing the callback, and then exchanging the code for an access token. It also supports a simple REPL (read–eval–print loop) for posting tweets interactively.\n\n## Features\n\n- **OAuth2 with PKCE**: Securely obtain an access token via Twitter's OAuth2 API.\n- **Interactive CLI**: Post tweets directly from the terminal using an easy-to-use prompt.\n- **Automatic Configuration**: On first run, the app prompts for your Twitter Client ID and saves it to `/etc/xcli/config`.\n- **Linux-Only Browser Launch**: Uses `xdg-open` to open the default browser for authentication.\n- **Installation Script**: Includes an `install.sh` script that compiles `xcli.go`, installs the binary to `/bin/x`, and sets up the configuration.\n\n## Prerequisites\n\n- **Go**: Ensure that https://golang.org/dl/ is installed on your system.\n- **Sudo Access**: Required to write to system directories like `/etc/xcli` and `/bin`.\n\n## Installation\n\n1. **Clone or Download** this repository containing `xcli.go` and `install.sh`.\n\n2. **Make the Install Script Executable**:\n   chmod +x install.sh\n\n3. **Run the Install Script with Sudo**:\n   sudo ./install.sh\n\n   The script will:\n   - Check for sudo permissions.\n   - Compile `xcli.go` into a binary named `x`.\n   - Copy the binary to `/bin/x`.\n   - Create the `/etc/xcli` directory and configuration file if it doesn't already exist.\n   - Prompt you to enter your Twitter Client ID.\n   - Remind you that your Twitter Developer Portal callback URL must be set to `http://localhost:5000/callback`.\n\n## Configuration\n\nThe application expects a configuration file at `/etc/xcli/config` in JSON format. This file should contain your Twitter Client ID. For example:\n\n{\n  \"client_id\": \"your_client_id_here\"\n}\n\nIf this file does not exist, the first run of the installation script will prompt you for your CLIENT ID and create the file automatically.\n\n## Callback URL\n\nEnsure that your Twitter Developer Portal is configured with the following callback URL:\n\nhttp://localhost:5000/callback\n\nThis is necessary for the OAuth2 authentication flow to work correctly.\n\n## Usage\n\nAfter installation, you can run the application by simply executing:\n\nx\n\nWhen the application starts, it will:\n\n1. Launch your default browser to authenticate with Twitter.\n2. Capture the OAuth2 callback to retrieve the authorization code.\n3. Exchange the authorization code for an access token.\n4. Enter a command loop where you can type tweet text and press Enter to post it.\n5. Type `exit` or `quit` to end the session.\n\n## Troubleshooting\n\n- **Permission Errors**: Make sure you run the installation script with sudo since writing to `/etc/xcli` and `/bin` requires elevated privileges.\n- **Callback Issues**: Verify that your callback URL in the Twitter Developer Portal is set to `http://localhost:5000/callback`.\n\n## License\n\nThis project is open source. Feel free to modify and enhance it according to your needs.\n\n---\n\nEnjoy using X CLI for your Twitter automation needs!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaydenkz%2Fxcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaydenkz%2Fxcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaydenkz%2Fxcli/lists"}