any-edit: Edit Anytype document in external editor
any-edit exports an Anytype document (page, note, task, or other object type) to a markdown file, opens the file in an editor, waits for the editor to exit, then imports the updated document into Anytype.
A Raycast extension (script included) can be used to assign a hotkey for "edit this page in external editor".
Commands
# Authenticate with desktop app
# Check authentication status
# View commands and options
# Export a page (or other object type) with markdown
# Update document title or body if there are changes.
# Round trip: Export a document, open it in editor,
# wait for editor to close, then import changes
# Same as edit but uses LINK obtained from
# the app menus 'Copy Link' or 'Copy Deeplink'
macos-only commands
# Ask Anytype desktop for the current document,
# export it as markdown, open in editor, and import changes.
# Get "Deeplink" url of currently viewed document
Install
Release binaries are on github
Macos Homebrew
Linux (arm64/x86_64)
|
Windows Powershell
|
Cargo
Build from source
Cargo
Nix
Configure
Use with desktop app
-
Ensure anytype desktop app is running on the current machine. The default http api endpoint is http://127.0.0.1:31009.
-
Enter
any-edit auth loginto begin interactive authentication. The app displays a 4-digit code. Enter the code intoany-edit, and an access token is generated and stored securely in the OS keyring or key-file. -
Type
any-edit auth statusto confirm authentication status.
See scripts/README.md for Raycast setup, editor configuration, and diagnostics.
Use with headless cli
-
Generate a token with the cli,
anytype auth apikey create any-edit, and store the token either:- in the default location: (linux)
~/.config/any-edit/api.key(mac)~/Library/Application Support/any-edit/api.key, - or in custom path and pass the path to any-edit with
--keyfile-path=PATH
- in the default location: (linux)
-
Configure the url path, either
- set as an environment variable, for example,
export ANYTYPE_URL=http://127.0.0.1:31012 - or use the url parameter:
any-edit --url=http://127.0.0.1:31012
- set as an environment variable, for example,
-
Check that the key is valid with
any-edit auth status
The headless cli doesn't support the copy link hotkeys so --copy-url or --edit-current, but the other commands should work.
Platform compatibility
The Raycast extension and hotkey to query the desktop app for the current page only work on macos. The other operations: exporting anytype object to markdown, and updating an object from a markdown file, should work on other platforms. However, if you just need a general export/import tool for anytype objects, check out anyr.
Accessibility Permissions
any-edit needs permission to send keystrokes to the Anytype desktop application. You may see a system prompt that PROGRAM would like to control this computer using accessibility features". Depending on how it is invoked, "PROGRAM" may be any-edit, Raycast, or your terminal program (such as WezTerm or Terminal). Permissions can be enabled in System Settings -> Privacy and Security -> Accessibility.