You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/cli-reference.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,7 +117,7 @@ Usage:
117
117
struct completion install [bash|zsh|fish]
118
118
```
119
119
120
-
- If no shell is provided, the command attempts to auto-detect your current shell and prints the exact commands to enable argcomplete-based completion for struct.
120
+
- If no shell is provided, the command attempts to auto-detect your current shell and prints the exact commands to generate and install static completion files via shtab.
121
121
- This does not modify your shell configuration; it only prints the commands you can copy-paste.
Copy file name to clipboardExpand all lines: docs/completion.md
+44-97Lines changed: 44 additions & 97 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
1
# Command-Line Auto-Completion
2
2
3
-
STRUCT provides intelligent auto-completion for commands, options, and **structure names** using [argcomplete](https://kislyuk.github.io/argcomplete/). This makes discovering and using available structures much faster and more user-friendly.
3
+
STRUCT provides intelligent auto-completion for commands, options, and structure names using static completion scripts generated by [shtab](https://github.com/Iterative/shtab). This approach is reliable across shells and doesn’t require runtime hooks or markers.
4
4
5
-
!!! tip "New Feature: Structure Name Completion"
6
-
STRUCT now automatically completes structure names when using `struct generate`, showing all 47+ available structures from both built-in and custom paths!
5
+
!!! tip "Structure Name Completion"
6
+
STRUCT completes structure names when using `struct generate`, showing available structures from both built-in and custom paths.
7
7
8
8
## Quick Setup
9
9
10
-
The easiest way is to ask struct to print the exact commands for your shell:
10
+
Ask struct to print the exact commands for your shell:
11
11
12
12
```sh
13
13
# Auto-detect current shell and print install steps
register-python-argcomplete --shell fish struct | source
75
-
```
76
-
77
-
### 4. Reload Your Shell
78
-
79
-
```sh
80
-
# For Bash
81
-
source~/.bashrc
82
-
83
-
# For Zsh
84
-
source~/.zshrc
85
-
86
-
# For Fish
87
-
source~/.config/fish/config.fish
88
-
```
55
+
```sh
56
+
mkdir -p ~/.config/fish/completions
57
+
struct --print-completion fish >~/.config/fish/completions/struct.fish
58
+
fish -c 'source ~/.config/fish/completions/struct.fish'
59
+
```
89
60
90
61
## Usage
91
62
92
-
After completing the setup, you can use auto-completion by typing part of a command and pressing `Tab`:
63
+
After installing the completion, use Tab to complete commands/options:
93
64
94
65
### Command Completion
95
66
```sh
@@ -132,12 +103,7 @@ struct generate --log <Tab>
132
103
133
104
### Per-Project Completion
134
105
135
-
If you only want completion for specific projects, you can add completion to your project's virtual environment activation script:
136
-
137
-
```sh
138
-
# In your .venv/bin/activate file, add:
139
-
eval"$(register-python-argcomplete struct)"
140
-
```
106
+
If you only want completion for a specific project/venv, generate the completion from the project’s venv and place it under your user completion directory (examples above). No runtime eval is needed.
After installation, enable command-line auto-completion for better productivity:
13
-
```sh
14
-
eval "$(register-python-argcomplete struct)"
15
-
```
16
-
For permanent setup, see the [Command-Line Completion](completion.md) guide.
12
+
After installation, enable command-line auto-completion using static scripts generated by shtab. See the [Command-Line Completion](completion.md) guide for per-shell instructions.
0 commit comments