A command-line utility for importing and exporting prompts from Zed's prompt library.
Caution
The tool is unofficial. Zed may change the database format at any time, breaking compatibility with this tool.
This tool allows you to:
- Export your Zed prompts to JSON format for backup or sharing
- Import prompts from JSON into your Zed prompt library
- List available prompts in your library
go install github.com/rubiojr/zed-prompts@latest
Note
Running the tool when Zed is running generally works, though it may cause database inconsistencies, if the prompt library is being modified concurrently. It's recommended to stop Zed before running the tool.
Export your prompts from Zed's LMDB database to a JSON file:
zed-prompts export --output prompts.json
Export to stdout:
zed-prompts export --output -
Importing from a remote computer (the remote computer must have the tool installed):
ssh <my-host> zed-prompts export --output - | zed-prompts import --input -
Use a custom database path:
zed-prompts export --db /path/to/prompts-library-db.0.mdb --output prompts.json
Import prompts from a JSON file into your Zed prompt library:
zed-prompts import --input prompts.json
Import from stdin:
cat prompts.json | zed-prompts import --input -
Use a custom database path:
zed-prompts import --input prompts.json --db /path/to/prompts-library-db.0.mdb
List metadata for all available prompts:
zed-prompts list
By default, the tool looks for Zed's prompt database at the following locations.
Linux:
~/.local/share/zed/prompts/prompts-library-db.0.mdb
macOS:
~/.config/zed/prompts
The JSON file format for import/export is an array of prompt objects:
[
{
"metadata": {
"id": {
"kind": "User",
"uuid": "12345678-1234-1234-1234-123456789012"
},
"title": "My Prompt",
"default": false,
"saved_at": "2023-01-01T12:00:00Z"
},
"content": "This is the text of the prompt"
}
]
- Backup your prompt library
- Share prompts with colleagues
- Migrate prompts between different machines
- Version control your prompts collection
- Go 1.24 or higher
- Zed editor installed (for accessing the prompts database)
This tool directly manipulates the LMDB database used by Zed. It's recommended to close Zed before importing prompts to prevent potential conflicts.