Skip to content
System One

FindMalek/guesswork

Fish-style zsh history autosuggestions ranked by an AI model instead of prefix matching, with Jev as one of four supported providers.

guesswork: real Jev-ranked zsh autosuggestions, prefix and fuzzy mode
Image from github.com

FindMalek/guesswork on GitHub

Stars
2
Forks
1
Language
TypeScript
License
MIT
Last push
23 Sep 2026

Read from GitHub on . Counts change daily.

How it uses Jev

/** Ranks `candidates` against `typed` via a real Jev request. Throws on timeout/network/API error -- the caller decides the fallback. */
export async function rankWithJev(typed: string, candidates: readonly Candidate[]): Promise<JevRankResult> {
  const { state, questions } = buildRequest(typed, candidates);
  const response = await getClient().systemOne({ state, questions });

  const probabilities = response.answers.completion.probabilities;
  const ranked = candidates
    .map((c) => ({
      command: c.command,
      score: probabilities[c.id] ?? 0,
      isPrefix: c.command.startsWith(typed),
    }))
    .sort((a, b) => b.score - a.score);

  return { ranked, hasCompletion: response.answers.has_completion.noul };

View in site/src/lib/typesafe-client.ts

Open on GitHub

More like this

Keep browsing