CLI
-
Tutorial/Installation#CLI After installing, see Getting Started for the basic flow. You can find the latest version on GitHub Releases. https://github.com/boykush/scraps/releases Requirements The git command is required for features. Cargo ❯ cargo install scraps macOS / Linux (Homebrew) ❯ brew install boykush/tap/scraps GitHub Releases Download the binary for your platform and place it in your PATH: # macOS (Apple Silicon) ❯ curl -sL https://github.com/boykush/scraps/releases/latest/download/scraps-aarch64-apple-darwin.tar.gz | tar xz # macOS (Intel) ❯ curl -sL https://github.com/boykush/scraps/releases/latest/download/scraps-x86_64-apple-darwin.tar.gz | tar xz # Linux (x86_64) ❯ curl -sL https://github.com/boykush/scraps/releases/latest/download/scraps-x86_64-unknown-linux-gnu.tar.gz | tar xz # Linux (ARM64) ❯ curl -sL https://github.com/boykush/scraps/releases/latest/download/scraps-aarch64-unknown-linux-gnu.tar.gz | tar xz Then move the binary to a directory in your PATH: ❯ sudo mv scraps /usr/local/bin/
-
Tutorial/Getting Started#CLI This guide gets you from an empty directory to a small Scraps wiki that can be built as a static site and queried from the CLI. For the bigger picture of what Scraps is and why, see What is Scraps?. Setup Install Scraps — follow Installation. Initialize a project — create a directory and initialize it: ❯ mkdir my-knowledge-base ❯ cd my-knowledge-base ❯ scraps init This writes a .scraps.toml to the current directory. The directory containing it becomes the wiki root. Configure the project — open .scraps.toml and set [ssg] base_url and title. See Configuration#ssg-section for the full schema. Authoring Write Markdown files next to .scraps.toml or in folders under it. Standard CommonMark and GitHub-flavored Markdown are supported — see Markdown Support. Connect scraps with wiki-links. The full notation is in Wiki-link Notation; the most common forms are: [[Page Name]] — normal link [[Page Name|Display]] — alias [[Folder/Page Name]] — context-qualified [[Page Name#Heading]] — heading reference ![[Page Name]] — embed another scrap inline #[[Topic]] — tag (separate namespace from scraps) #[[Area/Sub]] — nested tag (auto-aggregated) Build and preview ❯ scraps build # write _site/ ❯ scraps serve # serve at http://127.0.0.1:1112 The output structure, README.md handling, and search index are documented in Static Site. For deploying, see Deploy to GitHub Pages. Lint scraps lint checks wiki health: dead-end scraps, broken links, broken heading references, repeated links, and more. Rules are documented in Lint Rules. ❯ scraps lint AI integration Scraps is CLI-first for AI agents. Any assistant that can run shell commands can query the wiki: ❯ scraps search "query" --json ❯ scraps get "Page Name" --json ❯ scraps get "Page Name" --heading "Section" --json body ❯ scraps backlinks "Page Name" --json ❯ scraps todo --json scraps get --json returns title, ctx, and body by default. It can also project fields such as headings, code_blocks, or images, and --heading narrows the read to one section. For Claude Code users there is also an official skills bundle. See Integrate with AI Assistants for both paths.
-
Reference/CLI Overview#CLI Scraps is a CLI-first compiler. Every command supports --help, which is the authoritative reference for flags and arguments. This page is the map. Command Role --json scraps init Write .scraps.toml to the current directory – scraps build Compile to the _site/ static site – scraps serve Build then serve at http://127.0.0.1:1112 – scraps lint Wiki-link health check (Lint Rules) – scraps get <title> Single-scrap introspection ✓ scraps search <query> Fuzzy search over titles + body ✓ scraps links <title> Outbound wiki-links from a scrap ✓ scraps backlinks <title> Inbound wiki-links to a scrap ✓ scraps tag list List all tags with backlink counts ✓ scraps tag backlinks <tag> Scraps referencing a tag ✓ scraps todo Aggregate GFM task list items wiki-wide ✓ scraps mcp serve Start an MCP server – -C / --directory (or SCRAPS_DIRECTORY env) runs as if started in the given directory. JSON Reads scraps get reads one scrap, optionally scoped by context and heading: scraps get "Title" --ctx "Book" --heading "Install" --json Its --json flag accepts an optional comma-separated field projection. With no projection it returns title, ctx, and body. scraps get "Title" --json title,ctx,body scraps get "Title" --json code_blocks scraps get "Title" --json images scraps get "Title" --heading "Install" --json body,headings Allowed fields are title, ctx, body, headings, code_blocks, and images. Reference navigation stays separate: use scraps links, scraps backlinks, and scraps tag .... scraps links --json returns outbound reference occurrences. Each result has kind (link or embed), title, ctx, and heading, so agents can jump directly to scraps get <title> --ctx <ctx> --heading <heading>. scraps backlinks --json remains scrap-level inbound discovery and returns the scraps that link to the requested scrap. For agent integration, see Integrate with AI Assistants.
-
Reference/Lint Rules#CLI Wiki-link quality rules used by CLI Overview's lint command. Default rules are graph-mechanical (no external dependencies); rules with dependencies are opt-in via --rule or [lint.<rule>] in Configuration. Rule Detects Default dead-end scrap with no outbound links on lonely scrap with no backlinks on self-link scrap links to itself on overlinking same [[link]] repeated in one scrap on broken-link [[link]] that does not resolve on broken-heading-ref [[Page#Heading]] heading missing on stale-by-git last commit older than threshold (git-dependent) opt-in Output follows the cargo clippy-style diagnostic format. For LLM-driven purpose-based rule selection, see the lint-rule-handler agent in the scraps plugin.