silk-guide(1) — Search Curated Silk Example Guides
NOTE: This is the Markdown source for the eventual man 1 page for
silk guide. The roff-formatted manpage should be generated from this content.
Name#
silk-guide — search curated example guides and show runnable Silk patterns.
Synopsis#
silk guide [options] <query>silk guide --show <id>silk guide --show <id-or-prefix>silk guide --list
Description#
silk guide queries an installed SQLite guide database generated from the
curated catalog at examples/guide/catalog.json. The seeded corpus is kept
at a floor of 1000 entries and combines runnable examples with
documentation-backed reference guides for every canonical language and
standard-library page.
Each guide entry contains:
- a stable guide id,
- a title and short summary,
- the stored Silk example or reference source,
- aliases,
- tags,
- platforms,
- std module references,
- environment/runtime requirements,
- linked documentation references,
- optional diagnostic-code links,
- generated public std symbol lookup terms,
- related guide ids,
- and verification flags.
Query Modes#
- Free text:
silk guide read filesilk guide tcp loopbacksilk guide http requestsilk guide mime content typesilk guide atomic countersilk guide protobuf schema roundtrip- Exact tag filter:
silk guide tags:concurrency- Exact std-module filter:
silk guide module:std::tasksilk guide std::tasksilk guide module:std::mime- Exact public std symbol lookup:
silk guide std::http::requestsilk guide std::mime::content_type_withsilk guide std::atomic::AtomicU64.fetch_addsilk guide std::dylib::open_selfsilk guide ByteSlice.find_bytessilk guide std::protobuf::Reader.read_keysilk guide GL_TEXTURE_2D- Documentation-backed references:
silk guide tags:reference-guidesilk guide language typessilk guide language atomicssilk guide std io overview- Exact diagnostic-code filter:
silk guide diag:E2034silk guide E2034- Exact guide id:
silk guide fs/file-roundtripsilk guide --show fs/file-roundtrip- Guide-id prefix expansion for show:
silk guide --show fssilk guide --show task- Exact alias match:
silk guide read filesilk guide tcp server
Options#
--help,-h— show command help and exit.--list— list seeded guide ids and titles.--show <id>— print one full guide entry including stored source.--printer <cmd>— override the source printer used by--show(flag first, thenSILK_GUIDE_PRINTER, thenbat, thencat).--json— emit structured JSON for search or show output.--limit <n>— limit list/search results (default:8).--db <path>— override the guide database path.
Database Resolution#
By default, silk guide looks for:
SILK_GUIDE_DBwhen set,SILK_GUIDE_PRINTERwhen set and--printeris not provided for--show,- otherwise
../share/silk/guide.dbrelative to thesilkexecutable, - otherwise the staged development path under
build/share/silk/guide.dbwhen available.
Notes#
- Exact tag/module/diagnostic/alias lookups use normalized SQLite metadata tables.
- Exact public std symbol lookups use generated metadata from shipped
std/**/*.slkmodules and route to the matching API guide. --showaccepts exact ids and id-prefixes; a prefix likefsmay render multiplefs/...guides. Prefix output collapses generated variants that share the same source body and prefers the canonical overview entry.- Free-text queries use a bundled SQLite FTS5 index over guide titles, summaries, stored Silk source, aliases, keywords, tags, modules, requirements, docs, and diagnostics.
- Common filler words are ignored and an intent-routing pass runs before
FTS search, so natural queries like
how to read a file,how can i open a file and read it,read from stdin, orhow do i make a http requeststill resolve. - Non-empty searches that still miss after alias/FTS routing report no matches
instead of printing the alphabetical
--listoutput. - Text search results print an explicit
matched:reason so users can see why an example was returned. - Text search results do not print a
source:metadata line. --jsonemits structured arrays for aliases/tags/platforms/modules/ requirements/docs/diagnostics/keywords instead of flattening them into presentation strings.- Guide show text does not include
Run:,Source:, orVerified:summary fields. - Guide
Docs:references are rendered as canonical docs URLs. - Guide source is printed via the configured printer path (or direct source fallback) rather than fenced code blocks.
--showprints action-first metadata in this order:What,Why,Docs, and the remaining environment/search details, followed by the stored Silk source.- Seeded guide sources are verification-backed by the repo test suite:
every distinct source path is checked, fixture-backed entries remain
promoted to
verified_build, entries are built whenverified_build = true, and they run under a bounded timeout whenverified_run = true. - The repo test suite also verifies that every canonical language and
standard-library documentation page is referenced by at least one guide entry, and that
every shipped std
exportdeclaration and public method (public fnorpublic async fn) has generated symbol lookup metadata. - High-traffic diagnostics may point directly at guide lookups such as
silk guide E2030orsilk guide E2034.
See Also#
Source repository · Edit this page · View Markdown