denisidoro/navi · error · anyhow

Failed to call: tldr {} Output: {} Error: {} Note: The cl

Error message

Failed to call:
tldr {}

Output:
{}

Error:
{}

Note:
The client.tealdeer config option can be set to enable tealdeer support.
If you want to use another client, please make sure it supports the --markdown flag.
If you are already using a supported version you can ignore this message.
{}

What it means

When the spawned tldr client exits non-zero, navi returns an error with the command line, stdout, stderr, and guidance: navi expects a client supporting `--markdown` (or the client.tealdeer option for tealdeer). Many tldr clients (notably the original Node client in newer versions) dropped or never had --markdown, so the command fails even though the client is installed.

Source

Thrown at src/clients/tldr.rs:112

Output:
{}

Error:
{}

Note:
The client.tealdeer config option can be set to enable tealdeer support.
If you want to use another client, please make sure it supports the --markdown flag.
If you are already using a supported version you can ignore this message.
{}
",
            args.join(" "),
            String::from_utf8(out.stdout).unwrap_or_else(|_e| "Unable to get output message".to_string()),
            String::from_utf8(out.stderr).unwrap_or_else(|_e| "Unable to get error message".to_string()),
            VERSION_DISCLAIMER,
        );
        Err(anyhow!(msg))
    }
}

View on GitHub (pinned to f7330b9ad5)

Solutions

  1. Switch to tealdeer and set navi's client.tealdeer config option, or install a client that supports --markdown
  2. Run the exact `tldr ...` command from the error manually to see the client's own error
  3. Initialize/update the client cache (`tldr --update`) if it complains about a missing cache
  4. Update the page name if the client reported the page wasn't found

Example fix

// before
$ tldr --markdown tar
tldr: unknown option -- markdown
Failed to call:
tldr --markdown tar ...
// after
$ cargo install tealdeer
$ tldr --update
$ navi   # with client.tealdeer = true in config.toml
Defensive patterns

Strategy: fallback

Validate before calling

// ensure the client supports --markdown before relying on it
fn supports_markdown_flag() -> bool {
    let out = std::process::Command::new("tldr").arg("--help").output();
    out.map(|o| String::from_utf8_lossy(&o.stdout).contains("--markdown")).unwrap_or(false)
}
if !supports_markdown_flag() {
    eprintln!("your tldr client lacks --markdown; use tealdeer with client.tealdeer=true");
}

Try / catch

match tldr::call(query, opts) {
    Ok(lines) => render(lines),
    Err(e) if e.to_string().contains("Failed to call") => {
        eprintln!("tldr exited non-zero; falling back to cheat.sh client");
        match cheatsh::call(query, opts) { Ok(l) => render(l), Err(e2) => eprintln!("{}", e2) }
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: `call` -> tldr exits non-zero: unsupported/unknown flag like --markdown rejected by the client, page not found (client exit code), network errors inside the client, or an unsupported client version.

Common situations: Using the Node tldr client v3+ which removed --markdown, using another client (e.g. a Go/Rust tldr) with different flags, tldr cache not initialized (tealdeer requires `tldr --update`), or simply querying a nonexistent page.

Related errors


AI-assisted analysis of denisidoro/navi@f7330b9ad5 (2026-09-03). Data as JSON: /api/errors/94c20f25a098d62b. Report an issue: GitHub.