{"id":49296392,"url":"https://github.com/andersonby/joplin-cli","last_synced_at":"2026-04-26T04:01:34.939Z","repository":{"id":353785137,"uuid":"1220892159","full_name":"AndersonBY/joplin-cli","owner":"AndersonBY","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-25T13:55:43.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-25T15:23:26.080Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndersonBY.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-25T13:28:22.000Z","updated_at":"2026-04-25T13:55:29.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/AndersonBY/joplin-cli","commit_stats":null,"previous_names":["andersonby/joplin-cli"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/AndersonBY/joplin-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndersonBY%2Fjoplin-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndersonBY%2Fjoplin-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndersonBY%2Fjoplin-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndersonBY%2Fjoplin-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndersonBY","download_url":"https://codeload.github.com/AndersonBY/joplin-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndersonBY%2Fjoplin-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32285283,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T18:29:39.964Z","status":"online","status_checked_at":"2026-04-26T02:00:05.962Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2026-04-26T04:01:32.425Z","updated_at":"2026-04-26T04:01:34.932Z","avatar_url":"https://github.com/AndersonBY.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# joplin-cli\n\nAgent-friendly CLI and Python SDK for controlling a running local Joplin\ndesktop instance through the Joplin Clipper REST API.\n\n[中文](README_ZH.md)\n\n`joplin-cli` is designed for humans and coding agents that need predictable,\nsingle-shot commands. It does not provide a REPL or TUI. Every command starts,\ndoes one thing, prints useful output or a structured error, and exits.\n\n## What It Does\n\n- Connects to the local Joplin desktop Web Clipper service, usually at\n  `http://127.0.0.1:41184`.\n- Auto-discovers the local desktop profile token from Joplin's\n  `settings.json` when Joplin is already configured on the machine.\n- Exposes note, notebook, search, tag, todo, resource, diagnostic, config, and\n  batch operations.\n- Works as both an installable CLI and an importable Python SDK.\n- Keeps token values out of normal output, diagnostics, error messages, and\n  object representations.\n- Returns agent-recoverable errors with `Error`, `Cause`, `Try`, and\n  `Examples` sections where applicable.\n\n## Installation\n\nInstall the published CLI from PyPI:\n\n```bash\nuv tool install joplin-cli\n```\n\nUpgrade an existing installation:\n\n```bash\nuv tool upgrade joplin-cli\n```\n\nRun directly from a checkout during development:\n\n```bash\nuv run joplin-cli --help\n```\n\nThe package installs the `joplin-cli` command. It does not install a `joplin`\ncommand by default, because that name may already belong to another Joplin\ntool. Check the optional alias workflow with:\n\n```bash\njoplin-cli alias status\n```\n\n## Quick Start\n\n```bash\nuv tool install joplin-cli\njoplin-cli doctor\njoplin-cli notebooks list\njoplin-cli notes list limit=10\njoplin-cli search query=\"meeting notes\" --json\n```\n\n`doctor` is the best first command. It checks whether the local Joplin server is\nreachable, whether a token can be found, and what to run next.\n\n## Agent Usage\n\nEvery command is single-shot. Use `--json` for machine-readable output.\n\n```bash\njoplin-cli notes read id=\u003cnote-id\u003e --json\njoplin-cli notes create title=\"Draft\" body=@./draft.md\njoplin-cli notes append id=\u003cnote-id\u003e content=\"- [ ] Follow up\"\njoplin-cli batch delete query=\"tag:temporary\" dry-run\n```\n\nFor long Markdown content, write it to a UTF-8 file and pass the file as a text\nparameter. `body=@./draft.md` reads the note body from disk, and\n`content=@./section.md` does the same for append/prepend content. Use\n`body=@@literal` when the literal value must start with `@`.\n\nDesign rules that matter for agents:\n\n- Use `key=value` arguments for predictable shell generation.\n- Prefer `--json` when another tool will parse the result.\n- Use `@file` for long `body` or `content` values instead of putting large\n  Markdown blocks directly in the shell command.\n- Use `joplin-cli help` or `joplin-cli \u003cgroup\u003e --help` to discover commands.\n- Errors explain the likely cause and a concrete next command.\n- Validation errors exit with code `2`; connection, auth, not-found, and\n  conflict errors use distinct exit codes.\n\n## Authentication\n\nDefault behavior is intentionally low-friction for local use. If Joplin desktop\nis already running and the Web Clipper service is enabled, `joplin-cli` tries to:\n\n1. Connect to `127.0.0.1:41184`.\n2. Find the Joplin desktop profile.\n3. Read `api.token` from the profile `settings.json`.\n4. Use the token without printing it.\n\nOverride discovery when needed:\n\n```bash\n$env:JOPLIN_TOKEN=\"...\"; joplin-cli notes list\n```\n\n```bash\njoplin-cli config set token=...\njoplin-cli config set port=41184\njoplin-cli config path\n```\n\nSupported environment variables:\n\n- `JOPLIN_TOKEN`\n- `JOPLIN_HOST`\n- `JOPLIN_PORT`\n- `JOPLIN_PROFILE`\n- `JOPLIN_TIMEOUT`\n- `JOPLIN_CLI_CONFIG`\n\nToken precedence is: CLI option, environment variable, `joplin-cli` config,\nauto-discovered Joplin profile.\n\n## Common Commands\n\nNotes:\n\n```bash\njoplin-cli notes list limit=20\njoplin-cli notes read id=\u003cnote-id\u003e\njoplin-cli notes create title=\"Draft\" body=\"# Draft\"\njoplin-cli notes create title=\"Draft\" body=@./draft.md\njoplin-cli notes update id=\u003cnote-id\u003e title=\"New title\"\njoplin-cli notes update id=\u003cnote-id\u003e body=@./draft.md\njoplin-cli notes append id=\u003cnote-id\u003e content=\"- [ ] Follow up\"\njoplin-cli notes append id=\u003cnote-id\u003e content=@./section.md\njoplin-cli notes delete id=\u003cnote-id\u003e\n```\n\nNotebooks:\n\n```bash\njoplin-cli notebooks list\njoplin-cli notebooks tree\njoplin-cli notebooks create title=\"Projects\"\njoplin-cli notebooks rename id=\u003cnotebook-id\u003e title=\"Archive\"\n```\n\nSearch, tags, and todos:\n\n```bash\njoplin-cli search query=\"meeting notes\" --json\njoplin-cli tags list\njoplin-cli tags add note=\u003cnote-id\u003e tag=\u003ctag-id\u003e\njoplin-cli todos list open\njoplin-cli todos done id=\u003ctodo-id\u003e\n```\n\nResources:\n\n```bash\njoplin-cli resources list\njoplin-cli resources attach note=\u003cnote-id\u003e path=\"./file.pdf\"\njoplin-cli resources download id=\u003cresource-id\u003e output=\"./file.pdf\"\n```\n\n## Output Formats\n\nText output is compact by default. Use JSON for automation:\n\n```bash\njoplin-cli notes list limit=10 --json\n```\n\nOther tabular formats are available where the output is list-like:\n\n```bash\njoplin-cli notes list limit=10 --format tsv\njoplin-cli notes list limit=10 --format csv\n```\n\n## Batch Delete Safety\n\nBatch delete is intentionally two-step. First run a dry run:\n\n```bash\njoplin-cli batch delete query=\"tag:temporary\" dry-run\n```\n\nThe dry run prints:\n\n- The number of matching notes.\n- A preview containing note IDs and titles.\n- A confirmation token shaped like `delete-2-notes-\u003chash\u003e`.\n\nOnly then run the destructive command:\n\n```bash\njoplin-cli batch delete query=\"tag:temporary\" confirm=delete-2-notes-\u003chash\u003e\n```\n\nThe confirmation token is bound to the query and matched note IDs, not just the\ncount. A token from one query cannot confirm another query that happens to match\nthe same number of notes.\n\nFor automation that has already done its own safety checks, `yes` bypasses the\nconfirmation token:\n\n```bash\njoplin-cli batch delete query=\"tag:temporary\" yes\n```\n\n## Python SDK\n\nThe SDK is the core layer; the CLI is a thin wrapper around it.\n\n```python\nfrom joplin_cli import JoplinClient\n\nwith JoplinClient.auto() as client:\n    notes = client.notes.list(limit=10)\n    first = notes[0]\n    print(first.id, first.title)\n```\n\nExplicit connection:\n\n```python\nfrom joplin_cli import JoplinClient\n\nclient = JoplinClient(host=\"127.0.0.1\", port=41184, token=\"...\")\ntry:\n    notebooks = client.notebooks.list()\nfinally:\n    client.close()\n```\n\nMain SDK services:\n\n- `client.notebooks`\n- `client.notes`\n- `client.search`\n- `client.tags`\n- `client.todos`\n- `client.resources`\n- `client.batch`\n\n## Error Model\n\nCLI errors are intended to be actionable without reading source code:\n\n```text\nError: Parameter limit must be an integer.\nTry: Use limit=5.\n```\n\nExit codes:\n\n- `0`: success\n- `1`: general API/output error\n- `2`: validation or CLI usage error\n- `3`: local Joplin connection error\n- `4`: authentication error\n- `5`: not found\n- `6`: conflict or destructive action not confirmed\n\n## Development\n\nInstall the current checkout as a tool while testing packaging:\n\n```bash\nuv tool install . --force\n```\n\nInstall dependencies and run checks:\n\n```bash\nuv sync\nuv run pytest -v\nuv run ruff check .\nuv run ty check\n```\n\nOptional live smoke test against a running local Joplin desktop:\n\n```powershell\n$env:JOPLIN_CLI_LIVE=\"1\"; uv run pytest tests/live/test_live_joplin.py -v\n```\n\nThe live test only reads notebooks. It does not create, edit, or delete Joplin\ndata.\n\n## Release\n\nPyPI publishing is configured through GitHub Actions trusted publishing. Create\nand publish a GitHub Release from this repository; the `release.yml` workflow\nwill run tests, linting, type checks, build the distributions, and publish them\nto PyPI without a stored PyPI token.\n\nBefore creating a release, update `version` in `pyproject.toml` and verify the\npackage locally:\n\n```bash\nuv run pytest -q\nuv run ruff check .\nuv run ty check\nuv build\n```\n\n## Troubleshooting\n\nIf `doctor` says the server is offline:\n\n```bash\njoplin-cli doctor\n```\n\nCheck that Joplin desktop is running and that the Web Clipper service is\nenabled.\n\nIf token discovery fails, inspect configuration:\n\n```bash\njoplin-cli auth\njoplin-cli config path\njoplin-cli config get token\n```\n\nToken values are redacted in command output.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandersonby%2Fjoplin-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandersonby%2Fjoplin-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandersonby%2Fjoplin-cli/lists"}