Skip to content

Conversation

@AgustinSilverfin
Copy link
Contributor

@AgustinSilverfin AgustinSilverfin commented Aug 29, 2025

Fixes #216

Description

The goal is to provide tab autocompletions for silverfin command in the terminal. It should auto complete command names, flag names for that specific command, and template names from the current directory.

Testing Instructions

Steps:

  1. Run silverfin config --set-autocompletion
  2. Follow the instructions, adding the source line in your ~/.zshrc or ~/.bashrc file
  3. Source your file to apply changes in your current session (e.g. source ~/.zshrc)
  4. Test the auto completion in a template repository.

Some examples:

silverfin <TAB> # it should show all commands
silverin imp<TAB> # it should show relevant commands that start with imp*
silverfin import-reconciliation --<TAB> # it should show you all flags available for import-reconciliation command
silverfin import-reconciliation --handle<TAB> # it should show all RTs in the repo
silverfin import-reconciliation --handle tax_<TAB> # it should show all RTS in the repo that start with tax_*

And always, it should autocomplete when there is only one valid option. Options are display when there are multiple.

Author Checklist

  • Skip bumping the CLI version

Reviewer Checklist

  • PR has a clear title and description
  • Manually tested the changes that the PR introduces
  • Changes introduced are covered by tests of acceptable quality

@AgustinSilverfin AgustinSilverfin force-pushed the agustin-auto-completion branch 3 times, most recently from 54478d1 to c4456d8 Compare August 29, 2025 13:02
@AgustinSilverfin AgustinSilverfin self-assigned this Sep 3, 2025
@AgustinSilverfin AgustinSilverfin force-pushed the agustin-auto-completion branch 2 times, most recently from 3ee1b81 to 1120f33 Compare September 15, 2025 11:54
@michieldegezelle michieldegezelle requested review from BenjaminLangenakenSF and removed request for Toby-Masters-SF September 24, 2025 08:25
Copy link
Contributor

@BenjaminLangenakenSF BenjaminLangenakenSF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as intended for reconciliation_texts and shared_parts 👌
However, for account_templates and export_files (which use the template name), the autocomplete doesn’t seem to work when there’s whitespace between the words?
e.g:
Image

@AgustinSilverfin
Copy link
Contributor Author

Works as intended for reconciliation_texts and shared_parts 👌 However, for account_templates and export_files (which use the template name), the autocomplete doesn’t seem to work when there’s whitespace between the words? e.g: Image

Thanks @BenjaminLangenakenSF it should be solved now! could you give it another try? 🙂

Copy link
Contributor

@BenjaminLangenakenSF BenjaminLangenakenSF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems the autocomplete now always refers to the repo folders instead of the CLI commands?
Image

@AgustinSilverfin
Copy link
Contributor Author

Seems the autocomplete now always refers to the repo folders instead of the CLI commands? Image

I don't have that issue? 🤔 @michieldegezelle maybe you could have a look as well?

2025-10-15_11-39

Copy link
Contributor

@michieldegezelle michieldegezelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a couple of tests, and did have the issue that Benji encountered, so all good.

Couple of remarks:

  • If I type silverfin import-reconciliation --handle <TAB>, I get an error:
image

-> Is this to be expected? The list is probably too long to display, but we might have to avoid the error?

  • Shortened options are not autocompleted, can this easily be added (e.g. -h or -t etc.)?

  • Seems to be for all 'second' options:

image

-> Wanted to add the firm here, and got the error. Could be that I am just willing to autocomplete too much

Apart from this, all good! 👍

@AgustinSilverfin AgustinSilverfin dismissed BenjaminLangenakenSF’s stale review November 14, 2025 15:54

Michiel has reviewed the changes

@AgustinSilverfin AgustinSilverfin merged commit 8b45685 into main Nov 14, 2025
2 checks passed
@AgustinSilverfin AgustinSilverfin deleted the agustin-auto-completion branch November 14, 2025 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Autocompletion

4 participants