lazyslackui
Lazy Slack!
Slack TUI with Bubbletea
A text-based user interface for Slack built with Go and the Bubbletea framework. This application provides a lightweight alternative to the Slack desktop client, focusing on essential features like viewing messages, changing status, and sending preset messages.
Features
- View recent Slack messages across multiple channels
- Quickly change your Slack status (Active, Away, Do Not Disturb)
- Send preset messages with a single action
- Keyboard-driven navigation for efficient workflow
Requirements
- Go 1.16 or higher
- Slack API token with appropriate scopes
- Terminal with support for TUI applications
Installation
- Clone this repository:
git clone https://github.com/yourusername/slack-tui
cd slack-tui
- Install dependencies:
go mod init slack-tui
go mod tidy
- Build the application:
go build -o slack-tui .
Setting up Slack API Token
- Go to Slack API Apps page
- Create a new app
- Add the following scopes to your app:
channels:history
channels:read
chat:write
groups:history
groups:read
users:read
users:write
users.profile:write
- Install the app to your workspace
- Copy the OAuth Access Token
Usage
- Set your Slack API token as an environment variable:
export SLACK_TOKEN=xoxp-your-token-here
- Run the application:
./slack-tui
Keyboard Shortcuts
↑/↓: Navigate through options
Enter: Select the highlighted option
Esc: Go back to the main menu
q or Ctrl+C: Quit the application
Customization
Adding Custom Preset Messages
To add your own preset messages, modify the presetMessages list in the initialModel() function:
presetMessages := []list.Item{
QuickAction{
name: "Your Custom Message Name",
description: "Your custom message text here",
},
// Add more preset messages here
}
Modifying Colors and Styles
The application uses Lipgloss for styling. You can customize the appearance by modifying the color constants and style variables at the top of the file.
Project Structure
main.go: Contains the entire application code
- Model definitions and initialization
- Slack API integration
- TUI rendering and event handling
- Message formatting and display logic
Dependencies
License
MIT