Initial commit: kport - SSH Port Forwarder TUI
- Interactive TUI for SSH port forwarding - Reads from ~/.ssh/config for host selection - Automatic port detection on remote hosts - Manual port forwarding option - Graceful error handling and connection timeouts - Built with Bubble Tea framework Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
32
app.go
Normal file
32
app.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
)
|
||||
|
||||
// App represents the main application
|
||||
type App struct {
|
||||
model *Model
|
||||
}
|
||||
|
||||
// NewApp creates a new application instance
|
||||
func NewApp() *App {
|
||||
return &App{
|
||||
model: NewModel(),
|
||||
}
|
||||
}
|
||||
|
||||
// Run starts the application
|
||||
func (a *App) Run() error {
|
||||
// Create the Bubble Tea program
|
||||
p := tea.NewProgram(a.model, tea.WithAltScreen())
|
||||
|
||||
// Run the program
|
||||
if _, err := p.Run(); err != nil {
|
||||
return fmt.Errorf("failed to run TUI application: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user