Commit Graph

97 Commits

Author SHA1 Message Date
3b2c33d28f feat(help & spinners): improve help rendering, async spinner handling, and pipeline demo
- Refactored `Command.help_signature` to return `(usage, description, tags)` instead of a Rich `Padding`/`Panel`.
- Replaced `show_help()` with `render_help()` in `Command` and `Falyx`.
- Updated Falyx help rendering to use Rich `Panel`/`Padding` consistently for cleaner UI.
- Swapped `print()` calls for `console.print()` for styled output.
- Added hooks to `ProcessAction` to announce analysis start/finish.
- Added spinners to test and deploy steps; simplified retry setup.
- Converted `remove()` to `async def remove()` for consistency.
- Added async lock to prevent concurrent Live loop start/stop races.
- Added debug logging when starting/stopping the Live loop.
- Updated `spinner_teardown_hook` to `await sm.remove(...)` to align with async `remove()`.
- Removed `rich.panel`/`rich.padding` from `Command` since panels are now built in `Falyx` help rendering.
- Bumped `rich` dependency to `^14.0`.
- Bumped version to 0.1.78.

This commit polishes help display, demo UX, and spinner lifecycle safety—making spinners thread/async safe and help output more structured and readable.
2025-07-30 22:24:55 -04:00
f37aee568d feat(spinners): integrate SpinnerManager and per-action spinners into Falyx
- Added new `SpinnerManager` module for centralized spinner rendering using Rich `Live`.
- Introduced `spinner`, `spinner_message`, `spinner_type`, `spinner_style`, and `spinner_speed` to `BaseAction` and subclasses (`Action`, `ProcessAction`, `HTTPAction`, `ActionGroup`, `ChainedAction`).
- Registered `spinner_before_hook` and `spinner_teardown_hook` automatically when `spinner=True`.
- Reworked `Command` spinner logic to use the new hook-based system instead of `console.status`.
- Updated `OptionsManager` to include a `SpinnerManager` instance for global state.
- Enhanced pipeline demo to showcase spinners across chained and grouped actions.
- Bumped version to 0.1.77.

This commit unifies spinner handling across commands, actions, and groups, making spinners consistent and automatically managed by hooks.
2025-07-28 22:15:36 -04:00
8a0a45e17f feat(falyx): add persistent prompt history, multiline input support, and new enum tests
- Added `enable_prompt_history` & `prompt_history_base_dir` to Falyx, using FileHistory to persist inputs to `~/.{program}_history`
- Added `multiline` option to UserInputAction and passed through to PromptSession
- Updated examples (`argument_examples.py`, `confirm_example.py`) to enable prompt history and add TLDR examples
- Improved CLI usage tips for clarity (`[COMMAND]` instead of `[KEY]`)
- Added `test_action_types.py` and expanded `test_main.py` for init and parser coverage
- Bumped version to 0.1.76
2025-07-27 14:00:51 -04:00
da38f6d6ee style(help): improve help display layout and styling for consistency
- Wrapped help signatures in `Padding` for better visual spacing.
- Updated descriptions and tags to use dimmed text with indentation for clarity.
- Added a bold "help:" header to `_show_help()` for clearer section labeling.
- Bumped version to 0.1.75.
2025-07-26 18:07:31 -04:00
7836ff4dfd feat(help): add dynamic tip system to _show_help output
- Added `get_tip()` method to provide rotating contextual tips for help output,
  with different pools for CLI mode vs menu mode.
- Introduced `is_cli_mode` property to centralize CLI mode detection.
- Updated `_show_help()` to print a randomly selected tip instead of a static line.
- Enhanced tips with Rich formatting (bold/italic) for emphasis.
- Bumped version to 0.1.74.
2025-07-26 17:33:08 -04:00
7dca416346 feat(help): enhance CLI help rendering with Panels and TLDR validation
- Updated `Command.help_signature` to return a `(Panel, description)` tuple,
  enabling richer Rich-based help output with formatted panels.
- Integrated `program` context into commands to display accurate CLI invocation
  (`falyx run …`) depending on mode (RUN, PREVIEW, RUN_ALL).
- Refactored `_show_help` to print `Panel`-styled usage and descriptions instead
  of table rows.
- Added `program` and `options_manager` propagation to built-in commands
  (Exit, History, Help) for consistent CLI display.
- Improved `CommandArgumentParser.add_tldr_examples()` with stricter validation
  (`all()` instead of `any()`), and added new TLDR tests for coverage.
- Simplified parser epilog text to `Tip: Use 'falyx run ?' to show available commands.`
- Added tests for required `Argument` fields and TLDR examples.
- Bumped version to 0.1.73.
2025-07-26 16:14:09 -04:00
734f7b5962 feat(parser): improve choice validation and completion for flagged arguments
- Added `_check_if_in_choices()` to enforce `choices` validation for all nargs modes,
  including after resolver-based and list-based inputs.
- Enhanced `FalyxCompleter` to quote multi-word completions for better UX.
- Improved completion filtering logic to suppress stale suggestions when flag values
  are already consumed.
- Moved `ArgumentState` and `TLDRExample` to `parser_types.py` for reuse.
- Bumped version to 0.1.72.
2025-07-24 21:00:11 -04:00
489d730755 Fix TLDR causing Command not to run, Add placeholder prompt menu to Falyx 2025-07-23 19:42:44 -04:00
825ff60f08 Tweak TLDR visual formatting, Fix applying RichText to prompts 2025-07-23 00:05:09 -04:00
fa5e2a4c2c feat: add TLDR ArgumentAction and Rich-compatible prompt styling
- Introduce `ArgumentAction.TLDR` for showing concise usage examples
- Add `rich_text_to_prompt_text()` to support Rich-style markup in all prompt_toolkit inputs
- Migrate all prompt-based Actions to use `prompt_message` with Rich styling support
- Standardize `CancelSignal` as the default interrupt behavior for prompt-driven Actions
2025-07-22 21:56:44 -04:00
de53c889a6 Fix completion bug, ensure_async callback 2025-07-21 00:11:21 -04:00
0319058531 Remove default traceback logging to screen 2025-07-20 12:35:08 -04:00
5769882afd Add reserved ctrl keys to BottomBar, Add traceback support in History for --last-result 2025-07-20 11:15:09 -04:00
7f63e16097 feat: Add module docs, Enum coercion, tracebacks, and toggle improvements
- Add comprehensive module docstrings across the codebase for better clarity and documentation.
- Refactor Enum classes (e.g., FileType, ConfirmType) to use `_missing_` for built-in coercion from strings.
- Add `encoding` attribute to `LoadFileAction`, `SaveFileAction`, and `SelectFileAction` for more flexible file handling.
- Enable lazy file loading by default in `SelectFileAction` to improve performance.
- Simplify bottom bar toggle behavior: all toggles now use `ctrl+<key>`, eliminating the need for key conflict checks with Falyx commands.
- Add `ignore_in_history` attribute to `Command` to refine how `ExecutionRegistry` identifies the last valid result.
- Improve History command output: now includes tracebacks when displaying exceptions.
2025-07-19 14:44:43 -04:00
21402bff9a Fix never_prompt precedence in BaseAction, Allow default_selection to be resolved from index, keys, values, or description 2025-07-18 21:51:25 -04:00
fddc3ea8d9 Merge pull request 'completions' (#4) from completions into main
Reviewed-on: #4
2025-07-17 20:16:19 -04:00
9b9f6434a4 Add completions, Add suggestions list to Argument 2025-07-17 20:09:29 -04:00
c15e3afa5e Working on completions 2025-07-16 18:55:22 -04:00
dc1764e752 Add args, kwargs to ChainedAction, ActionGroup, Add type_word_cancel and acknowledge ConfirmTypes, update ChainedAction rollback logic 2025-07-16 18:54:03 -04:00
2288015cf3 Add message when lazy_resolver action has no input, Change ConfirmAction.confirm -> ConfirmAction.never_prompt, Move ConfirmType to action_types.py 2025-07-15 20:00:03 -04:00
68d7d89d64 Add ArgumentAction.STORE_BOOL_OPTIONAL, Add BreakChainSignal 2025-07-14 21:59:12 -04:00
9654b9926c ConfirmAction message formatting 2025-07-13 22:38:58 -04:00
294bbc9062 Add data, create_dirs to SaveFileAction 2025-07-12 21:12:34 -04:00
4c1498121f Add falyx.console for single rich.console.Console instance, Add ConfirmAction, SaveFileAction, Add lazy evaluation for ArgumentAction.ACTION 2025-07-12 11:52:02 -04:00
ed42f6488e Add FalyxCompleter, Add check for valid directory for SelectFileAction, Add more detail to error messages in CommandArgumentParser, Don't initialize CAP if a custom parser is used 2025-07-03 00:58:57 -04:00
e2f0bf5903 Remove print statements 2025-06-29 22:45:11 -04:00
bb325684ac Add LoadFileAction, Rename ActionFactoryAction->ActionFactory, Rename falyx.action.mixins->falyx.action.action_mixins, fix bug unable to parse negative numbers in CommandArgumentParser 2025-06-27 22:33:14 -04:00
38f5f1e934 Rename falyx.action.types.FileReturnType -> falyx.action.action_types.FileType, falyx.action.base -> falyx.action.base_action, argparse tweaks for custom cli programs 2025-06-10 23:03:09 -04:00
2d1177e820 Update command import 2025-06-08 14:45:41 -04:00
3c7ef3eb1c Move ShellAction to action/shell_action.py, Move Argument, ArgumentAction, and CommandArgumentParser to seperate files 2025-06-08 14:31:24 -04:00
53ba6a896a Add multi selecto to SelectionAction and SelectFileAction, Allow IOActions to receive no input, Rename subpackage falyx.parsers -> falyx.parser, Add default_text to UserInputAction 2025-06-08 12:09:16 -04:00
b24079ea7e Add ExecutionContext.signature, fix partial command matching with arguments, fix passing args to Falyx._create_context helper 2025-06-05 17:23:27 -04:00
ac82076511 Add filtering and options for History Command 2025-06-03 23:07:50 -04:00
09eeb90dc6 Bubble up errors from CAP, catch a broader exception when parsing arguments, add type parsing to arg_metadata 2025-06-02 23:45:37 -04:00
e3ebc1b17b Fix validation for empty input 2025-06-01 23:12:53 -04:00
079bc0ee77 Normalize epilogue -> epilog, allow version to be modifiable, don't allow empty input in repl 2025-06-01 23:02:35 -04:00
1c97857cb8 Centralize CAP creation in Command, Add better default type coercion 2025-06-01 17:38:48 -04:00
21af003bc7 Update help formatting, allow help to be filtered by tag 2025-05-31 21:51:08 -04:00
1585098513 Add init init-global to subparsers 2025-05-31 09:29:24 -04:00
3d3a706784 Formatting of help text 2025-05-30 21:52:29 -04:00
c2eb854e5a Add help_text for commands to argparse run subcommand, change the way Falyx.run works and you can only pass FalyxParsers 2025-05-30 00:36:55 -04:00
8a3c1d6cc8 Fix global-init imports, passing args from command line to required commands 2025-05-28 17:11:26 -04:00
f196e38c57 Add ProcessPoolAction, update CAP to look only at keywords correctly 2025-05-28 00:58:50 -04:00
fb1ffbe9f6 Add ArgumentAction.ACTION, support POSIX bundling in CAP, Move all Actions to their own file 2025-05-25 19:25:32 -04:00
429b434566 Remove emojis from logging statements 2025-05-24 17:53:34 -04:00
4f3632bc6b Remove emojis from logging statements 2025-05-24 15:09:39 -04:00
ba562168aa hotfix syntax error < python3.12 2025-05-24 13:46:07 -04:00
ddb78bd5a7 Add PromptMenuAction, add cancel button to SelectionAction, make get_command async, add Action validation and defauilt nargs to None. 2025-05-24 12:29:16 -04:00
b0c0e7dc16 Fix run_group parser for REMAINDER, fix render_help formatting 2025-05-22 14:59:16 -04:00
0a1ba22a3d Remove args/kwargs being passed to generated Action from FactoryAction 2025-05-21 23:35:57 -04:00