-
Notifications
You must be signed in to change notification settings - Fork 37
refactor(mode): replace config-based mode setting with runtime detection #196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ayeshurun
wants to merge
22
commits into
microsoft:main
Choose a base branch
from
ayeshurun:copilot/remove-mode-settings
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 21 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
a9c1621
Add benchmark script for CLI startup performance
ayeshurun 0ee8239
Initial plan
Copilot 884e724
Remove mode settings: detect REPL mode at runtime instead of config
Copilot 6c7e06e
Merge branch 'main' of https://github.com/ayeshurun/fabric-cli
58408d6
update
3bcad54
Regression tests and graduated deprecation for mode removal
4a9d8d0
Merge upstream/main and re-apply branch removals (MAP, shared session)
7a563ff
Delete scripts/benchmark_startup.py
ayeshurun dcdec92
Delete file
20aa53f
revert
daa49eb
revert
ef889b3
Add changelog entry
28ea374
Merge branch 'main' of https://github.com/ayeshurun/fabric-cli
273a7eb
Merge branch 'main' of https://github.com/ayeshurun/fabric-cli
e71de12
Merge branch 'main' of https://github.com/ayeshurun/fabric-cli
65f670f
Merge branch 'main' of https://github.com/ayeshurun/fabric-cli into c…
17e174c
Address comments
8da15f4
fix: address review comments - use mock_repl fixture and naming conve…
85933fe
refactor: remove duplicate mode tests and unused mock_questionary_print
b2d8a5b
Apply suggestion from @Copilot
ayeshurun ddb8d4a
fix: add _success suffix to test names in test_fab_state_config
85a46d2
fix: address copilot review comments
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| kind: optimization | ||
| body: Replace config-based mode setting with runtime detection for interactive/command-line mode | ||
| time: 2026-03-22T10:36:53.000000000Z | ||
| custom: | ||
| Author: ayeshurun | ||
| AuthorLink: https://github.com/ayeshurun |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,47 +1,40 @@ | ||
| # CLI Modes | ||
|
|
||
| The Fabric CLI supports two primary modes to accommodate a variety of workflows: **command line** and **interactive**. The selected mode is preserved between sessions. If you exit and login to the CLI later, it will resume in the same mode you last used. | ||
| The Fabric CLI supports two modes: **command-line** and **REPL** (interactive). The active mode is determined automatically at runtime — no configuration is required. | ||
|
|
||
| Use the following command to see the current stored mode setting: | ||
| ## Command-Line Mode | ||
|
|
||
| ``` | ||
| fab config get mode | ||
| ``` | ||
|
|
||
| ## Command Line Mode | ||
| Command-line mode is best suited for scripted tasks, automation, or when you prefer running single commands without a persistent prompt. | ||
|
|
||
| Command line mode is best suited for scripted tasks, automation, or when you prefer running single commands without a prompt. | ||
|
|
||
| Typing commands directly in the terminal replicates typical UNIX-style usage. | ||
|
|
||
| Use the following command to switch the CLI into command line mode: | ||
| Invoke any command directly from your terminal with the `fab` prefix: | ||
|
|
||
| ``` | ||
| fab config set mode command_line | ||
| fab ls / | ||
| fab get /myworkspace.Workspace/mynotebook.Notebook | ||
| ``` | ||
|
|
||
| You will be required to log in again after switching modes. | ||
|
|
||
| ## Interactive Mode | ||
| ## REPL Mode | ||
|
|
||
| Interactive mode provides a shell-like environment in which you can run Fabric CLI commands directly without the `fab` prefix. | ||
| REPL mode provides a shell-like interactive environment. Run `fab` without any arguments to enter REPL mode: | ||
|
|
||
| Upon entering interactive mode, you see a `fab:/$` prompt. Commands are executed one by one without needing to type `fab` before each command, giving you a more guided experience. | ||
| ``` | ||
| fab | ||
| ``` | ||
|
|
||
| Use the following command to switch the CLI into interactive mode: | ||
| Upon entering REPL mode, you see a `fab:/$` prompt. Commands are executed one by one without needing to type `fab` before each command: | ||
|
|
||
| ``` | ||
| fab config set mode interactive | ||
| fab:/$ ls | ||
| fab:/$ cd myworkspace.Workspace | ||
| fab:/myworkspace.Workspace$ get mynotebook.Notebook | ||
| fab:/myworkspace.Workspace$ quit | ||
| ``` | ||
|
|
||
| You will be required to log in again after switching modes. | ||
| Type `help` for a list of available commands, and `quit` or `exit` to leave REPL mode. | ||
|
|
||
| ## Switching Between Modes | ||
|
|
||
| To switch from one mode to the other, enter: | ||
|
|
||
| ``` | ||
| fab config set mode <desired_mode> | ||
| ``` | ||
| There is no explicit mode switch command. The mode is determined by how you invoke the CLI: | ||
|
|
||
| where `<desired_mode>` is either `command_line` or `interactive`. Because the Fabric CLI needs to establish new authentication for each mode, you must re-authenticate after switching. The mode choice then remains in effect until you change it again. | ||
| - **Command-line mode** — run `fab <command>` with one or more arguments. | ||
| - **REPL mode** — run `fab` with no arguments. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.