Implement Jade CLI v1.0 MVP
Complete implementation of note management CLI with all core features: Commands: - add: Create new notes in $EDITOR with auto-generated filenames - list: Display all notes with titles, paths, and tags - search: Full-text search via ripgrep, tag-based filtering - tags: List all tags with occurrence counts - edit: Fuzzy search and edit notes by title - rm: Move notes to trash with confirmation prompt Features: - Automatic depository structure initialization (.jade/trash/) - Configurable tag prefix (default '+') - Parse title from first # heading (filename fallback) - Extract tags anywhere in content - Parse both [[wiki-links]] and [markdown](links) - Trash system with timestamps to prevent conflicts Technical: - Global config at ~/.config/jade/config.yml - Per-depository settings support - Ripgrep integration for fast search - $EDITOR integration for note editing - Comprehensive README with usage examples
This commit is contained in:
+148
-1
@@ -1,2 +1,149 @@
|
||||
# Jade CLI
|
||||
The note projects 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
|
||||
|
||||
### 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 `~/.config/jade/config.yml` (by default).
|
||||
|
||||
Example config:
|
||||
```yaml
|
||||
depo_path: /home/user/jade-depository
|
||||
config_path: /home/user/.config/jade
|
||||
tag_prefix: "+"
|
||||
```
|
||||
|
||||
You can override these with flags:
|
||||
- `--depo`: Depository path
|
||||
- `--config`: Config directory path
|
||||
|
||||
## Depository Structure
|
||||
|
||||
```
|
||||
jade-depository/
|
||||
├── .jade/
|
||||
│ └── trash/ # Deleted notes go here
|
||||
├── note-1.md
|
||||
├── note-2.md
|
||||
└── subfolder/
|
||||
└── note-3.md
|
||||
```
|
||||
|
||||
The `.jade/` directory is automatically created and should be added to `.gitignore`.
|
||||
|
||||
## 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
|
||||
|
||||
Reference in New Issue
Block a user