中文文档 | English
A powerful toolkit for managing Linkding bookmarks, supporting imports from multiple data sources.
Run this command for secure interactive configuration before first use:
uv run linkding-tools setup-configThis command will:
- Prompt for Linkding service URL
- Prompt for API Token
- Validate the configuration
- Save configuration to
.envfile
Test if current configuration can connect to Linkding service:
uv run linkding-tools test-configShow currently loaded configuration (Token will be masked):
uv run linkding-tools show-configExtract links and tags from a single Markdown file and upload to Linkding.
Features:
- Supports Markdown link format:
[text](URL) - Supports plain URLs:
https://example.com - Automatically generates multi-level tags from list structure
- Supports custom base tags
Example Markdown File Structure:
# Tutorials
## Python
- [Python Official Site](https://www.python.org)
- [Flask Documentation](https://flask.palletsprojects.com)
## JavaScript
- [Node.js](https://nodejs.org)
- https://www.npmjs.comUsage:
# Basic usage (uses filename as base tag)
python3 linkding-tools.py upload-markdown links.md
# Specify base tag
python3 linkding-tools.py upload-markdown links.md -t programming-tutorials
# Skip confirmation
python3 linkding-tools.py upload-markdown links.md -yUpload link data in JSONL format (one JSON object per line).
JSONL Format:
{"url": "https://example.com", "tag_names": ["tag1", "tag2"]}
{"url": "https://example.org", "tag_names": ["tag1", "tag3"]}Usage:
python3 linkding-tools.py upload-jsonl bookmarks.jsonl
# Skip confirmation
python3 linkding-tools.py upload-jsonl bookmarks.jsonl -yImport bookmarks HTML file exported from Chrome, automatically preserving folder structure as tags.
Usage:
# After exporting bookmarks from Chrome (HTML format), run:
python3 linkding-tools.py import-chrome bookmarks_2026_1_6.html
# Skip confirmation
python3 linkding-tools.py import-chrome bookmarks_2026_1_6.html -yBatch rename/replace tags in Linkding. Supports both one-to-one and one-to-many tag replacement.
Usage:
# Rename tag "python" to "Python" (one-to-one)
python3 linkding-tools.py rename-tag python Python
# Replace a tag with multiple tags (one-to-many)
# Convert "DatasetDownload" to "Dataset,Download"
python3 linkding-tools.py rename-tag DatasetDownload "Dataset,Download"
# Skip confirmation
python3 linkding-tools.py rename-tag python Python -yFeatures:
- One-to-one rename:
rename-tag old_tag new_tag - One-to-many expansion:
rename-tag old_tag "new_tag1,new_tag2,new_tag3"- Existing tags are not duplicated
- Whitespace around commas is automatically trimmed
# Clone or navigate to project directory
cd /path/to/links
# Install dependencies with uv
uv syncpython3 -m pip install -r requirements.txt# First time use, run configuration wizard
uv run linkding-tools setup-config
# Follow prompts to enter Linkding service URL and API Token
# Configuration will be automatically saved to .env file# Copy configuration template
cp .env.example .env
# Edit .env file, fill in actual configuration
# LINKDING_URL=https://your-linkding-instance.com
# LINKDING_TOKEN=your_api_token_hereexport LINKDING_URL=https://your-linkding-instance.com
export LINKDING_TOKEN=your_api_token_here
uv run linkding-toolsAfter configuration, verify it's valid:
uv run linkding-tools test-configUse built-in configuration management commands to manage credentials:
# Interactive configuration (recommended for first-time use)
uv run linkding-tools setup-config
# Verify configuration is valid
uv run linkding-tools test-config
# View current configuration (Token masked)
uv run linkding-tools show-configThe tool loads configuration in the following priority order:
- Environment Variables -
LINKDING_URLandLINKDING_TOKEN(highest priority) - .env File -
.envfile in project root directory - Interactive Prompts - Automatically prompts for missing configuration (lowest priority)
export LINKDING_URL=https://your-linkding-instance.com
export LINKDING_TOKEN=your_api_token_here
uv run linkding-tools upload-markdown links.md-
Copy
.env.exampleto.env:cp .env.example .env
-
Edit
.envfile with your configuration:LINKDING_URL=https://your-linkding-instance.com LINKDING_TOKEN=your_api_token_here -
Run the tool directly, it will automatically read
.envfile:python3 linkding-tools.py upload-markdown links.md
When environment variables or .env file are not provided, the tool will prompt interactively:
python3 linkding-tools.py upload-markdown links.md
# Will prompt for LINKDING_URL and LINKDING_TOKENExecute tasks directly using subcommands:
# View all available commands
python3 linkding-tools.py --help
# View help for specific command
python3 linkding-tools.py upload-markdown --help
# Execute command
python3 linkding-tools.py upload-markdown links.md -t my-tagRun without any parameters to enter interactive menu:
python3 linkding-tools.pyThe menu displays all available features and guides you through operations step by step:
==================================================
Linkding Tools - Bookmark Management Tool
==================================================
Service URL: https://your-linkding-instance.com
--------------------------------------------------
1. Upload links from Markdown file
2. Upload links from JSONL file
3. Import Chrome bookmarks
4. Rename tag
0. Exit
--------------------------------------------------
Please select function [0-4]:
- Log in to your Linkding instance
- Click on user avatar in top right corner, select "Settings"
- In "API" or "API Token" section, generate or copy your token
- Save it to
.envfile
# Clone or navigate to project directory
cd /path/to/links
# Install dependencies with uv
uv sync
# Interactive configuration (recommended)
uv run linkding-tools setup-config
# Verify configuration
uv run linkding-tools test-config# Interactive menu (suitable for beginners)
uv run linkding-tools
# Command-line mode (quick execution)
uv run linkding-tools upload-markdown links.md
uv run linkding-tools import-chrome bookmarks.html
uv run linkding-tools rename-tag old-tag new-tagImport Chrome Bookmarks
# 1. Chrome → Bookmarks → Bookmark Manager → Export bookmarks
# 2. Run import command
uv run linkding-tools import-chrome bookmarks.htmlUpload Markdown Notes
# Create Markdown file
# ## Category 1
# - [Link 1](https://example1.com)
uv run linkding-tools upload-markdown mylinks.mdThe tool loads configuration in the following priority order:
- Environment Variables (highest) -
LINKDING_URLandLINKDING_TOKEN - .env File -
.envfile in project root directory - Interactive Prompts (lowest) - Automatically prompts when missing
| Scenario | Recommended Method | Example |
|---|---|---|
| Local Development | .env file | uv run linkding-tools setup-config |
| CI/CD | Environment variables | export LINKDING_URL=... LINKDING_TOKEN=... |
| Docker | Environment variables | docker run -e LINKDING_URL=... |
| First-time Use | Interactive | uv run linkding-tools setup-config |
# Interactive configuration wizard
uv run linkding-tools setup-config
# Verify configuration validity
uv run linkding-tools test-config
# View current configuration (Token masked)
uv run linkding-tools show-config- Log in to your Linkding instance
- Click on user avatar in top right corner, select "Settings"
- In "API" or "API Token" section, generate or copy your token
- Save it to
.envfile
# 1. Export bookmarks from Chrome as HTML file
# Chrome Menu > Bookmarks > Bookmark Manager > Top right menu > Export bookmarks
# 2. Import using the tool
python3 linkding-tools.py import-chrome bookmarks.html
# 3. Confirm import
Start import? (y/n): y
# Success! All bookmarks imported, preserving original folder structure as tags# 1. Create Markdown file, organize links by structure
# Example: dev-tools.md, with multiple categories
# 2. Upload to Linkding
python3 linkding-tools.py upload-markdown dev-tools.md
# 3. Links will automatically be tagged according to Markdown's hierarchical structure
# For example:
# - Base tag: dev-tools
# - Multi-level tags: dev-tools > IDE, dev-tools > version-control# 1. Found a tag name that needs to be unified
python3 linkding-tools.py rename-tag python Python
# 2. All links with "python" tag will be automatically updated to "Python"
# If link already has "Python" tag, only removes "python" taglinks/
├── src/linkding_tools/ # Main module
│ ├── __init__.py # Main implementation
│ └── __main__.py # Entry point
├── bak/ # Backup of old scripts (excluded)
├── tmp/ # Test files (excluded)
├── linkding-tools.py # Standalone executable version
├── pyproject.toml # uv project configuration
├── README.md # This file
├── README_zh-CN.md # Chinese documentation
└── .env.example # Configuration template
#!/bin/bash
# Upload multiple Markdown files in batch
for file in *.md; do
echo "Processing $file..."
uv run linkding-tools upload-markdown "$file" -y
done# Generate Markdown from URL list file
# Then upload to Linkding
# Or use pipes
cat url_list.txt | uv run linkding-tools upload-markdown -# Run diagnostic command
uv run linkding-tools test-config
# Common issues:
# 1. Is LINKDING_URL correct (including https://)?
# 2. Is LINKDING_TOKEN valid?
# 3. Is network connection working?# Check environment variables (higher priority)
echo $LINKDING_URL
echo $LINKDING_TOKEN
# Clear environment variables
unset LINKDING_URL LINKDING_TOKEN
# Verify configuration
uv run linkding-tools show-configThe tool displays processing results for each link:
- Successfully uploaded links won't be duplicated
- Use
-yparameter to skip confirmation and speed up retry
links/
├── src/linkding_tools/ # Main module
│ ├── __init__.py # Main implementation
│ └── __main__.py # Entry point
├── bak/ # Backup of old scripts (excluded)
├── tmp/ # Test files (excluded)
├── linkding-tools.py # Standalone executable version
├── pyproject.toml # uv project configuration
├── README.md # This file
├── README_zh-CN.md # Chinese documentation
└── .env.example # Configuration template
This project uses uv to manage dependencies, currently only depends on Python standard library:
json- Handle JSON/JSONL datare- Regular expression parsinghttp.client- HTTP requestsssl- HTTPS supporturllib.parse- URL parsing
Issues and Pull Requests are welcome!
MIT