### Start Firefox headless for BiDi backend Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/crawler.md Start Firefox with a dedicated profile and enable the Remote Agent for BiDi. This example runs headless without a graphical display. Keep Firefox running and use a second terminal for Hister. ```bash mkdir -p "$HOME/.local/share/hister-firefox" firefox --headless --no-remote \ --profile "$HOME/.local/share/hister-firefox" \ --remote-debugging-port 9222 ``` -------------------------------- ### Install frontend dependencies Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/developer.md Run once before using frontend commands to install required JavaScript dependencies. ```bash ./manage.sh install_js_deps ``` -------------------------------- ### Self-hosting Resources Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/query-language.md A query example for finding self-hosted resources related to Docker, Kubernetes, or Compose, with guide or tutorial in the title. ```textplain "self-hosted" (docker|kubernetes|compose) title:(guide|tutorial) ``` -------------------------------- ### Documentation Searches Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/query-language.md A query example for finding documentation pages with setup, installation, or configuration in the title, from .io or .dev domains, and mentioning 'hister'. ```textplain title:(setup|installation|configuration) domain:(*.io|*.dev) hister ``` -------------------------------- ### Start the Hister server with 'hister listen' Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/posts/how-hister-works.md Starts the Hister server so it can receive data from the browser extension and respond to searches. Typically run once at startup or set to start automatically. ```bash hister listen ``` -------------------------------- ### get_preview basic request example Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/mcp.md Example request for get_preview with only the required url argument. The response includes title, URL, dates, and available preview metadata. ```json { "url": "https://example.com/article" } ``` -------------------------------- ### Search Example with Fields Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/mcp.md Example request body for the `search` tool to include full article text for summarization without re-fetching URLs. ```json { "query": "kubernetes networking", "limit": 5, "fields": ["text"] } ``` -------------------------------- ### Import Linkwarden with custom backend and options Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/import.md Example command for importing from Linkwarden using the chromedp backend with a custom executable path, skipping existing documents, filtering by start date, and setting batch size. Requires a valid API token and Linkwarden API access. ```bash hister import linkwarden https://links.example.com \ --backend chromedp \ --backend-option exec_path=/usr/bin/chromium \ --skip-existing \ --start-date 2024-01-01 \ --batch-size 25 ``` -------------------------------- ### Full crawler configuration example Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/configuration.md Complete example of the crawler section using the http backend with proxy, timeout, delay, user agent, headers, and cookies. ```yaml crawler: backend: 'http' proxy: 'http://127.0.0.1:8080' timeout: 10 delay: 2 user_agent: 'Hister' headers: Accept-Language: 'en-US,en;q=0.9' cookies: - name: 'session' value: 'abc123' domain: 'example.com' path: '/' ``` -------------------------------- ### Start Hister server Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/posts/hister-a-private-search-engine-for-teams-and-organizations.md Starts the Hister server with the specified configuration. After this, Alice and Bob can open the group's address and sign in. ```bash hister --config config.yml listen ``` -------------------------------- ### hister user create command usage and remote example Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/user-handling.md Shows the syntax for creating a user and an example for creating an account on a remote server. Requires an administrator's personal access token and user handling enabled on the server. Prompts for password twice; passwords must be 8-72 UTF-8 bytes. ```bash hister user create USERNAME [--admin] [--offline] # Create an account on a remote server hister --server-url https://hister.example --token YOUR_ADMIN_TOKEN user create alice ``` -------------------------------- ### Start qutebrowser with loopback-only debugging endpoint Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/browser-extension.md Required before running the qutebrowser companion. Close all qutebrowser processes, then start qutebrowser with the QTWEBENGINE_REMOTE_DEBUGGING environment variable set to 127.0.0.1:9222. ```bash QTWEBENGINE_REMOTE_DEBUGGING=127.0.0.1:9222 qutebrowser ``` -------------------------------- ### Search Example with Date Range Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/mcp.md Example request body for the `search` tool with a date range filter. ```json { "query": "postgres migration", "date_from": "2026-01-01", "date_to": "2026-01-31" } ``` -------------------------------- ### Clone and build Hister from source Source: https://github.com/asciimoo/hister/blob/master/README.md Development setup: clone the repository, enter the directory, and run the build script. Requires Go 1.26, npm, and a C compiler for CGO dependencies. ```bash git clone https://github.com/asciimoo/hister.git cd hister ./manage.sh build ``` -------------------------------- ### Service import options example Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/posts/new-import-command-structure-and-sources.md Service imports support date filtering, existing URL checks, batch size selection, crawler options, and user selection. This example uses `--start-date`, `--skip-existing`, and `--batch-size` for a Karakeep import. ```bash hister import karakeep https://karakeep.example.com \ --start-date 2025-01-01 \ --skip-existing \ --batch-size 25 ``` -------------------------------- ### Install Hister into user profile with Nix Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/installing.md Installs Hister into the user profile using nix profile install. ```nix nix profile install github:asciimoo/hister ``` -------------------------------- ### POST /api/users request example Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/developer.md Example HTTP request to create a user. Requires app.user_handling: true and an administrator's token or session. The body must be a single JSON object with username and password strings; is_admin is optional and defaults to false. Unknown fields, null values, and trailing JSON are rejected. ```http POST /api/users Authorization: Bearer Origin: hister:// Content-Type: application/json {"username":"alice","password":"example-password","is_admin":false} ``` -------------------------------- ### Start Hister with metrics enabled via environment variable Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/monitoring.md Use this command to start Hister with metrics enabled via the `HISTER__SERVER__METRICS` environment variable. This is an alternative to the YAML configuration. ```bash HISTER__SERVER__METRICS=true hister listen ``` -------------------------------- ### Supply backend options, proxy, headers, and cookies Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/import.md Example of a browser import with a custom backend executable path, proxy, request header, and cookie. Flags can be repeated; cookies require a Domain attribute. ```bash hister import browser \ --backend chromedp \ --backend-option exec_path=/usr/bin/chromium \ --proxy http://127.0.0.1:8080 \ --header "Accept-Language=en" \ --cookie "session=abc; Domain=example.com" ``` -------------------------------- ### Configuration and diagnostics commands Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/terminal-client.md Commands for creating, locating, showing, validating configuration, reloading the server, and running diagnostics. Includes examples with --config, --server-url, and --token flags. Note that reload requires an admin token in multi-user mode and causes a brief interruption. ```bash hister config create ~/.config/hister/config.yml hister config path hister config show hister --config /etc/hister/config.yml config validate hister reload hister doctor hister --server-url https://hister.example.com --token "$HISTER_TOKEN" doctor --format json ``` -------------------------------- ### Example output of hister user show Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/user-handling.md Example output from the `hister user show` command, showing the user's username, ID, admin status, and creation/update timestamps. ```text Username: alice ID: 1 Admin: yes Created at: 2026-03-26 09:00:00 Updated at: 2026-03-26 09:00:00 ``` -------------------------------- ### ytdlp extractor example configuration Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/extractors.md Example YAML configuration for the ytdlp extractor. It enables the extractor and sets options such as binary path, timeout, max concurrent jobs, subtitle fetching, cookies from browser, extra arguments for proxy, and extra domains. ```yaml extractors: ytdlp: enable: true options: binary: /usr/local/bin/yt-dlp timeout: 30 max_concurrent_jobs: 2 fetch_subtitles: true sub_language: en cookies_from_browser: firefox extra_args: - --proxy - socks5://127.0.0.1:1080 extra_domains: - vimeo.com ``` -------------------------------- ### Privacy and security filter examples Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/query-language.md A set of example queries demonstrating filters for title, domain, text, URL pattern, language, type, visits, added, and user_id. ```textplain title:privacy domain:mozilla.org ``` ```textplain title:"security audit" text:vulnerability ``` ```textplain url:*/privacy-policy ``` ```textplain domain:privacyguides.org text:encryption ``` ```textplain language:en type:web ``` ```textplain visits:2..4 domain:example.com ``` ```textplain added:<7d domain:example.com ``` ```textplain user_id:3 domain:example.com ``` -------------------------------- ### Generate full configuration with defaults Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/configuration.md Prints the complete configuration with all current default values for the installed Hister version. ```bash hister config create ``` -------------------------------- ### Run web app with hot reload Source: https://github.com/asciimoo/hister/blob/master/README.md Starts a Vite development server and the Go backend with automatic rebuilds through air. Use for working on the web app. ```bash npm run serve:app ``` -------------------------------- ### Install Hister via Homebrew Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/installing.md Installs Hister using Homebrew. The binary is placed in your $PATH, which can be opt/homebrew (Apple Silicon), /usr/local (macOS Intel), or /home/linuxbrew/.linuxbrew (Linux). ```bash brew install hister ``` -------------------------------- ### Install Hister package only with Home Manager Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/installing.md Installs only the Hister package without enabling a service, using home.packages. ```nix { inputs, pkgs, ... }: { home.packages = [ inputs.hister.packages.${pkgs.stdenvNoCC.hostPlatform.system}.default ]; } ``` -------------------------------- ### get_facets request example Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/mcp.md Example request for get_facets with a query and limit. The limit is optional and defaults to 10; values outside 1 to 100 use the default. ```json { "query": "python", "limit": 5 } ``` -------------------------------- ### Semantic search configuration example Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/configuration.md Example configuration for enabling semantic search with an OpenAI-compatible embeddings endpoint. Uses nomic-embed-text via Ollama, which produces 768-dimensional vectors. The query_prefix and document_prefix values are recommended by the Nomic model; other models use different conventions. Set both to empty strings for models that do not use prefixes. ```yaml semantic_search: enable: true embedding_endpoint: 'http://localhost:11434/v1/embeddings' embedding_model: 'nomic-embed-text' embedding_timeout: 300 dimensions: 768 max_context_length: 512 chunk_overlap: 50 max_embedding_batch_size: 8 query_prefix: 'search_query: ' document_prefix: 'search_document: ' similarity_threshold: 0.5 result_limit: 10 semantic_weight: 0.4 max_embedding_concurrency: 2 max_query_embedding_concurrency: 1 query_embedding_timeout: 2 # api_key: 'sk-...' # required for hosted providers # headers: {} # extra HTTP headers for proxies or custom auth ``` -------------------------------- ### Start Hister server on Linux/macOS Source: https://github.com/asciimoo/hister/blob/master/README.md Starts the Hister server. Keep the terminal open while using Hister; the server must be running to index pages and search them. On Windows, use '.\.hister.exe listen' in PowerShell. ```bash ./hister listen ``` -------------------------------- ### Install Playwright Chromium for browser tests Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/developer.md Install Chromium with dependencies before running app browser tests. The tests mock the HTTP API and WebSocket, so no Go server is needed. ```bash npm exec -w @hister/app -- playwright install --with-deps chromium ``` -------------------------------- ### Get Preview with MCP get_preview Tool Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/developer.md Calls the get_preview tool for a URL. Use fields to select text, html, and metadata; omitted fields default to all three. ```bash curl -s -X POST http://127.0.0.1:4433/mcp \ -H "Content-Type: application/json" \ -H "Authorization: Bearer " \ -d '{"jsonrpc":"2.0","id":5,"method":"tools/call","params":{"name":"get_preview","arguments":{"url":"https://example.com/article"}}}' ``` -------------------------------- ### hister user delete command usage and remote example Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/user-handling.md Shows the syntax for soft-deleting a user and an example for deleting an account and its indexed documents on a remote server. Requires user_handling: true on the server and an administrator's token. Refuses to continue without --purge if the user owns indexed documents. ```bash hister user delete USERNAME [--purge] # Delete an account and its indexed documents on a remote server hister --server-url https://hister.example --token YOUR_ADMIN_TOKEN user delete alice --purge ``` -------------------------------- ### get_preview paginated text request example Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/mcp.md Example request for get_preview to read a long article in smaller portions without HTML. Uses fields and max_chars to limit the response. ```json { "url": "https://example.com/article", "fields": ["text", "metadata"], "max_chars": 4000 } ``` -------------------------------- ### Minimal extractor implementation for MySite Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/posts/extractors-an-ecosystem-for-better-search.md A complete example extractor that matches URLs with a specific prefix, falls back to the generic extractor for indexing, and provides a sanitized preview. It includes configuration handling that rejects unknown options. ```go // SPDX-License-Identifier: AGPL-3.0-or-later package mySite import ( "fmt" "strings" "github.com/PuerkitoBio/goquery" "github.com/asciimoo/hister/server/extractor/sdk" "github.com/asciimoo/hister/server/sanitizer" ) const matchPrefix = "https://example.com/posts/" type MySiteExtractor struct { cfg *sdk.Config } func (e *MySiteExtractor) Name() string { return "MySite" } func (e *MySiteExtractor) Description() string { return "Renders example.com posts" } func (e *MySiteExtractor) Capabilities() sdk.Capabilities { return sdk.Capabilities{Preview: true} } func (e *MySiteExtractor) Match(d *sdk.Document) bool { return strings.HasPrefix(d.URL, matchPrefix) } func (e *MySiteExtractor) Extract(d *sdk.Document) sdk.ExtractResult { // Let the generic Readability extractor handle indexing. return sdk.ExtractFallback(nil) } func (e *MySiteExtractor) Preview(d *sdk.Document) sdk.PreviewResult { doc, err := goquery.NewDocumentFromReader(strings.NewReader(d.HTML)) if err != nil { return sdk.PreviewFallback(err) } content, err := doc.Find("article.post-body").Html() if err != nil { return sdk.PreviewFallback(err) } return sdk.Previewed(sdk.PreviewResponse{ Content: sanitizer.SanitizeHTML(content), }) } func (e *MySiteExtractor) GetConfig() *sdk.Config { if e.cfg == nil { return &sdk.Config{Enable: true, Options: map[string]any{}} } return e.cfg } func (e *MySiteExtractor) SetConfig(c *sdk.Config) error { for k := range c.Options { return fmt.Errorf("unknown option %q", k) } e.cfg = c return nil } ``` -------------------------------- ### Check remote server configuration with --config Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/troubleshooting.md Runs config path and validate on a remote server's configuration file by specifying the same path used when starting Hister. Use the same path you pass when starting Hister. ```bash hister --config /path/to/config.yml config path hister --config /path/to/config.yml config validate ``` -------------------------------- ### Index multiple sources with labels Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/posts/index-your-documentation.md Repeat the indexing pattern for each source you want to group. The examples label internal API docs and GitHub issues with `internal-api` and `projectx-issues` respectively. ```bash hister index --recursive \ --allowed-domain=docs.yourcompany.com \ --label=internal-api \ https://docs.yourcompany.com/ ``` ```bash hister index --recursive \ --allowed-pattern="https://github.com/yourorg/yourrepo/issues/.*" \ --label=projectx-issues \ https://github.com/yourorg/yourrepo/issues ``` -------------------------------- ### Start Docker Compose with SOPS environment Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/posts/using-hister-for-threat-intelligence-workflows.md Loads encrypted environment variables from .env.enc using SOPS and starts the Docker Compose services. The access token is stored encrypted and loaded as an environment variable. ```bash sops exec-env .env.enc 'docker compose up -d' ``` -------------------------------- ### Nix flake setup for Hister Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/installing.md Adds Hister as a flake input and shows how to use its NixOS, Home Manager, and Darwin modules in your configuration. ```nix { inputs.hister.url = "github:asciimoo/hister"; outputs = { self, nixpkgs, hister, ... }: { nixosConfigurations.yourHostname = nixpkgs.lib.nixosSystem { modules = [ ./configuration.nix hister.nixosModules.default ]; }; homeConfigurations."yourUsername" = home-manager.lib.homeManagerConfiguration { modules = [ ./home.nix hister.homeModules.default ]; }; darwinConfigurations."yourHostname" = darwin.lib.darwinSystem { modules = [ ./configuration.nix hister.darwinModules.default ]; }; }; } ``` -------------------------------- ### Example URL list file Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/crawler.md A text file containing one URL per line, used as input for the hister index --input command. Blank lines and surrounding whitespace are ignored. ```text https://example.com/guide https://example.com/reference https://example.org/manual ``` -------------------------------- ### Run the qutebrowser companion Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/browser-extension.md Run in a separate terminal after starting qutebrowser with the debugging endpoint. Uses server.base_url and app.access_token from the normal Hister configuration. ```bash hister companion qutebrowser ``` -------------------------------- ### Create config file at platform-specific recommended locations Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/configuration.md Shows the recommended config file paths for Linux, macOS, and Windows. Each command creates a config file at the given location. ```bash # Linux hister config create ~/.config/hister/config.yml # macOS hister config create ~/Library/Preferences/hister/config.yml # Windows hister config create %LOCALAPPDATA%\hister\config.yml ``` -------------------------------- ### GET /api/users request with Bearer token Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/developer.md Example request to list users with a username filter and limit. Requires an administrator token. The response includes a users array and optional next_after_id cursor. ```http GET /api/users?username=alice&limit=1 Authorization: Bearer ``` -------------------------------- ### Finding Privacy Tools Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/query-language.md A query example for finding privacy-related tools that are open source, not commercial, and of type web. ```textplain (privacy|security) tools "open source" -commercial type:web ``` -------------------------------- ### Create configuration file at a specific path Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/configuration.md Creates the configuration file directly at the specified destination path. ```bash hister config create /path/to/config.yml ``` -------------------------------- ### Allow rules example patterns Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/rules.md Allow rules limit indexing to URLs matching at least one pattern. Patterns are combined with OR. An empty allow list permits any URL not matching a skip rule. Skip rules take precedence. ```text ^https://example\.com/ ^https://docs\.example\.org/ ``` -------------------------------- ### Examples of quoted phrase searches Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/query-language.md Three examples of quoted phrase searches for exact phrases. ```textplain "self-hosted applications" ``` ```textplain "data privacy regulations" ``` ```textplain "end-to-end encryption" ``` -------------------------------- ### Install Hister package only on NixOS Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/installing.md Installs only the Hister package without enabling a service, using environment.systemPackages. ```nix { inputs, pkgs, ... }: { environment.systemPackages = [ inputs.hister.packages.${pkgs.stdenvNoCC.hostPlatform.system}.default ]; } ``` -------------------------------- ### Create index, index documents, and query with Bleve in Go Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/posts/data-indexing-in-golang.md Shows the full workflow: create or open an index at 'example.bleve', index three documents with unique IDs, then run a match query for 'Hister search engine' and print scores and fields. Uses bleve.NewIndexMapping() for default mapping and bleve.NewMatchQuery for full-text search. ```go package main import ( "fmt" "log" bleve "github.com/blevesearch/bleve/v2" ) // Document represents the data we want to index and search. type Document struct { Title string URL string Text string } func main() { // Create a new index on disk. If one already exists at that path, open it. mapping := bleve.NewIndexMapping() index, err := bleve.New("example.bleve", mapping) if err != nil { index, err = bleve.Open("example.bleve") if err != nil { log.Fatal(err) } } defer index.Close() // Index a handful of documents. The first argument is a unique ID; // the second is any Go value, Bleve will reflect over its fields. docs := map[string]Document{ "1": {Title: "Go Programming", URL: "https://go.dev", Text: "Go is an open source programming language that makes it easy to build reliable software."}, "2": {Title: "Bleve Search", URL: "https://blevesearch.com", Text: "Bleve is a full-text search and indexing library for Go."}, "3": {Title: "Hister - Your own search engine", URL: "https://hister.org/", Text: "Full-text search across your files, browsing history and beyond."}, } for id, doc := range docs { if err := index.Index(id, doc); err != nil { log.Printf("failed to index %s: %v", id, err) } } // Query the index. NewMatchQuery performs a full-text search across // all indexed fields and ranks results by relevance score. query := bleve.NewMatchQuery("Hister search engine") req := bleve.NewSearchRequest(query) req.Fields = []string{"Title", "URL"} // which stored fields to return req.Size = 10 // maximum number of hits results, err := index.Search(req) if err != nil { log.Fatal(err) } fmt.Printf("Found %d result(s):\n", results.Total) for _, hit := range results.Hits { fmt.Printf(" [%.4f] %s %s\n", hit.Score, hit.Fields["Title"], hit.Fields["URL"]) } } ``` -------------------------------- ### Field-specific negation examples Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/query-language.md Examples of negating specific fields: domain, url, quoted phrase, language, and type. ```textplain security -domain:facebook.com ``` ```textplain title:hister -url:*/issues/* ``` ```textplain privacy -"social media" ``` ```textplain -language:en ``` ```textplain -type:file ``` -------------------------------- ### Priority rules example patterns Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/rules.md Priority rules push matching documents to the top of search results regardless of relevance score. Use cases include always surfacing your personal wiki, company internal documentation, or a trusted source. ```text ^https://wiki\.example\.com/ ^https://docs\.example\.com/ ``` -------------------------------- ### Configure directory filetypes filter in YAML Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/file-types.md Example configuration for the `filetypes` setting on a watched directory. Use file extensions without the leading dot. If omitted, all files passing other rules are considered. ```yaml indexer: directories: - path: '~/Documents' label: 'documents' filetypes: ['pdf', 'docx', 'md', 'txt'] ``` -------------------------------- ### Create administrator and member accounts Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/posts/hister-a-private-search-engine-for-teams-and-organizations.md Run these commands with the server stopped. Each command prompts for a password. Use the same configuration and operating system account that will run the server so they use the same database and data directory. Save the administrator token printed by the first command as ADMIN_TOKEN. ```bash hister --config config.yml user create admin --offline --admin hister --config config.yml user create alice --offline hister --config config.yml user create bob --offline ``` -------------------------------- ### hister import sitemap command examples Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/import.md Shows various ways to import a sitemap: from a URL, local file, gzip file with a custom label, and from stdin. The command accepts XML urlset and sitemapindex files, including gzip compressed input. Index files are expanded by downloading referenced sitemaps. Every loc must be an absolute HTTP or HTTPS URL. Duplicate URLs and repeated references are processed once. Image and video extension URLs are not imported as pages. ```bash hister import sitemap https://example.com/sitemap.xml hister import sitemap ./sitemap.xml hister import sitemap ./sitemap.xml.gz --label reference hister import sitemap - < sitemap.xml ``` -------------------------------- ### Fetch a page through Firefox with bidi backend Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/crawler.md Use this command to fetch a page through Firefox using the `bidi` backend. The `/session` path is required. `--force` fetches even if already indexed; omit it for normal runs. ```bash hister index --force \ --backend bidi \ --backend-option socket=ws://127.0.0.1:9222/session \ https://example.com ``` -------------------------------- ### tui.yaml example with theme and hotkey configuration Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/configuration.md Default tui.yaml configuration created on first run of 'hister search'. The 'terminal' color scheme passes through terminal colors; set 'color_scheme' to 'auto', 'dark', or 'light' to use built-in themes. Hotkeys map key combinations to actions. ```yaml dark_theme: 'tokyonight' light_theme: 'catppuccin-latte' color_scheme: 'terminal' hotkeys: ctrl+c: 'quit' f1: 'toggle_help' tab: 'toggle_focus' esc: 'toggle_focus' up: 'scroll_up' k: 'scroll_up' down: 'scroll_down' j: 'scroll_down' enter: 'open_result' y: 'copy_result' v: 'toggle_preview' l: 'edit_label' ctrl+d: 'delete_result' ctrl+t: 'toggle_theme' ctrl+s: 'toggle_settings' ctrl+o: 'toggle_sort' ctrl+e: 'toggle_semantic' alt+1: 'tab_search' alt+2: 'tab_history' alt+3: 'tab_rules' alt+4: 'tab_add' ``` -------------------------------- ### Crawl with scope flags Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/crawler.md Creates a persistent job with ID 'product-docs' that recursively crawls up to 500 pages from two allowed domains, excluding login/logout pages, with a maximum depth of 5. The starting URL must match the allowed patterns. ```bash hister index --recursive \ --job-id product-docs \ --allowed-domain docs.example.com \ --allowed-domain api.example.com \ --exclude-pattern '/(login|logout)(/|$)' \ --max-depth 5 \ --max-links 500 \ https://docs.example.com ``` -------------------------------- ### Selecting a browser or database Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/import.md Provide a browser name, a database path, or both. When only a path is given, the browser is identified by the tables the database contains, not by filename. ```bash # Detect the Firefox database path hister import browser firefox ``` ```bash # Detect the browser type from a database hister import browser ~/.mozilla/firefox/example.default/places.sqlite ``` ```bash # Specify both values hister import browser firefox ~/.mozilla/firefox/example.default/places.sqlite ``` -------------------------------- ### Basic Docker Compose setup for Hister Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/docker.md A minimal docker-compose.yml for a simple local Hister setup. It uses a Docker managed volume for data persistence and maps port 4433. ```yaml services: hister: image: ghcr.io/asciimoo/hister:latest container_name: hister restart: unless-stopped volumes: - hister_data:/hister/data ports: - 4433:4433 volumes: hister_data: ``` -------------------------------- ### Build the website Source: https://github.com/asciimoo/hister/blob/master/CONTRIBUTING.md Builds the @hister/website package. ```bash npm run build -w @hister/website ``` -------------------------------- ### Start Broad, Then Narrow Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/query-language.md Shows a progression of queries, starting with a single term and refining with additional terms and operators. The final query uses quoted phrases, alternations, and a negation operator. ```textplain # Start with: encryption # Refine to: encryption privacy # Further refine: "end-to-end encryption" (signal|matrix) -deprecated ``` -------------------------------- ### View all available commands with ./hister help Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/terminal-client.md Use this command to list all available Hister commands. It is the entry point for exploring the CLI. ```bash ./hister help ``` -------------------------------- ### Start a named and bounded crawl with hister index Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/crawler.md Starts a recursive crawl with a job ID, allowed domain, max depth, and delay. Use this to begin a resumable crawl job. ```bash hister index --recursive \ --job-id example-docs \ --allowed-domain docs.example.com \ --max-depth 4 \ --delay 1 \ https://docs.example.com ``` -------------------------------- ### Index Go documentation with Hister Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/posts/index-your-documentation.md Use this command to recursively index Go package documentation from pkg.go.dev, restricted to a specific package pattern and limited to a depth of 3. The --allowed-domain flag prevents crawling off-site links, and --allowed-pattern narrows to the desired section. ```bash hister index --recursive \ --allowed-domain=pkg.go.dev \ --allowed-pattern="https://pkg.go.dev/github.com/yourdep/.*" \ --max-depth=3 \ https://pkg.go.dev/github.com/yourdep/package ``` -------------------------------- ### Install Hister via Proxmox VE Community Scripts Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/installing.md Run this bash command on your Proxmox host to install Hister in an LXC container. The script is maintained by the community scripts project, not by Hister, so review it before executing. ```bash bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/ct/hister.sh)" ``` -------------------------------- ### Full build command Source: https://github.com/asciimoo/hister/blob/master/CONTRIBUTING.md Runs the full build using the manage.sh script, with an alternative of running go generate and go build. ```bash ./manage.sh build # or: go generate ./... && go build ``` -------------------------------- ### Aliases example JSON Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/rules.md Aliases are query-time shortcuts: before executing a search, Hister replaces any alias keyword with its expanded form. The example shows aliases for GitHub domain, local files, and work domains. ```json { "gh": "domain:github.com", "local": "type:file", "work": "domain:(internal.example.com|jira.example.com)" } ``` -------------------------------- ### Import a site via sitemap Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/posts/search-your-saved-content.md Adds a documentation site or blog archive by pointing Hister at its sitemap and labeling the collection. Supports sitemap indexes and gzip compressed files. Requires a rolling build or build from source after v0.20.0. ```bash hister import sitemap https://docs.example.com/sitemap.xml --label reference ``` -------------------------------- ### Check for Hister updates with hister check-update Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/terminal-client.md Checks whether a newer Hister release is available. Displays installed and latest versions, and a release link when an update exists. Requires internet access; does not download or install the update. ```bash hister check-update ``` -------------------------------- ### Import browser bookmarks Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/posts/search-your-saved-content.md Runs the default bookmark import, which detects supported bookmark stores (Firefox, Chromium, Zen, Brave, Vivaldi, Ladybird) and lets you choose which to import. ```bash hister import browser bookmarks ``` -------------------------------- ### Bleve cursor-based pagination with SearchAfter Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/posts/data-indexing-in-golang.md Shows how to fetch the first page of results and then use the sort key of the last hit as a cursor for subsequent pages via SetSearchAfter. Requires a stable sort (e.g., _score, _id) for the cursor to remain valid. The cursor is a []string even for numeric fields. ```go const pageSize = 20 // First page, no cursor needed. req := bleve.NewSearchRequest(myQuery) req.Size = pageSize req.SortBy([]string{"_score", "_id"}) // stable sort is required for cursors results, _ := index.Search(req) // Subsequent pages, pass the sort key of the last hit as the cursor. if len(results.Hits) == pageSize { lastHit := results.Hits[len(results.Hits)-1] cursor := lastHit.Sort // []string, one element per sort field nextReq := bleve.NewSearchRequest(myQuery) nextReq.Size = pageSize nextReq.SortBy([]string{"_score", "_id"}) nextReq.SetSearchAfter(cursor) nextResults, _ := index.Search(nextReq) // ... } ``` -------------------------------- ### hister user create offline admin example Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/user-handling.md Creates the first administrator or recovers access by stopping the server and using its configuration and data directory. Requires user_handling: true in local configuration and direct access to the server's data. Prints the new account's access token when --admin is used. ```bash hister --config /path/to/config.yml user create admin --offline --admin ``` -------------------------------- ### Start a persistent recursive crawl Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/crawler.md Use --recursive (or -r) with a starting URL to create a persistent crawl job. Hister prints a random eight-character job ID before fetching begins. The queue is processed breadth first, and every discovered URL is recorded with its depth and status. ```bash hister index --recursive https://example.com ``` ```text Starting crawl job: a1b2c3d4 ``` -------------------------------- ### Build the extension Source: https://github.com/asciimoo/hister/blob/master/CONTRIBUTING.md Builds the @hister/ext package. ```bash npm run build -w @hister/ext ``` -------------------------------- ### Common development commands table Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/developer.md A table of common commands for building, testing, and formatting the project. Includes Go build/test, frontend builds, and linting. ```bash go build ``` ```bash go test ./... ``` ```bash npm run test:browser -w @hister/app ``` ```bash npm test -w @hister/ext ``` ```bash go generate ``` ```bash ./manage.sh build ``` ```bash npm run build -w @hister/app ``` ```bash npm run build -w @hister/website ``` ```bash npm run build -w @hister/ext ``` ```bash npm run serve:app ``` ```bash golangci-lint run --fix ./... ``` ```bash npm run check ``` ```bash npm run format ``` -------------------------------- ### get_history opened mode example Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/mcp.md Basic request for opened history with default limit of 20. ```json { "mode": "opened", "limit": 20 } ``` -------------------------------- ### Preview and apply update with dry and yes flags Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/terminal-client.md Preview the update operation with --dry or apply immediately with --yes. The command normally previews and asks for confirmation. ```bash hister update 'label:inbox' --label archive --dry hister update 'label:inbox' --label archive --yes ``` -------------------------------- ### get_history indexed mode example Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/mcp.md Basic request for indexed history with default limit of 20. ```json { "mode": "indexed", "limit": 20 } ``` -------------------------------- ### Combine Phrases with Alternations Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/query-language.md Example query combining a quoted phrase with alternations for verbs and years. ```textplain "privacy policy" (updated|changed|revised) (2025|2026) ``` -------------------------------- ### Build the app Source: https://github.com/asciimoo/hister/blob/master/CONTRIBUTING.md Builds the @hister/app package. ```bash npm run build -w @hister/app ``` -------------------------------- ### GET /api/users/{id} Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/user-handling.md Shows account information without credentials. Requires admin privileges. ```APIDOC ## GET /api/users/{id} ### Description Shows account information without credentials. Requires admin privileges. ### Method GET ### Endpoint /api/users/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the user account. ### Response #### Success Response (200) - **id** (string) - The user ID. - **username** (string) - The username. - **admin** (boolean) - Whether the user is an administrator. #### Response Example { "id": "123", "username": "existinguser", "admin": false } ``` -------------------------------- ### Import bookmarks from a specific browser Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/posts/search-your-saved-content.md Selects a browser explicitly with the --browser flag. Use --db PATH to pick a particular profile's bookmark store, and add a different --label to each import to search them separately. ```bash hister import browser bookmarks --browser firefox ``` -------------------------------- ### Create an extractor with custom default configuration Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/developer.md Uses sdk.NewConfigSupport to set default options, enabling the extractor and accepting the 'timeout' key automatically. Additional keys can be passed after the default configuration. ```go func NewMyExtractor() *MyExtractor { return &MyExtractor{ ConfigSupport: sdk.NewConfigSupport(sdk.Config{ Enable: true, Options: map[string]any{ "timeout": 10, }, }), } } ``` -------------------------------- ### Start the TUI with hister search Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/terminal-client.md Run the search command without any arguments to launch the terminal user interface. ```bash hister search ``` -------------------------------- ### GET /api/profile Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/developer.md Returns information about the currently authenticated user, including user ID, username, and admin status. ```APIDOC ## GET /api/profile ### Description Returns information about the currently authenticated user. ### Method GET ### Endpoint /api/profile ### Response #### Success Response (200) - **user_id** (integer) - Identifier of the authenticated user. - **username** (string) - Username of the authenticated user. - **is_admin** (boolean) - Whether the user is an administrator. #### Response Example ```json { "user_id": 1, "username": "alice", "is_admin": true } ``` ``` -------------------------------- ### Index with Firefox BiDi backend from host Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/docker.md Run hister index from the host using the bidi backend, connecting to a Firefox instance with BiDi enabled on port 9222. Replace --server-url with your reachable Hister URL and add --token TOKEN if authentication is required. ```bash hister --server-url http://127.0.0.1:4433 index \ --backend bidi \ --backend-option socket=ws://127.0.0.1:9222/session \ https://example.com ``` -------------------------------- ### Local Code Documentation Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/query-language.md A query example for finding file-type results with README or documentation in the content, filtered by English language. ```textplain type:file (README|documentation) language:en ``` -------------------------------- ### Start Hister server in public mode Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/server-setup.md Launch a configured authenticated server with public mode enabled using the CLI command. ```bash hister listen --public ``` -------------------------------- ### Crawl Go package documentation with allowed pattern Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/posts/building-a-personal-knowledge-base.md Crawls Go package documentation on pkg.go.dev using an allowed pattern to restrict the crawl to a specific package. ```bash hister index --recursive \ --allowed-pattern="https://pkg.go.dev/github.com/yourlibrary/.*" \ https://pkg.go.dev/github.com/yourlibrary/package ``` -------------------------------- ### Wildcard search: *privacy* Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/query-language.md Asterisks can appear at the beginning and end of a pattern. This example matches privacy, myprivacy, privacytools, and similar terms. ```textplain *privacy* ``` -------------------------------- ### Configure local directory indexing with indexer.directories Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/configuration.md Defines directories to index locally. Each entry can specify `path`, `filetypes`, `patterns`, `excludes`, and an optional `label`. The server scans these directories at startup and watches for changes. Set `label` to apply a searchable label to all files from that directory; changing a nonempty label updates existing files on the next startup scan. ```yaml indexer: directories: - path: '~/notes' filetypes: ['txt', 'md'] patterns: ['doc_*'] excludes: ['*secret*'] - path: '~/Documents/wiki' label: 'wiki' - path: '/path/to/project' label: 'project' filetypes: ['go', 'py', 'js'] ``` -------------------------------- ### Sort by date (descending) Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/query-language.md Prefixing a sort value with a minus sign reverses its direction. This example shows the oldest documents first. ```textplain golang sort:-date ``` -------------------------------- ### POST /mcp - tools/list Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/developer.md Lists all available tools provided by the MCP server. ```APIDOC ## [POST] /mcp ### Description Lists all available tools provided by the MCP server. ### Method POST ### Endpoint /mcp ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC version, must be "2.0" - **id** (number) - Required - Request identifier - **method** (string) - Required - Must be "tools/list" ### Request Example {"jsonrpc":"2.0","id":2,"method":"tools/list"} ### Response #### Success Response (200) - **jsonrpc** (string) - JSON-RPC version - **id** (number) - Request identifier - **result** (object) - Contains list of tools #### Response Example {"jsonrpc":"2.0","id":2,"result":{"tools":[]}} ``` -------------------------------- ### Security Vulnerabilities Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/query-language.md A query example for finding web pages about CVEs, vulnerabilities, or exploits from 2024 to 2026, excluding those that mention 'not affected'. ```textplain (CVE|vulnerability|exploit) (2024|2025|2026) -"not affected" type:web ``` -------------------------------- ### Search by site field Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/query-language.md Finds documents from example.com and its subdomains. Does not match notexample.com or example.com.evil.test. Use a hostname without scheme, port, path, or wildcard. Letter case and final dot are ignored. ```textplain site:example.com ``` -------------------------------- ### Research on Specific Topics Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/query-language.md A query example for researching threat models with encryption, authentication, or authorization, excluding tutorials and filtering by English language. ```textplain "threat model" (encryption|authentication|authorization) -tutorial language:en ``` -------------------------------- ### Run Go tests Source: https://github.com/asciimoo/hister/blob/master/CONTRIBUTING.md Runs the test suite for the Go backend. ```bash go test ./... ``` -------------------------------- ### Alternation in title field Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/query-language.md Use alternation within a field. Example: title:(firewall|vpn|proxy) finds pages with firewall, VPN, or proxy in the title. ```textplain title:(firewall|vpn|proxy) ``` -------------------------------- ### Configure bidi backend with host and port Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/configuration.md Connects to an already running browser via WebDriver BiDi WebSocket. The host and port produce ws://127.0.0.1:9222/session. capture_delay waits 1.5s after load for JS to render. ```yaml crawler: backend: 'bidi' backend_options: host: '127.0.0.1' port: '9222' capture_delay: 1.5 # wait 1.5s after load for JS to render timeout: 15 ``` -------------------------------- ### URL regular expression with case folding Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/query-language.md Regular expression matching is case sensitive unless the expression enables case folding, for example with (?i). ```textplain url_re:(?i)/readme\.md$ ``` -------------------------------- ### Wildcard search: secur* Source: https://github.com/asciimoo/hister/blob/master/webui/website/src/content/docs/query-language.md Use an asterisk as a wildcard to match any sequence of characters. This example matches terms like security, secure, and securing. ```textplain secur* ```