Skip to content

A command-line tool for parsing and creating Netscape bookmark files (Chrome & Firefox)

License

Notifications You must be signed in to change notification settings

kyletimmermans/nabbit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Version 1.0 Go 1.20 Last Updated kyletimmermans Twitter

Nabbit

A command-line tool for parsing and creating Netscape bookmark files (Chrome & Firefox)


Nabbit


Table of Contents


Installation

Linux
curl -q -s -LJO "https://github.com/kyletimmermans/nabbit/releases/download/latest/nabbit-v1-linux-amd64.tar.gz" && tar -xzf nabbit-v1-linux-amd64.tar.gz && rm nabbit-v1-linux-amd64.tar.gz && chmod +x nabbit
Mac (Intel)
curl -q -s -LJO "https://github.com/kyletimmermans/nabbit/releases/download/latest/nabbit-v1-mac-amd64.tar.gz" && tar -xzf nabbit-v1-mac-amd64.tar.gz && rm nabbit-v1-mac-amd64.tar.gz && chmod +x nabbit
Mac (Apple Silicon - M1)
curl -q -s -LJO "https://github.com/kyletimmermans/nabbit/releases/download/latest/nabbit-v1-mac-arm64.tar.gz" && tar -xzf nabbit-v1-mac-arm64.tar.gz && rm nabbit-v1-mac-arm64.tar.gz && chmod +x nabbit
Windows (PowerShell)
Invoke-WebRequest -Uri "https://github.com/kyletimmermans/nabbit/releases/download/latest/nabbit-v1-windows-amd64.zip" -OutFile "nabbit-v1-windows-amd64.zip"; Expand-Archive -LiteralPath "nabbit-v1-windows-amd64.zip" -DestinationPath "nabbit"; icacls ".\nabbit\nabbit.exe" /grant *S-1-1-0:(X)

Usage

$ nabbit <file> [options]

Flags

  -k, --check-health         List all bookmark links that do not return a 200-OK response
  -c, --create-file string   Choose bookmark file type for creation from .txt file (chrome/firefox)
  -h, --help                 Display help/usage information
  -a, --list-all             List all folders and the bookmarks (name & URL) within them 
  -l, --list-bookmarks       List all of the bookmarks
  -d, --list-folders         List all of the folders
  -b, --num-bookmarks        Get total number of bookmarks
  -f, --num-folders          Get total number of folders
  -s, --num-separators       Get total number of separators (Firefox only)
  -o, --output string        Output filename of bookmark file (used w/ create-file)
  -u, --usage                Display help/usage information
  -v, --version              Display version
  -w, --write-out string     Output the results of any list functionality in CSV format

Examples

Create a Bookmark File from a Text File (Chrome)

Command
$ nabbit chrome_example.txt --browser-type=chrome -o bookmarks.html
chrome_example.txt (http/https:// or trailing forward slash not required)
Google----https://www.google.com/
YouTube.com----https://www.youtube.com/
Cool Stuff
	OpenAI----https://www.openai.com
	Machine Learning
		IBM fun stuff----https://www.ibm.com
	Wikipedia - Cool----https://wikipedia.com
Fun Stuff
	Amazon----https://www.amazon.com
CERN----http://info.cern.ch/
Resulting bookmark file will look like this in browser

Bookmarks


Create a Bookmark File from a Text File (Firefox)

Command
$ nabbit firefox_example.txt --browser-type=firefox -o bookmarks.html
firefox_example.txt ('++++' represents a separator line)
Example.com----www.example.com
++++
Mozilla Firefox
	Google----https://www.google.com/
	YouTube----https://www.youtube.com/
	Cool Stuff
		OpenAI----https://www.openai.com/
	++++
	++++
	Mozilla----https://www.mozilla.org/
My Stuff
	GitHub----https://www.github.com/
	Kyle----https://www.kyles.world/
Microsoft----https://www.microsoft.com
Resulting bookmark file will look like this in browser

Bookmarks


Get Number of Items in Bookmark File

Command
$ nabbit firefox_bookmarks.html --num-bookmarks --num-folders --num-separators
Output
Number of Bookmarks: 7

Number of Folders: 3

Number of Separators: 3

List Information from Bookmark File

Command
$ nabbit chrome_bookmarks.html --list-all --write-out=test.csv
Output (Note that long names/URLs will be spliced for terminal output, use --write-out to get the full lines in a .csv file)
Bookmark & Folder List:

┏━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┓
┃ Folder Name      ┃ Tab Name         ┃ URL              ┃
┡━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━┩
│ Bookmarks Bar    │ Google           │ www.google.com/  │
│ Bookmarks Bar    │ YouTube.com      │ www.youtube.com/ │
│ Bookmarks Bar    │ CERN             │ info.cern.ch/    │
│ Cool Stuff       │ OpenAI           │ www.openai.com/  │
│ Cool Stuff       │ Wikipedia - Cool │ wikipedia.com/   │
│ Machine Learning │ IBM fun stuff    │ www.ibm.com/     │
│ Fun Stuff        │ Amazon           │ www.amazon.com/  │
└──────────────────┴──────────────────┴──────────────────┘

Text Bookmark File Format

For creating Netscape bookmark files from text files

Bookmarks - The name and the actual URL must be separated by a '----' (quadruple hyphen).
Google----https://www.google.com/
YouTube.com----https://www.youtube.com/
Folders - The bookmarks under a folder must be tabbed over to represent the folder hierarchy
My Folder
	Google----https://www.google.com/
	YouTube.com----https://www.youtube.com/
	Nested Folder
		Another Link----www.example.com
Separators - Denoted in a bookmark file by a '++++' (quadruple plus) (Firefox only)
Google----https://www.google.com/
++++
YouTube.com----https://www.youtube.com/

Notes on Text Bookmark File Format:

  • Bookmarks - https:// and a trailing forward slash are not necessary as they are automatically added if not detected in the input file.
  • Bookmarks - https:// will not replace http:// if you added it manually.
  • General - Do not put bookmarks, folders, or separators on the same line of your file, they each get their own line
  • General - Empty lines will be removed
  • General - Chrome and Firefox will automatically retrieve and render bookmark favicons when you import the HTML bookmark file

Changelog

Version Notes
1.0 Initial-Relase

About

A command-line tool for parsing and creating Netscape bookmark files (Chrome & Firefox)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages