{"id":15658666,"url":"https://github.com/bachya/linkding-cli","last_synced_at":"2025-04-19T13:22:03.959Z","repository":{"id":39569657,"uuid":"493808264","full_name":"bachya/linkding-cli","owner":"bachya","description":"A CLI to interface with an instance of linkding","archived":false,"fork":false,"pushed_at":"2025-03-12T08:12:08.000Z","size":1480,"stargazers_count":33,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"dev","last_synced_at":"2025-03-12T18:41:28.073Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bachya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-18T19:59:56.000Z","updated_at":"2025-03-08T21:19:30.000Z","dependencies_parsed_at":"2023-09-26T01:05:37.702Z","dependency_job_id":"55005632-a2f1-4bd5-9f26-c9d6e21742f6","html_url":"https://github.com/bachya/linkding-cli","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":"bachya/pypi-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bachya%2Flinkding-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bachya%2Flinkding-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bachya%2Flinkding-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bachya%2Flinkding-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bachya","download_url":"https://codeload.github.com/bachya/linkding-cli/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246156417,"owners_count":20732397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T13:13:23.343Z","updated_at":"2025-03-30T21:32:05.497Z","avatar_url":"https://github.com/bachya.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔖 linkding-cli: A CLI to interact with a linkding instance\n\n[![CI][ci-badge]][ci]\n[![PyPI][pypi-badge]][pypi]\n[![Version][version-badge]][version]\n[![License][license-badge]][license]\n[![Code Coverage][codecov-badge]][codecov]\n[![Maintainability][maintainability-badge]][maintainability]\n\n`linkding-cli` is a CLI to interact with a [linkding][linkding] instance.\n\n- [Installation](#installation)\n- [Python Versions](#python-versions)\n- [Usage](#usage)\n  - [Main Help](#main-help)\n  - [Configuration](#configuration)\n    - [Example: CLI Options](#example--cli-options)\n    - [Example: Environment Variables](#example--environment-variables)\n    - [Example: Configuration File](#example--configuration-file)\n    - [Merging Configuration Options](#merging-configuration-options)\n  - [Bookmarks](#bookmarks)\n    - [The `bookmarks all` command](#the-bookmarks-all-command)\n    - [The `bookmarks archive` command](#the-bookmarks-archive-command)\n    - [The `bookmarks create` command](#the-bookmarks-create-command)\n    - [The `bookmarks delete` command](#the-bookmarks-delete-command)\n    - [The `bookmarks get` command](#the-bookmarks-get-command)\n    - [The `bookmarks unarchive` command](#the-bookmarks-unarchive-command)\n    - [The `bookmarks update` command](#the-bookmarks-update-command)\n  - [Tags](#tags)\n    - [The `tags all` command](#the-tags-all-command)\n    - [The `tags create` command](#the-tags-create-command)\n    - [The `tags get` command](#the-tags-get-command)\n  - [User Info](#user-info)\n    - [The `user profile` command](#the-user-profile-command)\n  - [Misc.](#misc)\n    - [Parsing and Pretty Printing Data](#parsing-and-pretty-printing-data)\n- [Contributing](#contributing)\n\n# Installation\n\n```bash\npip install linkding-cli\n```\n\n# Python Versions\n\n`linkding-cli` is currently supported on:\n\n- Python 3.10\n- Python 3.11\n- Python 3.12\n\n# Usage\n\n## Main Help\n\n```\n$ linkding --help\nUsage: linkding [OPTIONS] COMMAND [ARGS]...\n\n  Interact with a linkding instance.\n\nOptions:\n  -c, --config PATH     A path to a config file.  [env var: LINKDING_CONFIG]\n  -t, --token TOKEN     A linkding API token.  [env var: LINKDING_TOKEN]\n  -u, --url URL         A URL to a linkding instance.  [env var: LINKDING_URL]\n  -v, --verbose         Increase verbosity of standard output.\n  --install-completion  Install completion for the current shell.\n  --show-completion     Show completion for the current shell, to copy it or\n                        customize the installation.\n  --help                Show this message and exit.\n\nCommands:\n  bookmarks  Work with bookmarks.\n  tags       Work with tags.\n```\n\n## Configuration\n\nConfiguration can be provided via a variety of sources:\n\n- CLI Options\n- Environment Variables\n- Configuration File\n\n### Example: CLI Options\n\n```\n$ linkding -u http://127.0.0.1:8000 -t abcde12345 ...\n```\n\n### Example: Environment Variables\n\n```\n$ LINKDING_URL=http://127.0.0.1:8000 LINKDING_TOKEN=abcde12345 linkding ...\n```\n\n### Example: Configuration File\n\nThe configuration file can be formatted as either JSON:\n\n```json\n{\n  \"token\": \"abcde12345\",\n  \"url\": \"http://127.0.0.1:8000\",\n  \"verbose\": false\n}\n```\n\n...or YAML\n\n```yaml\n---\ntoken: \"abcde12345\"\nurl: \"http://127.0.0.1:8000\"\nverbose: false\n```\n\nThen, the linkding file can be provided via either `-c` or `--config`.\n\n```\n$ linkding -c ~/.config/linkding.json ...\n```\n\n### Merging Configuration Options\n\nWhen parsing configuration options, `linkding-cli` looks at the configuration sources in\nthe following order:\n\n1. Configuration File\n2. Environment Variables\n3. CLI Options\n\nThis allows you to mix and match sources – for instance, you might have \"defaults\" in\nthe configuration file and override them via environment variables.\n\n## Bookmarks\n\n```\nUsage: linkding bookmarks [OPTIONS] COMMAND [ARGS]...\n\n  Work with bookmarks.\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  all        Get all bookmarks.\n  archive    Archive a bookmark by its linkding ID.\n  create     Create a bookmark.\n  delete     Delete a bookmark by its linkding ID.\n  get        Get a bookmark by its linkding ID.\n  unarchive  Unarchive a bookmark by its linkding ID.\n  update     Update a bookmark by its linkding ID.\n```\n\n### The `bookmarks all` command\n\n```\nUsage: linkding bookmarks all [OPTIONS]\n\n  Get all bookmarks.\n\nOptions:\n  -a, --archived        Return archived bookmarks.\n  -l, --limit INTEGER   The number of bookmarks to return.\n  -o, --offset INTEGER  The index from which to return results.\n  -q, --query TEXT      Return bookmarks containing a query string.\n  --help                Show this message and exit.\n```\n\n#### Examples:\n\n```sh\n# Get all bookmarks, but limit the results to 10:\n$ linkding bookmarks all --limit 10\n\n# Get all archived bookmarks that contain \"software\":\n$ linkding bookmarks all --archived --query software\n```\n\n### The `bookmarks archive` command\n\n```\nUsage: linkding bookmarks archive [OPTIONS] [BOOKMARK_ID]\n\n  Archive a bookmark by its linkding ID.\n\nArguments:\n  [BOOKMARK_ID]  The ID of a bookmark to archive.\n\nOptions:\n  --help  Show this message and exit.\n```\n\n#### Examples:\n\n```sh\n# Archive bookmark 12:\n$ linkding bookmarks archive 12\n```\n\n### The `bookmarks create` command\n\n```\nUsage: linkding bookmarks create [OPTIONS] URL\n\n  Create a bookmark.\n\nArguments:\n  URL  The URL to bookmark.  [required]\n\nOptions:\n  -a, --archived                 Whether the newly-created bookmark should be\n                                 immediately archived.\n  -d, --description DESCRIPTION  The description to give the bookmark.\n  -n, --notes NOTES              Any Markdown-formatted notes to add to the bookmark.\n  --shared                       Whether the newly-created bookmark should be\n                                 shareable with other linkding users\n  --tags TAG1,TAG2,...           The tags to apply to the bookmark.\n  -t, --title TITLE              The title to give the bookmark.\n  --unread                       Whether the newly-created bookmark should be\n                                 marked as unread.\n  --help                         Show this message and exit.\n```\n\n#### Examples:\n\n```sh\n# Create a bookmark:\n$ linkding bookmarks create https://example.com\n\n# Create a bookmark and immeditely archive it:\n$ linkding bookmarks create -a https://example.com\n\n# Create a bookmark with title, description, and tags:\n$ linkding bookmarks create https://example.com -t Example -d \"A description\" --tags tag1,tag2\n```\n\n### The `bookmarks delete` command\n\n```\nUsage: linkding bookmarks delete [OPTIONS] [BOOKMARK_ID]\n\n  Delete a bookmark by its linkding ID.\n\nArguments:\n  [BOOKMARK_ID]  The ID of a bookmark to delete.\n\nOptions:\n  --help  Show this message and exit.\n```\n\n#### Examples:\n\n```sh\n# Delete the bookmark with an ID of 12:\n$ linkding bookmarks delete 12\n```\n\n### The `bookmarks get` command\n\n```\nUsage: linkding bookmarks get [OPTIONS] [BOOKMARK_ID]\n\n  Get a bookmark by its linkding ID.\n\nArguments:\n  [BOOKMARK_ID]  The ID of a bookmark to retrieve.\n\nOptions:\n  --help  Show this message and exit.\n```\n\n#### Examples:\n\n```sh\n# Get bookmark 12:\n$ linkding bookmarks get 12\n```\n\n### The `bookmarks unarchive` command\n\n```\nUsage: linkding bookmarks unarchive [OPTIONS] [BOOKMARK_ID]\n\n  Unarchive a bookmark by its linkding ID.\n\nArguments:\n  [BOOKMARK_ID]  The ID of a bookmark to unarchive.\n\nOptions:\n  --help  Show this message and exit.\n```\n\n#### Examples:\n\n```sh\n# Unarchive bookmark 12:\n$ linkding bookmarks unarchive 12\n```\n\n### The `bookmarks update` command\n\n```\nUsage: linkding bookmarks update [OPTIONS] BOOKMARK_ID\n\n  Update a bookmark by its linkdingn ID.\n\nArguments:\n  BOOKMARK_ID  The ID of a bookmark to update.  [required]\n\nOptions:\n  -u, --url URL                  The URL to assign to the bookmark.\n  -d, --description DESCRIPTION  The description to give the bookmark.\n  -n, --notes NOTES              Any Markdown-formatted notes to add to the bookmark.\n  --shared                       Whether the -created bookmark should be\n                                 shareable with other linkding users\n  --tags TAG1,TAG2,...           The tags to apply to the bookmark.\n  -t, --title TITLE              The title to give the bookmark.\n  --unread                       Whether the bookmark should be marked as\n                                 unread.\n  --help                         Show this message and exit.\n```\n\n#### Examples:\n\n```sh\n# Update a bookmark with a new url:\n$ linkding bookmarks update 12 -u https://example.com\n\n# Update a bookmark with title, description, and tags:\n$ linkding bookmarks update 12 -t Example -d \"A description\" --tags tag1,tag2\n```\n\n## Tags\n\n```\nUsage: linkding tags [OPTIONS] COMMAND [ARGS]...\n\n  Work with tags.\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  all     Get all tags.\n  create  Create a tag.\n  get     Get a tag by its linkding ID.\n```\n\n### The `tags all` command\n\n```\nUsage: linkding tags all [OPTIONS]\n\n  Get all tags.\n\nOptions:\n  -l, --limit INTEGER   The number of tags to return.\n  -o, --offset INTEGER  The index from which to return results.\n  --help                Show this message and exit.\n```\n\n#### Examples:\n\n```sh\n# Get all tags, but limit the results to 10:\n$ linkding tags all --limit 10\n```\n\n### The `tags create` command\n\n```\nUsage: linkding tags create [OPTIONS] TAG_NAME\n\n  Create a tag.\n\nArguments:\n  TAG_NAME  The tag to create.  [required]\n\nOptions:\n  --help  Show this message and exit.\n```\n\n#### Examples:\n\n```sh\n# Create a tag:\n$ linkding tags create sample-tag\n```\n\n### The `tags get` command\n\n```\nUsage: linkding tags get [OPTIONS] TAG_ID\n\n  Get a tag by its linkding ID.\n\nArguments:\n  TAG_ID  The ID of a tag to retrieve.  [required]\n\nOptions:\n  --help  Show this message and exit.\n```\n\n#### Examples:\n\n```sh\n# Get tag 12:\n$ linkding tags get 12\n```\n\n## Misc.\n\n### Parsing and Pretty Printing Data\n\n`linkding-cli` doesn't have built-in utilities for modifying JSON output in any way.\nInstead, it's recommended to use a tool like [`jq`][jq]. This allows for multiple new\noutcomes, like pretty-printing:\n\n```\n$ linkding bookmarks all | jq\n{\n  \"count\": 123,\n  \"next\": \"http://127.0.0.1:8000/api/bookmarks/?limit=100\u0026offset=100\",\n  \"previous\": null,\n  \"results\": [\n    {\n      \"id\": 1,\n      \"url\": \"https://example.com\",\n      \"title\": \"Example title\",\n      \"description\": \"Example description\",\n      \"website_title\": \"Website title\",\n      \"website_description\": \"Website description\",\n      \"tag_names\": [\n        \"tag1\",\n        \"tag2\"\n      ],\n      \"date_added\": \"2020-09-26T09:46:23.006313Z\",\n      \"date_modified\": \"2020-09-26T16:01:14.275335Z\"\n    }\n  ]\n}\n```\n\n...and slicing/parsing data:\n\n```\n$ linkding bookmarks all | jq '.results[0].title'\n\"Example title\"\n```\n\n## User Info\n\n```\nUsage: linkding user [OPTIONS] COMMAND [ARGS]...\n\n  Work with user info.\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  profile     Get user profile info.\n```\n\n### The `user profile` command\n\n```\nUsage: linkding user profile [OPTIONS]\n\n  Get user profile info.\n\nOptions:\n  --help                Show this message and exit.\n```\n\n#### Examples:\n\n```sh\n$ linkding user profile\n```\n\n# Contributing\n\nThanks to all of [our contributors][contributors] so far!\n\n1. [Check for open features/bugs][issues] or [initiate a discussion on one][new-issue].\n2. [Fork the repository][fork].\n3. (_optional, but highly recommended_) Create a virtual environment: `python3 -m venv .venv`\n4. (_optional, but highly recommended_) Enter the virtual environment: `source ./.venv/bin/activate`\n5. Install the dev environment: `script/setup`\n6. Code your new feature or bug fix on a new branch.\n7. Write tests that cover your new functionality.\n8. Run tests and ensure 100% code coverage: `poetry run pytest --cov linkding_cli tests`\n9. Update `README.md` with any new documentation.\n10. Submit a pull request!\n\n[ci-badge]: https://img.shields.io/github/actions/workflow/status/bachya/linkding-cli/test.yml\n[ci]: https://github.com/bachya/linkding-cli/actions\n[codecov-badge]: https://codecov.io/gh/bachya/linkding-cli/branch/dev/graph/badge.svg\n[codecov]: https://codecov.io/gh/bachya/linkding-cli\n[contributors]: https://github.com/bachya/linkding-cli/graphs/contributors\n[fork]: https://github.com/bachya/linkding-cli/fork\n[issues]: https://github.com/bachya/linkding-cli/issues\n[jq]: https://stedolan.github.io/jq/\n[license-badge]: https://img.shields.io/pypi/l/linkding-cli.svg\n[license]: https://github.com/bachya/linkding-cli/blob/main/LICENSE\n[linkding]: https://github.com/sissbruecker/linkding\n[maintainability-badge]: https://api.codeclimate.com/v1/badges/f01be3cd230902508636/maintainability\n[maintainability]: https://codeclimate.com/github/bachya/linkding-cli/maintainability\n[new-issue]: https://github.com/bachya/linkding-cli/issues/new\n[new-issue]: https://github.com/bachya/linkding-cli/issues/new\n[pypi-badge]: https://img.shields.io/pypi/v/linkding-cli.svg\n[pypi]: https://pypi.python.org/pypi/linkding-cli\n[version-badge]: https://img.shields.io/pypi/pyversions/linkding-cli.svg\n[version]: https://pypi.python.org/pypi/linkding-cli\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbachya%2Flinkding-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbachya%2Flinkding-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbachya%2Flinkding-cli/lists"}