v0.1.0 cf60d0e

main.go RawHistoryFolder

1// Package main provides the main entry point for dumb-browser CLI application.
2package main
3
4import (
5	"fmt"
6	"os"
7
8	"github.com/spf13/cobra"
9)
10
11// Build information set via ldflags
12var (
13	version   = "dev"
14	commit    = "none"
15	buildDate = "unknown"
16)
17
18var rootCmd = &cobra.Command{
19	Use:   "dumb-browser",
20	Short: "A dumb browser for Wayland window managers",
21	Long:  `A fast, simple browser with rofi/dmenu integration for sway and hyprland window managers.`,
22	Run: func(_ *cobra.Command, _ []string) {
23		fmt.Println("dumb-browser - A dumb browser for Wayland WMs")
24		fmt.Println("Use --help for available commands")
25	},
26}
27
28var versionCmd = &cobra.Command{
29	Use:   "version",
30	Short: "Print version information",
31	Run: func(_ *cobra.Command, _ []string) {
32		fmt.Printf("dumb-browser %s\n", version)
33		fmt.Printf("commit: %s\n", commit)
34		fmt.Printf("built: %s\n", buildDate)
35	},
36}
37
38var initCmd = &cobra.Command{
39	Use:   "init",
40	Short: "Initialize project dependencies",
41	Run: func(_ *cobra.Command, _ []string) {
42		fmt.Printf("dumb-browser %s - Project initialization complete!\n", version)
43		fmt.Println("Dependencies installed:")
44		fmt.Println("- Cobra CLI framework")
45		fmt.Println("- Viper configuration")
46		fmt.Println("- ncruces/go-sqlite3 (CGO-free)")
47		fmt.Println("- go-playground/validator")
48		fmt.Println("- testify testing")
49		fmt.Println("- SQLC for type-safe SQL")
50		fmt.Println("- Wails v3-alpha desktop framework")
51	},
52}
53
54func init() {
55	rootCmd.AddCommand(versionCmd)
56	rootCmd.AddCommand(initCmd)
57}
58
59func main() {
60	if err := rootCmd.Execute(); err != nil {
61		fmt.Fprintf(os.Stderr, "Error: %v\n", err)
62		os.Exit(1)
63	}
64}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close