docs: document default mode shortcuts for save and get

- Quick Start: show bare keep <tag> (save) and keep <#> (get) shortcuts
- Save Mode: note that --save is optional when piping content
- Get Mode: clarify that only numeric IDs default to Get mode;
  fix incorrect keep <tag> example that would actually save
This commit is contained in:
2026-03-14 11:48:37 -03:00
parent 2ffa2a977a
commit 4b51825917

View File

@@ -134,10 +134,13 @@ cargo build --release --features server,client,swagger
## Quick Start ## Quick Start
```sh ```sh
# Save content with a tag # Save content with a tag (--save is optional when piping)
echo "Hello, world!" | keep --save greeting echo "Hello, world!" | keep greeting
# Retrieve by tag # Retrieve by ID (--get is optional for numeric IDs)
keep 1
# Retrieve by tag (--get is required for tags)
keep --get greeting keep --get greeting
# List all stored items # List all stored items
@@ -176,14 +179,15 @@ keep --list --meta project=myapp
### Save Mode ### Save Mode
Save stdin content with tags and metadata. Save stdin content with tags and metadata. The `--save` flag is optional when piping content.
```sh ```sh
# Save (auto-assigned ID, no tag) # Save (auto-assigned ID, no tag)
echo "data" | keep --save echo "data" | keep --save
# Save with a tag # Save with a tag (--save is optional when piping)
echo "data" | keep --save my-tag echo "data" | keep --save my-tag
echo "data" | keep my-tag
# Save with multiple tags and metadata # Save with multiple tags and metadata
cat report.pdf | keep --save report --meta project=alpha --meta env=prod cat report.pdf | keep --save report --meta project=alpha --meta env=prod
@@ -196,16 +200,15 @@ Tags and metadata make items easy to find later. Tags are simple identifiers; me
### Get Mode ### Get Mode
Retrieve items by ID or tags. This is the default mode when IDs are provided. Retrieve items by ID. This is the default mode when numeric IDs are provided.
```sh ```sh
# Get by ID # Get by ID (no --get needed for numeric IDs)
keep --get 1 keep --get 1
keep 1 keep 1
# Get by tag # Get by tag (requires --get flag)
keep --get my-tag keep --get my-tag
keep my-tag
# Get with filters applied # Get with filters applied
keep --get 1 --filters "head_lines(10)" keep --get 1 --filters "head_lines(10)"