KnownTrade query API
====================

This endpoint understands a small set of plain-English commands.
Commands are URL-encoded and appended to /cmd/ — the full
command lives in the URL path so every distinct query has a
distinct cacheable URL.

COMMANDS
  tree [path]                   show the category hierarchy under [path]
  list [path]                   list immediate children under [path]
  find [path] [--name pattern]  recursively find entries by slug or name
  read <slug|path>              print the full markdown body of an entry
  read <slug|path> --first N    print only the first N lines (--last N for the end)
  stats <slug|path>             word, line, character count
  search <pattern> [path]       full-text search (FTS5)
  history <slug|path>           version history for an entry
  history <slug|path> --lines   per-line view — author and date next to every line

LEGACY SPELLINGS (301-redirect to their canonical form)
  ls -> list
  cat / show -> read
  head / tail -> read --first / --last
  wc -> stats
  grep / rg / ripgrep / git grep -> search
  git log / versions -> history
  git blame -> history --lines
  fd -> find

EXAMPLES
  curl 'https://knowntrade.org/cmd/tree%20information-services'
  curl 'https://knowntrade.org/cmd/list%20information-services%2Fbusiness-directories'
  curl 'https://knowntrade.org/cmd/read%20knowntrade'
  curl 'https://knowntrade.org/cmd/search%20%22directory%22'
  curl 'https://knowntrade.org/cmd/history%20knowntrade'

OUTPUT FORMATS
  default              plain text (terminal-friendly)
  ?format=json         structured JSON

See https://knowntrade.org/llms.txt for the full site overview.

---
Source: KnownTrade (https://knowntrade.org)
License: CC-BY-SA 4.0

