Files
gems/jade-depo/README.md
T
joakim 0ebfaf835d Add root command to open depository with $EDITOR
- Implement openDepository function in cmd/root.go to open the depository directory in $EDITOR
- Falls back to vi if $EDITOR is not set
- Update README.md with new usage section documenting bare 'jade' command
- Include config.go changes that move config location to depository/.jade/
2026-01-02 20:18:50 +01:00

160 lines
3.4 KiB
Markdown

# Jade CLI
A simple CLI tool for managing markdown notes in a depository (vault). Inspired by Obsidian but focused on simplicity and command-line usage.
## Features
- **Note Management**: Create, edit, list, and delete markdown notes
- **Tag Support**: Extract and search notes by tags (default `+tag` syntax, configurable)
- **Full-Text Search**: Search note content using ripgrep
- **Link Support**: Parse both `[[wiki-style]]` and `[markdown](links)`
- **Trash System**: Deleted notes moved to `.jade/trash/` instead of permanent deletion
- **Flexible Configuration**: Per-depository settings for tag prefix and other options
## Installation
```bash
go build -o jade
```
## Usage
### Open Depository
```bash
# Open the depository directory in your $EDITOR
jade
# This opens ~/jade-depository (or your configured path) in your editor
# Works great with neovim, vim, or any editor that supports directory opening
```
### Initialize and List Notes
```bash
# List all notes in the default depository (~/jade-depository)
jade list
# Use a specific depository
jade --depo /path/to/notes list
```
### Create a Note
```bash
# Create a new note with a title
jade add "My New Note"
# This creates 'my-new-note.md' and opens it in $EDITOR
```
### Search Notes
```bash
# Search by content
jade search "kubernetes"
# Search by tag
jade search --tag docker
jade search --tag +work # prefix is optional
```
### Edit a Note
```bash
# Find and edit a note by title (fuzzy search)
jade edit "My Note"
# If multiple matches, you'll be prompted to select
```
### Delete a Note
```bash
# Delete a note (moves to trash with confirmation)
jade rm "My Note"
# Skip confirmation
jade rm --force "My Note"
```
### List All Tags
```bash
# Show all tags with their occurrence counts
jade tags
```
## Configuration
Configuration is stored in `<depo_path>/.jade/config.yml` and is created automatically when you first run jade.
Example config:
```yaml
depo_path: /home/user/jade-depository
tag_prefix: "+"
```
You can override these with flags:
- `--depo`: Depository path
- `--config`: Config file path (if you need to override the default location)
## Depository Structure
```
jade-depository/
├── .jade/
│ ├── config.yml # Configuration file
│ └── trash/ # Deleted notes go here
├── note-1.md
├── note-2.md
└── subfolder/
└── note-3.md
```
The `.jade/` directory is automatically created and contains configuration and metadata. You can optionally add it to `.gitignore` if you don't want to track it in version control.
## Note Format
Notes are standard markdown files. The first `#` heading is used as the title (filename is fallback).
Example note:
```markdown
# My Note Title
This is a note about +kubernetes and +docker.
I can reference [[another-note.md]] or use [regular links](other-note.md).
Tags can appear anywhere in +content.
```
## Requirements
- Go 1.25+ (for building)
- ripgrep (`rg`) for search functionality
- `$EDITOR` environment variable set (falls back to `vi`)
## Roadmap
### v1.0 (Current)
- [x] Basic note operations (add, edit, delete, list)
- [x] Tag extraction and listing
- [x] Content and tag search
- [x] Trash system
### v1.1 (Future)
- [ ] SQLite indexing for faster search
- [ ] Graph visualization
- [ ] Backlinks
- [ ] Watch mode (auto-index on changes)
### v2.0 (Future)
- [ ] Mobile access (native app or PWA)
- [ ] Web interface with authentication
- [ ] OCR support
## License
MIT