gm

command module
v0.1.30 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2025 License: GPL-3.0 Imports: 3 Imported by: 0

README

📑 GoMarks

GitHub go.mod Go version Linux SQLite

Writing gopher logo
💙 Gopher image by Maria Letta

Simple CLI tool for manage your bookmarks 🚧 WIP

[!WARNING] This repo is a work in progress! Needing both cleaning up and documenting.

https://github.com/user-attachments/assets/b8d8f0fa-e453-421b-b27d-eebb3da7f51f

Features

  • Powered by Fzf
  • Track bookmarks with git wip
    • Sync bookmarks as JSON files
    • Encrypt bookmarks with GPG and push to remote
  • Encrypt local database with AES-GCM
  • Support multiple databases
  • Import bookmarks from firefox based browsers
  • Import bookmarks from chromium based browsers
  • Import bookmarks from git wip
  • Fetch title and description from new bookmark
  • Check bookmark status (http status)
  • Support for NO_COLOR env variable.
  • Configure menu keybinds, prompt, header, preview (fzf) using a YAML file.
  • Migrate items from one database to another
  • Add docker|podman support priority

Installation

go install github.com/mateconpizza/gm@latest

To uninstall the program remove the binary in your go env GOPATH

Usage (🚧WIP)

$ gm --help
Simple yet powerful bookmark manager for your terminal

Usage:
  gm [flags]
  gm [command]

Available Commands:
  new         New bookmark, database, backup
  rec         Records management
  tags        Tags management
  health      Bookmark health
  db          Database management
  git         Git commands
  io          Export/Import bookmarks
  conf        Configuration management
  help        Help about any command

Flags:
  -o, --open            open bookmark in default browser
  -e, --edit            edit bookmark with preferred text editor
  -r, --remove          remove bookmark by query or ID
  -c, --copy            copy bookmark URL to clipboard
  -q, --qr              generate QR code for bookmark URL
  -N, --notes           display bookmark notes
  -m, --menu            interactive menu mode using fzf
      --multiline       output in multiline format (fzf)
  -f, --format string   output format [oneline|json|id|url|title|tags|desc|notes]
  -t, --tag strings     filter bookmarks by tag(s)
  -H, --head int        show first N bookmarks
  -T, --tail int        show last N bookmarks
  -n, --name string     database name (default "main.db")
      --color string    output with pretty colors [always|never] (default "always")
      --force           force action
  -y, --yes             assume "yes" on most questions
  -v, --verbose count   increase verbosity (-v, -vv, -vvv)
  -h, --help            help for gm
      --version         version for gm

Supported Env Vars

Name type Description Status
GOMARKS_HOME str Path to database/yaml done
GOMARKS_EDITOR str Preferred text editor done
NO_COLOR int Disable all colors done
📜 Menu support

Single/multiple selection for open, copy, edit, delete, check status.

https://github.com/user-attachments/assets/b8d8f0fa-e453-421b-b27d-eebb3da7f51f

➕ Add a bookmark

https://github.com/user-attachments/assets/436b7553-b130-4114-8638-2e8a9b3ea2ce

📝 Edit a bookmark

https://github.com/user-attachments/assets/059dd578-2257-4db4-b7b1-1267d0375470

🔳 Create QR-Code

https://github.com/user-attachments/assets/f531fdc9-067b-4747-9f31-4afd5252e3cb

☑️ Check status

https://github.com/user-attachments/assets/a3fbc64a-87c1-49d6-af48-5c679b1046b1

⚙️ Configuration
  • $GOMARKS_HOME/config.yml file

YAML file structure

prompt: " Gomarks> "
header: true
preview: true
keymaps:
  edit:
    bind: ctrl-e
    description: edit
    enabled: true
    hidden: false
  open:
    bind: ctrl-o
    description: open
    enabled: true
    hidden: false
  preview:
    bind: ctrl-/
    description: toggle-preview
    enabled: true
    hidden: false
  qr:
    bind: ctrl-k
    description: QRcode
    enabled: true
    hidden: false
  toggle_all:
    bind: ctrl-a
    description: toggle-all
    enabled: true
    hidden: true
  yank:
    bind: ctrl-y
    description: yank
    enabled: true
    hidden: false
⏳ TODO

TODO

❗ Priority

  • Use a ORM discontinued
    • Add multiple databases option (default.db, work.db, client.db)

Refactor

  • [~] Add Sync to remote repo??? (WIP)
  • Drop ErrActionAborted in package terminal (use sys.ErrActionAborted)
  • Move config/menu to package menu
    • Drop global Fzf

XDG

  • Store db in XDG_DATA_HOME
  • Store menu config in XDG_CONFIG_HOME (WIP: for now in XDG_DATA_HOME)

📦 Packages

  • terminal package
  • color package
  • files package

🟨 Redo

  • Backups
  • Databases

⛓️ Import

  • From firefox
    • If database is locked (SQLITE_BUSY), ask user confirmation to copy file to tmp directory and read from there.
  • From chrome chromium

♻️ Misc

  • Add a logging library
  • Support NO_COLOR env var. no-color
  • Create a rm subcommand
    • Add rm database, backup
    • Add rm records
    • Add rm misc...
    • Remove db rm

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
Package cmd contains the core commands and initialization logic for the application.
Package cmd contains the core commands and initialization logic for the application.
appcfg
Package appcfg manages the application's configuration, including reading from and writing to configuration files (e.g., YAML), and providing helper functions for command-line configuration logic.
Package appcfg manages the application's configuration, including reading from and writing to configuration files (e.g., YAML), and providing helper functions for command-line configuration logic.
create
Package create provides Cobra subcommands for creating new entities, including bookmarks, databases, and backups.
Package create provides Cobra subcommands for creating new entities, including bookmarks, databases, and backups.
database
Package database handles bookmarks database management operations.
Package database handles bookmarks database management operations.
git
Package git...
Package git...
health
Package health provides bookmark health verification and maintenance.
Package health provides bookmark health verification and maintenance.
io
Package io contains functions to export/import bookmarks.
Package io contains functions to export/import bookmarks.
records
Package records provides Cobra subcommands for managing bookmarks and related entities, including record queries, actions, and tag operations.
Package records provides Cobra subcommands for managing bookmarks and related entities, including record queries, actions, and tag operations.
setup
Package setup provides commands for initializing and configuring the bookmark database.
Package setup provides commands for initializing and configuring the bookmark database.
internal
app
Package app manages command execution context and shared dependencies.
Package app manages command execution context and shared dependencies.
bookmark/metadata
Package metadata provides functions to scrape and update various metadata for bookmarks (descriptions, title, tags, favicon, etc)
Package metadata provides functions to scrape and update various metadata for bookmarks (descriptions, title, tags, favicon, etc)
bookmark/port
Package port provides functionalities for importing and exporting data, supporting various sources and formats including browsers, databases, Git repositories, JSON, and GPG encrypted files.
Package port provides functionalities for importing and exporting data, supporting various sources and formats including browsers, databases, Git repositories, JSON, and GPG encrypted files.
bookmark/qr
Package qr provides utilities for generate, render and working with QR-Codes
Package qr provides utilities for generate, render and working with QR-Codes
bookmark/status
Package status provides concurrent HTTP status checking for bookmarks.
Package status provides concurrent HTTP status checking for bookmarks.
cli
Package cli provides utilities for building and managing Cobra commands.
Package cli provides utilities for building and managing Cobra commands.
config
Package config manages application-wide settings, paths, and environment variables.
Package config manages application-wide settings, paths, and environment variables.
dbtask
Package dbtask provides functions for managing SQLite databases.
Package dbtask provides functions for managing SQLite databases.
editor
Package editor provides strategies for editing bookmarks through temporary files.
Package editor provides strategies for editing bookmarks through temporary files.
git
Package git provides high-level utilities to initialize, manage, and interact with the bookmark's Git repositorie.
Package git provides high-level utilities to initialize, manage, and interact with the bookmark's Git repositorie.
handler
Package handler handles parsing and processing of bookmark data operations.
Package handler handles parsing and processing of bookmark data operations.
locker
Package locker provides AES-GCM encryption and decryption utilities for files, including backup and restore logic.
Package locker provides AES-GCM encryption and decryption utilities for files, including backup and restore logic.
locker/gpg
Package gpg provides utilities for GPG encryption, decryption, and integration with Git.
Package gpg provides utilities for GPG encryption, decryption, and integration with Git.
summary
Package summary provides repository and backup summary generation.
Package summary provides repository and backup summary generation.
sys
Package sys provides system-level utilities for command execution, environment interaction, and clipboard operations.
Package sys provides system-level utilities for command execution, environment interaction, and clipboard operations.
sys/browser
Package browser defines an interface for interacting with web browsers to import bookmarks.
Package browser defines an interface for interacting with web browsers to import bookmarks.
sys/browser/blink
Package blink provides functionalities for importing bookmarks from Blink-based web browsers like Chromium, Chrome, and Edge.
Package blink provides functionalities for importing bookmarks from Blink-based web browsers like Chromium, Chrome, and Edge.
sys/browser/gecko
Package gecko provides functionalities for importing bookmarks from Gecko-based web browsers like Firefox.
Package gecko provides functionalities for importing bookmarks from Gecko-based web browsers like Firefox.
sys/browser/paths
Package browserpath provides functions to generate platform-specific paths for browser profiles and bookmark files.
Package browserpath provides functions to generate platform-specific paths for browser profiles and bookmark files.
sys/terminal
Package terminal provides utilities for interacting with the command-line terminal.
Package terminal provides utilities for interacting with the command-line terminal.
ui
Package ui provides console interaction utilities with styled output.
Package ui provides console interaction utilities with styled output.
ui/color
Package color provides utilities for formatting and coloring text output in the terminal
Package color provides utilities for formatting and coloring text output in the terminal
ui/frame
Package frame provides a customizable text framing and styling utility for console output, including borders and icons.
Package frame provides a customizable text framing and styling utility for console output, including borders and icons.
ui/menu
Package menu provides a flexible wrapper for the fzf interactive filter, enabling customizable selection menus.
Package menu provides a flexible wrapper for the fzf interactive filter, enabling customizable selection menus.
ui/printer
Package printer provides functions to format and print bookmark data, including records, tags, and repository information.
Package printer provides functions to format and print bookmark data, including records, tags, and repository information.
ui/txt
Package txt provides text formatting helpers.
Package txt provides text formatting helpers.
pkg
bookio
Package bookio provides utilities to import and export bookmarks in various formats.
Package bookio provides utilities to import and export bookmarks in various formats.
bookmark
Package bookmark contains the bookmark record.
Package bookmark contains the bookmark record.
db
Package db provides the model of the configuration for a database.
Package db provides the model of the configuration for a database.
files
Package files provides utilities for common file and directory operations.
Package files provides utilities for common file and directory operations.
scraper
Package scraper extracts metadata such as titles, descriptions, keywords, and favicons from web pages, with configurable options for the scraping process.
Package scraper extracts metadata such as titles, descriptions, keywords, and favicons from web pages, with configurable options for the scraping process.
scraper/wayback
Package wayback provides a client for the Internet Archive Wayback Machine API.
Package wayback provides a client for the Internet Archive Wayback Machine API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL