🐦 Kaa - Kaa Extension
A Visual Studio Code extension that allows you to post to X (formerly Twitter) directly from your IDE using a beautiful React-based GUI.
Features
- 🔐 Secure Authentication: Sign in to your X account using OAuth 2.0
- 🔑 Client ID Management: Add, rotate, and securely store your X OAuth Client ID using VS Code commands
- ✍️ X-like Interface: We strive to mimic the functionality and UI of X so yapping is as native as possible
- 📝 Character Counter: Real-time character counting with visual feedback
- 🚀 Direct Posting: Post to X without leaving your development environment
- 🔒 Secure Storage: Credentials and Client IDs are stored securely using VS Code's built-in security features
Prerequisites
Before using this extension, you'll need:
- X Developer Account: Sign up at developer.twitter.com
- X OAuth Client ID: Create an app in your X Developer Portal and copy the Client ID
- VS Code: Version 1.103.0 or higher
Installation
Clone this repository or download the extension
Install dependencies:
bun i
Build the extension:
bun dev
Press F5
in VS Code to run the extension in a new Extension Development Host window
Setup
1. Add Your X OAuth Client ID
- Open the Command Palette (
Ctrl+Shift+P
or Cmd+Shift+P
)
- Type "Kaa: Add Client ID" and select it
- Enter your OAuth Client ID when prompted
- The extension will securely store your Client ID using VS Code's SecretStorage
Rotating Your Client ID
- If you need to change your Client ID (e.g., for security or app updates):
- Open the Command Palette
- Type "Kaa: Rotate Client ID" and select it
- Enter the new Client ID when prompted
- The extension will replace the old Client ID with the new one
2. Sign In to the Extension
- Open the Command Palette (
Ctrl+Shift+P
or Cmd+Shift+P
)
- Type "Kaa: Sign In" and select it
- Complete the authentication flow using your Client ID
- The extension will validate your credentials and sign you in
Usage
Commands
The extension provides several commands:
Kaa: Add Client ID
- Store your X OAuth Client ID securely
Kaa: Rotate Client ID
- Update your stored Client ID
Kaa: Sign In
- Authenticate with your X account
Kaa: Create Post
- Open the post creation interface
Kaa: Sign Out
- Clear your stored credentials
Creating a Post
- Use the Command Palette to run "Kaa: Create Post"
- A new panel will open with the post interface
- Type your post content (up to 280 characters for regular posts, 25,000 for long posts)
- Click "Post" to submit
- You'll see real-time feedback on your post status
Character Counter
The interface includes a character counter that:
- Shows current character count out of 280
- Changes color to warn when approaching the limit
Security
- Client ID & Credential Storage: Your X OAuth Client ID and credentials are stored securely using VS Code's SecretStorage API
- No Local Files: Sensitive data is never stored in plain text files
- Secure Communication: All API requests use HTTPS with proper authentication headers
Development
Project Structure
src/
├── extension.ts # Main extension entry point
├── services/
│ ├── authService.ts # Auth management class
│ └── xApiService.ts # X API class
├── types/
│ └── index.ts # TypeScript type definitions
├── test/
│ └── extension.test.ts # Tests
└── webview/
├── styles.css # App styles
└── index.tsx # The entire frontend
Building
# Compile the entire extension
bun run build
# Compile TypeScript
bun run compile
# Build webview bundle
bun run webview
# Watch mode for development
bun run webview-watch
Testing
bun run test
Troubleshooting
Common Issues
"Client ID Not Set" Error
- Run "Kaa: Add Client ID" from the Command Palette
- Ensure you enter a valid OAuth Client ID
"Rate Limit Exceeded" Error
- X has rate limits on API calls
- Wait for the specified retry time before posting again
"Not Authenticated" Error
- Use "Kaa: Sign In" to authenticate first
- Check that your credentials are still valid
Debugging
Console logs will be displayed in the VS Code debug console
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests please for the love of God
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
If you encounter any issues or have questions:
- Check the troubleshooting section above
- Search existing issues on GitHub
- Create a new issue with detailed information about your problem
Changelog
Version 1.0.0
- Initial release
- Basic authentication with X API
- Post creation interface
- Secure credential storage
- React-based webview GUI
- Client ID management and rotation commands
Acknowledgments