CLI for DEVONthink tools distilled from mcp-server-devonthink
$git clone https://github.com/dvcrn/devonthink-cliInstalls into the current project.
Install devonthink-cli by running `git clone https://github.com/dvcrn/devonthink-cli`, then use it for the current task and follow its documentation at https://github.com/dvcrn/devonthink-cli.
| 1 | # devonthink-cli |
| 2 | |
| 3 | CLI for DEVONthink tools distilled from `mcp-server-devonthink`. |
| 4 | |
| 5 | It publishes these equivalent binaries: |
| 6 | |
| 7 | - `devonthink` |
| 8 | - `dt` |
| 9 | - `dt-cli` |
| 10 | |
| 11 | ## Install |
| 12 | |
| 13 | Install from npm: |
| 14 | |
| 15 | ```bash |
| 16 | npm install -g devonthink |
| 17 | ``` |
| 18 | |
| 19 | After installation, you can use any equivalent executable: |
| 20 | |
| 21 | ```bash |
| 22 | devonthink --help |
| 23 | dt --help |
| 24 | dt-cli --help |
| 25 | ``` |
| 26 | |
| 27 | All binaries also expose shell completion generation: |
| 28 | |
| 29 | ```bash |
| 30 | devonthink completion |
| 31 | dt completion |
| 32 | dt-cli completion |
| 33 | ``` |
| 34 | |
| 35 | ## Agent Installation |
| 36 | |
| 37 | For Claude Desktop, add `dvcrn/devonthink-cli` as a marketplace plugin, then install the `devonthink` plugin from that marketplace. |
| 38 | |
| 39 | For Claude Code, the equivalent commands are: |
| 40 | |
| 41 | ```bash |
| 42 | claude plugins marketplace add dvcrn/devonthink-cli |
| 43 | claude plugins install devonthink@devonthink-cli --scope user |
| 44 | ``` |
| 45 | |
| 46 | For `npx skills`, run: |
| 47 | |
| 48 | ```bash |
| 49 | npx skills add dvcrn/devonthink-cli |
| 50 | ``` |
| 51 | |
| 52 | ## Usage |
| 53 | |
| 54 | Generate a shell completion script: |
| 55 | |
| 56 | ```bash |
| 57 | devonthink completion |
| 58 | ``` |
| 59 | |
| 60 | Install bash completion for the current shell session: |
| 61 | |
| 62 | ```bash |
| 63 | source <(devonthink completion) |
| 64 | ``` |
| 65 | |
| 66 | Persist bash completion in `~/.bashrc`: |
| 67 | |
| 68 | ```bash |
| 69 | echo 'source <(devonthink completion)' >> ~/.bashrc |
| 70 | ``` |
| 71 | |
| 72 | For zsh, enable bash completion compatibility and load the script: |
| 73 | |
| 74 | ```bash |
| 75 | echo 'autoload -U +X bashcompinit && bashcompinit' >> ~/.zshrc |
| 76 | echo 'source <(devonthink completion)' >> ~/.zshrc |
| 77 | ``` |
| 78 | |
| 79 | List tools: |
| 80 | |
| 81 | ```bash |
| 82 | devonthink tools |
| 83 | devonthink tools --json |
| 84 | ``` |
| 85 | |
| 86 | Inspect a tool schema: |
| 87 | |
| 88 | ```bash |
| 89 | devonthink schema create_record |
| 90 | devonthink schema create_record --json |
| 91 | ``` |
| 92 | |
| 93 | Run a tool in human-readable mode: |
| 94 | |
| 95 | ```bash |
| 96 | devonthink open_databases |
| 97 | devonthink search Alpha --group-uuid <uuid> --database-name Test |
| 98 | devonthink record_content <uuid> |
| 99 | ``` |
| 100 | |
| 101 | Run the same tool in machine-readable mode: |
| 102 | |
| 103 | ```bash |
| 104 | devonthink open_databases --json |
| 105 | devonthink search --query Alpha --group-uuid <uuid> --database-name Test --json |
| 106 | ``` |
| 107 | |
| 108 | Every command supports both: |
| 109 | |
| 110 | - default text output for humans |
| 111 | - `--json` output for scripts and automation |
| 112 | |
| 113 | Many tools also support the first obvious required argument positionally. For example: |
| 114 | |
| 115 | ```bash |
| 116 | devonthink search Alpha |
| 117 | devonthink record_content <uuid> |
| 118 | devonthink rename_record <uuid> --new-name "New title" |
| 119 | ``` |
| 120 | |
| 121 | ## Architecture |
| 122 | |
| 123 | - `src/devonthink/`: DEVONthink-specific module and tool implementations |
| 124 | - `src/app.ts`: yargs CLI wiring |
| 125 | - `src/output.ts`: human-readable and JSON output formatters |
| 126 | |
| 127 | ## Safety |
| 128 | |
| 129 | When testing, only use the `Test` database. |
| 130 | |
| 131 | ## License |
| 132 | |
| 133 | GPL-3.0-or-later |