# Autocomplete

## Introduction to Autocomplete

Autocomplete, or autosuggest, is a common feature for many command-line applications. Most command-line users are familiar with autocomplete when they type part of a command and press `tab` to complete the rest of the command, or `tab-tab` to see a list of commands matching that prefix.&#x20;

Beyond autocomplete of the command name itself, there are ways to autocomplete sub-commands and/or options and arguments. As support for autocomplete often depends on external applications, and/or the terminal application you are using, autocomplete is a varied topic.

Cement does not currently have any mechanisms to support autocomplete out of the box. This document will serve as a helper for known ways you might find suitable for your needs.

## Fig

[Fig](https://fig.io) is "The next-generation command line" (per their site), with a suit of products that includes [IDE-Style Autocomplete for 500+ CLI tools](https://fig.io/user-manual/autocomplete).

*video from their site*

{% embed url="<https://fig.io/videos/main-demo-grey.mp4>" %}

Fig has built a Cement Extension that can be installed via PyPi, and included in your applications that are Built on Cement™.

See:

* [Fig Autocomplete & Cement](https://fig.io/docs/guides/integrating/integrations/cement)

## ZSH Auto Suggestions

Provides "Fish-like fast/unobtrusive autosuggestions for zsh".

See:

* [github.com/zsh-users/zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions)

## BASH Programmable Completion

BASH has mechanisms for implementing "Programmable Completion".

See:

* [BASH Manual](https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion.html)
* [github.com/scop/bash-completion](https://github.com/scop/bash-completion)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.builtoncement.com/additional-topics/autocomplete.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
