Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

fcs command line

Full help for the client and each subcommand, as printed by the binary. The narrative guide is Command-line client.

fcs --help

Search the code index kept by a running fast_code_search server.

`fcs QUERY` is `fcs search QUERY`. The query is the web UI's: literal text, like rg -F (several words are one phrase; quotes and a leading - are text), plus file:PATTERN, -file:PATTERN, lang:rust, case:yes, word:yes. Put a query starting with - after --.

Exit status: 0 = matches found, 1 = no matches, 2 = error.

Usage: fcs [OPTIONS] <COMMAND>

Commands:
  search   Search file contents (the default; `fcs QUERY` works too)
  refs     Find references (call sites, type mentions) of an identifier; `kind:call`, `kind:type`, `kind:value`, `kind:attribute` keep one kind
  symbols  Search symbol definitions (functions, types, classes, ...) only
  status   Show whether the server is reachable and what it has indexed
  mcp      Serve MCP over stdio by relaying to the server's /mcp endpoint (for agents that launch a command rather than connect to a URL)
  check    Check fcs against independent tools on your own code: generated queries against ripgrep, and the import graph against Python's and TypeScript's own resolvers when they are installed
  help     Print this message or the help of the given subcommand(s)

Options:
      --server <URL>
          Server base URL (default: $FCS_SERVER, then the config's web_address, then http://127.0.0.1:8080)

      --config <FILE>
          Configuration file (default: $FCS_CONFIG, ./fast_code_search.toml, ~/.config/fast_code_search/config.toml)

      --offline
          Search the on-disk index directly instead of asking the server

      --no-offline
          Never fall back to the on-disk index when the server is unreachable

      --index-path <FILE>
          Index file for offline searches (default: the config's index_path)

      --format <FORMAT>
          Output layout (default: grouped on a terminal, vimgrep when piped)

          Possible values:
          - grouped: File headings with `line:col: text` underneath (default on a terminal)
          - vimgrep: One `path:line:col:text` line per hit (default when piped)
          - json:    The server's JSON response, one object

      --json
          Shorthand for --format json

  -l, --files-with-matches
          Print every file that matches, once, best first (pages through all hits)

      --absolute
          Print absolute paths (needs the roots from the configuration)

      --color <COLOR>
          Colour output: auto (terminal only, honours NO_COLOR), always, never
          
          [default: auto]
          [possible values: auto, always, never]

  -q, --quiet
          No summary or fallback notes on stderr

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

Examples:
  fcs 'fn main'                 lines holding the phrase
  fcs -- -Wall                  a query starting with -
  fcs -e 'fn\s+\w+\(' -g '*.rs'  regex, Rust files only
  fcs refs SearchEngine         call sites and type mentions
  fcs symbols parse_query       definitions only
  fcs -l TODO | xargs $EDITOR   files containing TODO
  vim -q <(fcs --format vimgrep TODO)
  fcs status                    is the server up, what does it hold
  fcs mcp                       MCP over stdio, for coding agents
  fcs check                     compare fcs with ripgrep and the import resolvers

fcs search --help

Search file contents (the default; `fcs QUERY` works too)

Usage: fcs search [OPTIONS] <QUERY>...

Arguments:
  <QUERY>...
          The query (web UI syntax; several words are one phrase)

Options:
  -e, --regex
          Treat the query as a regular expression

  -s, --case-sensitive
          Match case exactly

  -i, --ignore-case
          Ignore case (the default for plain text; with -e, makes a regex ignore it too)

  -w, --word
          Match whole words only

  -n, --max <N>
          Maximum hits to print (1 to the server's search.max_page_size, 1000; default 50). With -l, the most files to list (default: every file)

      --offset <N>
          Skip the first N hits (paging; ordering is deterministic)
          
          [default: 0]

  -C, --context <N>
          Lines of context before and after each hit (0 to search.max_context_lines, 10)
          
          [default: 0]

      --server <URL>
          Server base URL (default: $FCS_SERVER, then the config's web_address, then http://127.0.0.1:8080)

      --config <FILE>
          Configuration file (default: $FCS_CONFIG, ./fast_code_search.toml, ~/.config/fast_code_search/config.toml)

  -g, --glob <GLOB>
          Only files matching this glob (repeatable; `src/**/*.rs`, `*.py`, `tests`)

      --exclude <GLOB>
          Skip files matching this glob (repeatable)

      --offline
          Search the on-disk index directly instead of asking the server

      --no-offline
          Never fall back to the on-disk index when the server is unreachable

      --rank <RANK>
          Ranking: auto and fast read files best first and honour a file limit; full never stops at one
          
          [default: auto]
          [possible values: auto, fast, full]

      --index-path <FILE>
          Index file for offline searches (default: the config's index_path)

      --timeout-ms <MS>
          Stop scanning after this many milliseconds and return the best so far
          
          [default: 0]

      --format <FORMAT>
          Output layout (default: grouped on a terminal, vimgrep when piped)

          Possible values:
          - grouped: File headings with `line:col: text` underneath (default on a terminal)
          - vimgrep: One `path:line:col:text` line per hit (default when piped)
          - json:    The server's JSON response, one object

      --max-files <N>
          Most candidate files to read, best first (default: the server's search.fast_rank_files, no limit)

      --deps <PATH[:N]>
          Only search this file and what it imports, N hops deep (1 by default; `*` for any distance). Repeatable; `-PATH` leaves them out

      --json
          Shorthand for --format json

  -l, --files-with-matches
          Print every file that matches, once, best first (pages through all hits)

      --rdeps <PATH[:N]>
          Only search this file and the files that import it (as `--deps`)

      --absolute
          Print absolute paths (needs the roots from the configuration)

      --color <COLOR>
          Colour output: auto (terminal only, honours NO_COLOR), always, never
          
          [default: auto]
          [possible values: auto, always, never]

  -q, --quiet
          No summary or fallback notes on stderr

  -h, --help
          Print help (see a summary with '-h')

fcs refs --help

Find references (call sites, type mentions) of an identifier; `kind:call`, `kind:type`, `kind:value`, `kind:attribute` keep one kind

Usage: fcs refs [OPTIONS] <QUERY>...

Arguments:
  <QUERY>...
          The query (web UI syntax; several words are one phrase)

Options:
  -e, --regex
          Treat the query as a regular expression

  -s, --case-sensitive
          Match case exactly

  -i, --ignore-case
          Ignore case (the default for plain text; with -e, makes a regex ignore it too)

  -w, --word
          Match whole words only

  -n, --max <N>
          Maximum hits to print (1 to the server's search.max_page_size, 1000; default 50). With -l, the most files to list (default: every file)

      --offset <N>
          Skip the first N hits (paging; ordering is deterministic)
          
          [default: 0]

  -C, --context <N>
          Lines of context before and after each hit (0 to search.max_context_lines, 10)
          
          [default: 0]

      --server <URL>
          Server base URL (default: $FCS_SERVER, then the config's web_address, then http://127.0.0.1:8080)

      --config <FILE>
          Configuration file (default: $FCS_CONFIG, ./fast_code_search.toml, ~/.config/fast_code_search/config.toml)

  -g, --glob <GLOB>
          Only files matching this glob (repeatable; `src/**/*.rs`, `*.py`, `tests`)

      --exclude <GLOB>
          Skip files matching this glob (repeatable)

      --offline
          Search the on-disk index directly instead of asking the server

      --no-offline
          Never fall back to the on-disk index when the server is unreachable

      --rank <RANK>
          Ranking: auto and fast read files best first and honour a file limit; full never stops at one
          
          [default: auto]
          [possible values: auto, fast, full]

      --index-path <FILE>
          Index file for offline searches (default: the config's index_path)

      --timeout-ms <MS>
          Stop scanning after this many milliseconds and return the best so far
          
          [default: 0]

      --format <FORMAT>
          Output layout (default: grouped on a terminal, vimgrep when piped)

          Possible values:
          - grouped: File headings with `line:col: text` underneath (default on a terminal)
          - vimgrep: One `path:line:col:text` line per hit (default when piped)
          - json:    The server's JSON response, one object

      --max-files <N>
          Most candidate files to read, best first (default: the server's search.fast_rank_files, no limit)

      --deps <PATH[:N]>
          Only search this file and what it imports, N hops deep (1 by default; `*` for any distance). Repeatable; `-PATH` leaves them out

      --json
          Shorthand for --format json

  -l, --files-with-matches
          Print every file that matches, once, best first (pages through all hits)

      --rdeps <PATH[:N]>
          Only search this file and the files that import it (as `--deps`)

      --absolute
          Print absolute paths (needs the roots from the configuration)

      --color <COLOR>
          Colour output: auto (terminal only, honours NO_COLOR), always, never
          
          [default: auto]
          [possible values: auto, always, never]

  -q, --quiet
          No summary or fallback notes on stderr

  -h, --help
          Print help (see a summary with '-h')

fcs symbols --help

Search symbol definitions (functions, types, classes, ...) only

Usage: fcs symbols [OPTIONS] <QUERY>...

Arguments:
  <QUERY>...
          The query (web UI syntax; several words are one phrase)

Options:
  -e, --regex
          Treat the query as a regular expression

  -s, --case-sensitive
          Match case exactly

  -i, --ignore-case
          Ignore case (the default for plain text; with -e, makes a regex ignore it too)

  -w, --word
          Match whole words only

  -n, --max <N>
          Maximum hits to print (1 to the server's search.max_page_size, 1000; default 50). With -l, the most files to list (default: every file)

      --offset <N>
          Skip the first N hits (paging; ordering is deterministic)
          
          [default: 0]

  -C, --context <N>
          Lines of context before and after each hit (0 to search.max_context_lines, 10)
          
          [default: 0]

      --server <URL>
          Server base URL (default: $FCS_SERVER, then the config's web_address, then http://127.0.0.1:8080)

      --config <FILE>
          Configuration file (default: $FCS_CONFIG, ./fast_code_search.toml, ~/.config/fast_code_search/config.toml)

  -g, --glob <GLOB>
          Only files matching this glob (repeatable; `src/**/*.rs`, `*.py`, `tests`)

      --exclude <GLOB>
          Skip files matching this glob (repeatable)

      --offline
          Search the on-disk index directly instead of asking the server

      --no-offline
          Never fall back to the on-disk index when the server is unreachable

      --rank <RANK>
          Ranking: auto and fast read files best first and honour a file limit; full never stops at one
          
          [default: auto]
          [possible values: auto, fast, full]

      --index-path <FILE>
          Index file for offline searches (default: the config's index_path)

      --timeout-ms <MS>
          Stop scanning after this many milliseconds and return the best so far
          
          [default: 0]

      --format <FORMAT>
          Output layout (default: grouped on a terminal, vimgrep when piped)

          Possible values:
          - grouped: File headings with `line:col: text` underneath (default on a terminal)
          - vimgrep: One `path:line:col:text` line per hit (default when piped)
          - json:    The server's JSON response, one object

      --max-files <N>
          Most candidate files to read, best first (default: the server's search.fast_rank_files, no limit)

      --deps <PATH[:N]>
          Only search this file and what it imports, N hops deep (1 by default; `*` for any distance). Repeatable; `-PATH` leaves them out

      --json
          Shorthand for --format json

  -l, --files-with-matches
          Print every file that matches, once, best first (pages through all hits)

      --rdeps <PATH[:N]>
          Only search this file and the files that import it (as `--deps`)

      --absolute
          Print absolute paths (needs the roots from the configuration)

      --color <COLOR>
          Colour output: auto (terminal only, honours NO_COLOR), always, never
          
          [default: auto]
          [possible values: auto, always, never]

  -q, --quiet
          No summary or fallback notes on stderr

  -h, --help
          Print help (see a summary with '-h')

fcs status --help

Show whether the server is reachable and what it has indexed

Usage: fcs status [OPTIONS]

Options:
      --server <URL>
          Server base URL (default: $FCS_SERVER, then the config's web_address, then http://127.0.0.1:8080)

      --config <FILE>
          Configuration file (default: $FCS_CONFIG, ./fast_code_search.toml, ~/.config/fast_code_search/config.toml)

      --offline
          Search the on-disk index directly instead of asking the server

      --no-offline
          Never fall back to the on-disk index when the server is unreachable

      --index-path <FILE>
          Index file for offline searches (default: the config's index_path)

      --format <FORMAT>
          Output layout (default: grouped on a terminal, vimgrep when piped)

          Possible values:
          - grouped: File headings with `line:col: text` underneath (default on a terminal)
          - vimgrep: One `path:line:col:text` line per hit (default when piped)
          - json:    The server's JSON response, one object

      --json
          Shorthand for --format json

  -l, --files-with-matches
          Print every file that matches, once, best first (pages through all hits)

      --absolute
          Print absolute paths (needs the roots from the configuration)

      --color <COLOR>
          Colour output: auto (terminal only, honours NO_COLOR), always, never
          
          [default: auto]
          [possible values: auto, always, never]

  -q, --quiet
          No summary or fallback notes on stderr

  -h, --help
          Print help (see a summary with '-h')

fcs mcp --help

Serve MCP over stdio by relaying to the server's /mcp endpoint (for agents that launch a command rather than connect to a URL)

Usage: fcs mcp [OPTIONS]

Options:
      --server <URL>
          Server base URL (default: $FCS_SERVER, then the config's web_address, then http://127.0.0.1:8080)

      --config <FILE>
          Configuration file (default: $FCS_CONFIG, ./fast_code_search.toml, ~/.config/fast_code_search/config.toml)

      --offline
          Search the on-disk index directly instead of asking the server

      --no-offline
          Never fall back to the on-disk index when the server is unreachable

      --index-path <FILE>
          Index file for offline searches (default: the config's index_path)

      --format <FORMAT>
          Output layout (default: grouped on a terminal, vimgrep when piped)

          Possible values:
          - grouped: File headings with `line:col: text` underneath (default on a terminal)
          - vimgrep: One `path:line:col:text` line per hit (default when piped)
          - json:    The server's JSON response, one object

      --json
          Shorthand for --format json

  -l, --files-with-matches
          Print every file that matches, once, best first (pages through all hits)

      --absolute
          Print absolute paths (needs the roots from the configuration)

      --color <COLOR>
          Colour output: auto (terminal only, honours NO_COLOR), always, never
          
          [default: auto]
          [possible values: auto, always, never]

  -q, --quiet
          No summary or fallback notes on stderr

  -h, --help
          Print help (see a summary with '-h')

fcs check --help

Check fcs against independent tools on your own code: generated queries against ripgrep, and the import graph against Python's and TypeScript's own resolvers when they are installed

Usage: fcs check [OPTIONS] [PATH]...

Arguments:
  [PATH]...
          Folders to check (default: the configuration's indexed paths, else the current folder). They are indexed afresh, in memory

Options:
      --queries <N>
          Queries made up from the files and compared with `rg -F`
          
          [default: 200]

      --seed <N>
          Seed for the queries, to repeat a run (default: a fresh one)

      --rg <PATH>
          The ripgrep binary
          
          [default: rg]

      --no-search
          Skip the search check

      --no-graph
          Skip the dependency graph check

      --server <URL>
          Server base URL (default: $FCS_SERVER, then the config's web_address, then http://127.0.0.1:8080)

      --config <FILE>
          Configuration file (default: $FCS_CONFIG, ./fast_code_search.toml, ~/.config/fast_code_search/config.toml)

      --offline
          Search the on-disk index directly instead of asking the server

      --no-offline
          Never fall back to the on-disk index when the server is unreachable

      --index-path <FILE>
          Index file for offline searches (default: the config's index_path)

      --format <FORMAT>
          Output layout (default: grouped on a terminal, vimgrep when piped)

          Possible values:
          - grouped: File headings with `line:col: text` underneath (default on a terminal)
          - vimgrep: One `path:line:col:text` line per hit (default when piped)
          - json:    The server's JSON response, one object

      --json
          Shorthand for --format json

  -l, --files-with-matches
          Print every file that matches, once, best first (pages through all hits)

      --absolute
          Print absolute paths (needs the roots from the configuration)

      --color <COLOR>
          Colour output: auto (terminal only, honours NO_COLOR), always, never
          
          [default: auto]
          [possible values: auto, always, never]

  -q, --quiet
          No summary or fallback notes on stderr

  -h, --help
          Print help (see a summary with '-h')