npm package: @shiori-sh/cli
Description: CLI for managing your Shiori link library
Author: Brian Lovin
Latest version: 0.8.0

# @shiori-sh/cli

Command-line interface for [Shiori](https://www.shiori.sh) — save, organize, and manage your links from the terminal.

## Install

```bash
npm install -g @shiori-sh/cli
```

Or use without installing:

```bash
npx @shiori-sh/cli list
```

## Authenticate

```bash
shiori auth
```

This saves your API key to `~/.shiori/config.json`. Generate an API key at [shiori.sh/home](https://www.shiori.sh/home) → Settings.

You can also set `SHIORI_API_KEY` as an environment variable.

## Commands

```bash
shiori list                        # List recent links
shiori list --read unread          # List unread links
shiori list --tag "design"         # Filter links by tag
shiori list --since 7d             # Links saved in the last 7 days
shiori list --content --json       # Include full markdown content

shiori search "react hooks"        # Full-text search
shiori search "AI" --since 30d     # Search within a time window
shiori search "go" --content --json # Search with full content

shiori get <id>                    # Get a link with full content
shiori content <id>                # Print raw markdown (for piping)

shiori save <url>                  # Save a new link
shiori save <url> --title "..."    # Save with custom title

shiori update <id> --read          # Mark as read
shiori update <id> --unread        # Mark as unread
shiori update <id> --title "..."   # Update title
shiori update <id> --restore       # Restore from trash
shiori update --ids <id1,id2,...> --read   # Bulk mark as read
shiori update --ids <id1,id2,...> --unread # Bulk mark as unread

shiori delete <id>                 # Move to trash
shiori delete --ids <id1,id2,...>  # Bulk move to trash
shiori trash                       # List trashed links
shiori trash --empty               # Permanently delete all trash

shiori tags list                    # List your tags
shiori tags create "design"        # Create a tag
shiori tags update <id> --name "dev"  # Rename a tag
shiori tags delete <id>            # Delete a tag
shiori tags set <link-id> design,work  # Set tags on a link

shiori subscriptions list           # List RSS subscriptions
shiori subscriptions add <url>     # Subscribe to an RSS feed
shiori subscriptions add <url> --sync  # Subscribe and sync recent items
shiori subscriptions remove <id>   # Remove a subscription
shiori subscriptions sync <id>     # Sync a subscription now
shiori subscriptions sync <id> --limit 5  # Sync with item limit

shiori whoami                      # Show account info
shiori auth --status               # Check auth status
shiori auth --logout               # Remove stored credentials
```

Add `--json` to any command for machine-readable output.

## AI and Scripting

The CLI is designed to make your links accessible to AI tools and scripts:

```bash
# Pipe link content to an LLM
shiori content <id> | llm "summarize this"

# Get recent links with full content as JSON
shiori list --since 7d --content --json

# Search and pipe results
shiori search "react" --content --json | jq '.links[].content'

# Duration shortcuts: 1h, 7d, 2w, 1m, 1y
shiori list --since 2w --json
```

## Environment Variables

| Variable          | Description                                        |
| ----------------- | -------------------------------------------------- |
| `SHIORI_API_KEY`  | API key (overrides config file)                    |
| `SHIORI_BASE_URL` | Custom base URL (default: `https://www.shiori.sh`) |

## License

MIT