Skip to content
Cogno v0.4.0

Autocomplete & History

As you type a command, Cogno suggests how to finish it — from what you ran before and from built-in knowledge of more than 1000 command-line tools.

The suggestions open on their own while you type. To open them yourself, press Ctrl+Space (Control+Space on macOS).

KeyEffect
↓ / ↑Select the next or previous suggestion
EnterAccept the selected suggestion
TabSwitch between all, context and history suggestions
EscapeClose

Nothing is selected at first. If you press Enter without selecting, the list closes and your command runs exactly as typed — autocomplete never changes a command behind your back.

The line under the list describes the selected suggestion and shows the active filter.

The list stays out of the way: it hides while a command is running, and after you press an arrow key on the prompt it stays hidden until you type again.

SourceSuggests
Your commandsCommands from your history that match the input. Each one shows whether you ran it in this directory or elsewhere. Accepting it replaces the whole line.
Your patternsRecurring command patterns found in your history
Your directoriesDirectories you visited before, while you type a cd command
CLI specsSubcommands and options of 1000+ tools, plus live values such as file paths, git branches and npm scripts

The three best history matches come first, then the spec suggestions, then the rest of your history. Duplicates are merged.

Tab switches what the list shows. Your choice is remembered.

FilterShows
Allhistory and specs combined
Contextonly spec suggestions
Historyonly your history

Cogno keeps its own command history, separate from your shell’s. Only recorded commands can be suggested.

Cogno never records:

  • commands the shell could not find — those are typos
  • cd commands — directories are tracked separately
  • empty commands, :, true and false

By default a command is recorded whatever it exits with. To keep only commands that worked, list the allowed exit codes:

terminal.history.allowed_return_codes = [0]
terminal.history.allowed_return_codes_by_command.grep = [0, 1]

The second line makes an exception for one command: grep exits with 1 when it finds nothing, which is not a failure. The command is matched by its first word.

terminal.history.max_entries = 5000
terminal.history.ignore_commands_with_leading_space = true
terminal.history.import_shell_history = true
  • max_entries caps the history; the default is unlimited.
  • ignore_commands_with_leading_space skips commands typed with a leading space, as HISTCONTROL=ignorespace does in Bash.
  • import_shell_history fills an empty Cogno history from your shell’s history file on first launch.

Both actions can be rebound: trigger_autocomplete and cycle_tab, see Keybindings.