mirror of
https://github.com/logseq/logseq.git
synced 2026-05-18 09:52:22 +00:00
enhance(cli): add example subcmd
This commit is contained in:
@@ -110,8 +110,11 @@ Auth commands:
|
||||
- `login` - authenticate this machine and create/update `~/logseq/auth.json`
|
||||
- `logout` - remove persisted CLI auth from `~/logseq/auth.json`
|
||||
|
||||
Shell completion:
|
||||
Shell completion and examples:
|
||||
- `completion <zsh|bash>` - generate shell completion script to stdout
|
||||
- `example <command-or-prefix...>` - show runnable command examples for a command path or command prefix (phase 1 covers Graph Inspect and Edit commands)
|
||||
- exact selector example: `logseq example upsert page`
|
||||
- prefix selector example: `logseq example upsert`
|
||||
|
||||
Setup for zsh (add to `~/.zshrc`):
|
||||
```bash
|
||||
@@ -240,6 +243,7 @@ Output formats:
|
||||
- Output formatting is controlled via global `--output`, `:output-format` in config, or `LOGSEQ_CLI_OUTPUT`.
|
||||
- Global `--profile` enables stage timing output to **stderr**. This is for debugging latency and does not change command stdout payloads.
|
||||
- Human output is plain text. List/search commands render tables with a final `Count: N` line. For list and search subcommands, the ID column uses `:db/id` (not UUID). If `:db/ident` exists, an `IDENT` column is included. `list property` includes dedicated `TYPE` and `CARDINALITY` columns. Search table columns are `ID` and `TITLE`. Block titles can include multiple lines; multi-line rows align additional lines under the `TITLE` column. Times such as list `UPDATED-AT`/`CREATED-AT` and `graph info` `Created at` are shown in human-friendly relative form. Errors include error codes and may include a `Hint:` line. Use `--output json|edn` for structured output.
|
||||
- `example` human output includes `Selector`, `Matched commands`, and `Examples` sections. Structured output (`json`/`edn`) includes `selector`, `matched-commands`, `examples`, and `message` fields under `data`.
|
||||
- `sync download` progress lines are streamed to stdout only when progress is enabled. In `json`/`edn` mode, progress is disabled by default unless `--progress true` is provided.
|
||||
- JSON machine output preserves namespaced keyword semantics:
|
||||
- Namespaced keyword keys are emitted as canonical string keys in `namespace/name` form (for example `:block/title` -> `"block/title"`).
|
||||
|
||||
Reference in New Issue
Block a user