A modern, interactive terminal user interface (TUI) for querying and browsing Lookout's Web Access Feed API, built with Go and Bubble Tea.
- Real-time Event Browsing: View web access events in an interactive terminal interface
- Multiple Time Windows: Quick access to 1h, 12h, 24h, and 48h time ranges
- Live Search: Filter events by URL, device GUID, region, IP address, or event ID
- Event Details: View detailed information about each event
- Keyboard Navigation: Intuitive controls for power users
- Token Management: Automatic OAuth2 token refresh
- Beautiful UI: Styled with Lip Gloss for a modern look
- Go 1.21 or higher
- Valid Lookout API credentials (Application Key and/or Web Activity Key)
-
Clone the repository:
cd lookout-tui -
Install dependencies:
go mod download
-
Build the application:
go build -o lookout-tui ./cmd/tui
Create a .env file in the project root:
# Lookout API Configuration
APPLICATION_KEY=your_application_key_here
WEB_ACTIVITY_KEY=your_web_activity_key_hereOr set environment variables:
export APPLICATION_KEY="your_application_key_here"
export WEB_ACTIVITY_KEY="your_web_activity_key_here"./lookout-tui- ↑/j - Navigate up through events
- ↓/k - Navigate down through events
- 1-4 - Switch time windows (1h, 12h, 24h, 48h)
- / - Focus search input
- Enter - Apply search filter / Show event details
- Esc - Clear search / Close event details
- r - Reload events from API
- q/Ctrl+C - Quit application
- Time Window Selection: Press 1-4 to quickly switch between time ranges
- Search: Press
/to focus the search input, type your query, and press Enter to filter - Event Details: Press Enter on any event to view detailed information
- Auto-refresh: Press
rto manually reload events from the API
lookout-tui/
├── cmd/
│ ├── cli/ # Simple CLI tool for testing
│ └── tui/ # Main TUI application
├── internal/
│ ├── api/ # Lookout API client
│ └── ui/ # Bubble Tea TUI components
└── go.mod
Build the TUI:
go build -o bin/tui ./cmd/tuiBuild the CLI tool:
go build -o bin/cli ./cmd/cliRun the TUI:
./bin/tuiRun the CLI (with optional JSON output):
./bin/cli
./bin/cli --jsonThe project includes a robust API client with:
- OAuth2 Token Management: Automatic token refresh using application keys
- Retry Logic: Exponential backoff for failed requests
- Error Handling: Graceful handling of API errors and token expiration
- Timeout Configuration: Configurable request timeouts
import "github.com/fgravato/lookout-tui/internal/api"
client, err := api.NewClient(api.Config{
ApplicationKey: "your_key",
WebActivityKey: "your_web_activity_key",
Timeout: 60 * time.Second,
})
resp, err := client.FetchWebAccessEvents(startTime)- Bubble Tea - TUI framework
- Lip Gloss - Style definitions
- Bubbles - UI components
- godotenv - Environment variable management
MIT License - see LICENSE file for details
Contributions are welcome! Please feel free to submit pull requests or open issues.
For issues related to:
- Lookout API: Contact your Lookout SE representative
- This Tool: Open an issue on GitHub
Built with:
- Charmbracelet tools for beautiful terminal UIs
- Lookout's Web Access Feed API
- The Go community