withfig / fig

Public issue tracker for Fig.
https://fig.io
MIT License
2.05k stars 63 forks source link

Autocompletions not working for custom cli commands #2856

Open overshom opened 11 months ago

overshom commented 11 months ago

Checks

Operating system

macOS 14.1.2 (23B92)

Expected behaviour

Custom CLI tools and their subcommands (scripts) be auto-populated for autocompletions so when we type cli tool in terminal we can see available subcommands to use.

In my case I when I enter in terminal "my " I want to see autocompletion for "ssh-config" subcommand (script).

Actual behaviour

The only autocompletion appeared is "-h" which is just to get help about cli tool. And if you check the help, you can see in description custom commands - so fig knows about them and still does not autosuggests.

Steps to reproduce

  1. Create CLI tool with name "my"
  2. Create script called "ssh-config" (simple shell script with cat and grep inside and a couple of inputs)
  3. Enter "my " in terminal
  4. See autocompletions:
    • for help "-h" - OK
    • missing suggestion for "ssh-config" - BUG. Should be in a list of suggestions.

Environment

fig-details:
  - 2.17.0
hardware-info:
  - model: 
  - model-id: 
  - chip-id: Apple M1 Pro
  - cores: 10
  - mem: 16.00 GB
os-info:
  - macOS 14.1.2 (23B92)
environment:
  - shell: /bin/zsh
  - terminal: terminal
  - cwd: /Users/username/Desktop
  - exe-path: /opt/homebrew/bin/fig
  - install-method: brew
  - env-vars:
    - FIGTERM_SESSION_ID: 79f8591b-60a8-491f-b059-90b27c2c9036
    - FIG_SET_PARENT_CHECK: 1
    - FIG_TERM: 2.17.0
    - PATH: --secret--
    - SHELL: /bin/zsh
    - TERM: xterm-256color
    - __CFBundleIdentifier: com.apple.Terminal
    - FIG_PID: 94787
    - FIG_SET_PARENT: 79f8591b-60a8-491f-b059-90b27c2c9036