VS Code extension to post tweets to Twitter/X directly from your editor.
- 🔐 BYOK (Bring Your Own Keys): Your credentials, your total control.
- ✍️ Fast Posting: Post tweets without leaving VS Code.
- 🎯 Smart Context: Select code → Right Click → Automatic Tweet.
- 🛡️ Limit Protection: Automatic counter (17 tweets/day).
- 📊 Real-time Counter: Visualize characters while you type.
- 🔗 Direct Links: Open your published tweets with one click.
- 💙 Activity Bar: Custom icon in the sidebar.
- 🚀 Modern Interface: Custom view with quick actions.
- 🌍 Internationalization: Support for English and Spanish.
- Clone this repository.
- Run
pnpm installto install dependencies. - Press F5 to open a VS Code development window.
This project uses esbuild for bundling.
- Development Watch Mode:
npm run watch - Build for Production:
npm run compile - Package Extension (.vsix):
pnpm run package
- Go to Twitter Developer Portal.
- Create an app (or use an existing one).
- Generate your API Keys and Access Tokens.
- You will need:
- API Key
- API Secret
- Access Token
- Access Secret
- Open the Command Palette (
Ctrl+Shift+PorCmd+Shift+P). - Search for:
X Writer: Setup Credentials. - Choose an option:
- Import from file (Recommended): Select a
.envor.txtfile with your keys (API_KEY=...). - Enter manually: Copy and paste your 4 keys one by one.
- Import from file (Recommended): Select a
Note: Make sure to regenerate your Access Tokens after changing the App Permissions to "Read and Write" in the developer portal.
If you like the extension, you can support me by buying me a coffee ☕:
Method 1: From Activity Bar
- Click on the X Writer icon in the left sidebar 🐦.
- Click on "✍️ Post Tweet".
- Write your message (real-time counter: X/280).
- Done! You will see a "View on X" button to open it in the browser.
Method 2: With Smart Context
- Select code or text in the editor.
Ctrl+Shift+P→X Writer: Post Tweet.- The selected text will pre-fill automatically.
- Edit and publish.
Method 3: From Commands
- Open the Command Palette (
Ctrl+Shift+P). - Search for:
X Writer: Post Tweet. - Write your message.
- Done!
- 17 tweets per day (automatic counter).
- The limit resets every 24 hours.
- You will see remaining tweets on every post.
- Open the Command Palette.
- Search for:
X Writer: Reset Credentials.
Credentials are stored securely using VS Code's SecretStorage API, which utilizes the operating system's credential system (Keychain on macOS, Credential Manager on Windows, Secret Service on Linux).
- Click on the "❓ Help & About" icon in the sidebar to see commands and developer info.
- Change Language: Settings > X Writer > Language.
MIT
