Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
---

## [Unreleased]
## v2.1.1
## [v2.1.2]

### Features

- feat(cli): add shell completion command (bash)
Generate auto-completion scripts for a smoother CLI experience.

- feat(search): add pagination support
Introduces `--page` and `--limit` flags for better navigation in search results.

### Improvements

- fix(run): use PTY for live runtime stdout
Improves real-time output when running applications with `vix run`.

- fix(cli): improve command suggestions
Suggestions now rely on dispatcher entries for more accurate results.

### Documentation

- add shell completion guide
New documentation explaining how to enable and use CLI auto-completion.

### Developer Experience

- smoother CLI interaction with better suggestions
- improved readability of runtime output
- enhanced usability for large search results

### Stability

- improved reliability of CLI runtime behavior
- no breaking changes

## [v2.1.1]

### Fixes

Expand Down
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,23 @@
</tr>
</table>

---

## Contents

- [Install](#install)
- [Build from source](#build-from-source)
- [Your first Vix.cpp program](#your-first-vixcpp-program)
- [Script mode](#script-mode-no-project-setup)
- [Shell completion](#shell-completion)
- [Why Vix.cpp](#why-vixcpp)
- [Performance](#performance)
- [Core principles](#core-principles)
- [Learn more](#learn-more)
- [Contributing](#contributing)

---

## Install

#### Linux
Expand Down Expand Up @@ -131,6 +148,23 @@ Run C++ like a script:
vix run main.cpp
```

## Shell completion

Enable tab completion for Vix commands.

```bash
source <(vix completion bash)
```

Make it permanent:

```bash
vix completion bash > ~/.vix-completion.bash
echo 'source ~/.vix-completion.bash' >> ~/.bashrc
```

Learn more: https://vixcpp.com/docs/modules/cli/completion

## Why Vix.cpp

Most systems assume perfect conditions.
Expand Down
141 changes: 141 additions & 0 deletions docs/shell-completion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Vix Shell Completion

Enable command auto-completion for Vix in Bash.

---

## Overview

Vix can generate shell completion scripts for Bash.

This allows:

- faster command typing
- fewer mistakes
- discoverability of commands

---

## Quick Start

Load completion for the current shell session:

```bash
source <(vix completion bash)
```

Now try:

```bash
vix bu<TAB>
vix ins<TAB>
vix help ru<TAB>
```

---

## Persist It

To enable completion automatically:

```bash
vix completion bash > ~/.vix-completion.bash
echo 'source ~/.vix-completion.bash' >> ~/.bashrc
source ~/.bashrc
```

---

## What It Completes

Supports:

- top-level commands
- `vix help <command>`

Examples:

```bash
vix bu<TAB> # build
vix compl<TAB> # completion
vix help ru<TAB> # run
```

---

## How It Works

`vix completion bash` prints a Bash completion script to stdout.

To activate it:

```bash
source <(vix completion bash)
```

Running only:

```bash
vix completion bash
```

will NOT enable completion.

---

## Troubleshooting

If TAB does not work:

### 1. Ensure script is loaded

```bash
source <(vix completion bash)
```

### 2. Ensure Bash is used

```bash
echo $SHELL
```

### 3. Reload config

```bash
source ~/.bashrc
```

### 4. Check output

```bash
vix completion bash
```

You should see `_vix_completions`.

---

## Example Session

```bash
source <(vix completion bash)

vix bu<TAB>
vix help in<TAB>
```

---

## Notes

- Completion is generated from registered Vix commands
- Always stays in sync with CLI
- No external Bash completion tools required

---

## License

MIT License
Copyright (c) Gaspard Kirira

Loading