citadel_cli 1.1.0 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +17 -19
  2. package/dist/App.d.ts +2 -0
  3. package/dist/citadel.css +1 -1
  4. package/dist/citadel.es.js +825 -812
  5. package/dist/citadel.umd.js +30 -15
  6. package/dist/{src/components → components}/Citadel/Citadel.d.ts +1 -1
  7. package/dist/{src/components → components}/Citadel/config/CitadelConfigContext.d.ts +9 -5
  8. package/dist/components/Citadel/config/hooks.d.ts +4 -0
  9. package/dist/{src/components → components}/Citadel/hooks/useCommandParser.d.ts +1 -1
  10. package/dist/{src/components → components}/Citadel/types/command-registry.d.ts +5 -1
  11. package/dist/{src/components → components}/Citadel/types/command-results.d.ts +2 -2
  12. package/dist/{src/components → components}/Citadel/types/help-command.d.ts +1 -1
  13. package/dist/{src/components → components}/Citadel/utils/logger.d.ts +5 -5
  14. package/dist/index.d.ts +4 -2
  15. package/package.json +10 -3
  16. package/dist/command_examples/basic-commands.d.ts +0 -2
  17. package/dist/dist/styles.css +0 -789
  18. package/dist/src/App.d.ts +0 -4
  19. package/dist/src/components/Citadel/commands/history-commands.d.ts +0 -2
  20. package/dist/src/components/Citadel/hooks/__tests__/useCommandTrie.test.d.ts +0 -1
  21. package/dist/src/components/Citadel/hooks/useCommandTrie.d.ts +0 -2
  22. package/dist/src/components/Citadel/types/__tests__/command-trie.test.d.ts +0 -1
  23. package/dist/src/components/Citadel/types/command-context.d.ts +0 -4
  24. package/dist/src/components/Citadel/types/command-trie.d.ts +0 -84
  25. package/dist/src/components/Citadel/utils/keySimulation.d.ts +0 -2
  26. package/dist/src/index.d.ts +0 -3
  27. /package/dist/{src/__test-utils__ → __test-utils__}/factories.d.ts +0 -0
  28. /package/dist/{src/components → components}/Citadel/Cursor.d.ts +0 -0
  29. /package/dist/{src/components → components}/Citadel/__tests__/Citadel.test.d.ts +0 -0
  30. /package/dist/{src/components → components}/Citadel/components/AvailableCommands.d.ts +0 -0
  31. /package/dist/{src/components → components}/Citadel/components/CommandInput.d.ts +0 -0
  32. /package/dist/{src/components → components}/Citadel/components/CommandOutput.d.ts +0 -0
  33. /package/dist/{src/components → components}/Citadel/components/CommandOutputLine.d.ts +0 -0
  34. /package/dist/{src/components → components}/Citadel/components/Spinner.d.ts +0 -0
  35. /package/dist/{src/components → components}/Citadel/components/__tests__/AvailableCommands.test.d.ts +0 -0
  36. /package/dist/{src/components → components}/Citadel/components/__tests__/CommandInput.test.d.ts +0 -0
  37. /package/dist/{src/components → components}/Citadel/components/__tests__/CommandOutput.test.d.ts +0 -0
  38. /package/dist/{src/components → components}/Citadel/components/__tests__/CommandOutputLine.test.d.ts +0 -0
  39. /package/dist/{src/components → components}/Citadel/components/__tests__/Spinner.test.d.ts +0 -0
  40. /package/dist/{src/components → components}/Citadel/config/__tests__/CitadelConfigContext.test.d.ts +0 -0
  41. /package/dist/{src/components → components}/Citadel/config/defaults.d.ts +0 -0
  42. /package/dist/{src/components → components}/Citadel/config/types.d.ts +0 -0
  43. /package/dist/{src/components → components}/Citadel/hooks/__tests__/useCitadelState.test.d.ts +0 -0
  44. /package/dist/{src/components → components}/Citadel/hooks/__tests__/useCommandHistory.test.d.ts +0 -0
  45. /package/dist/{src/components → components}/Citadel/hooks/__tests__/useCommandParser.test.d.ts +0 -0
  46. /package/dist/{src/components → components}/Citadel/hooks/useCitadelState.d.ts +0 -0
  47. /package/dist/{src/components → components}/Citadel/hooks/useCommandHistory.d.ts +0 -0
  48. /package/dist/{src/components → components}/Citadel/hooks/useGlobalShortcut.d.ts +0 -0
  49. /package/dist/{src/components → components}/Citadel/hooks/useSegmentStack.d.ts +0 -0
  50. /package/dist/{src/components → components}/Citadel/hooks/useSegmentStackVersion.d.ts +0 -0
  51. /package/dist/{src/components → components}/Citadel/hooks/useSlideAnimation.d.ts +0 -0
  52. /package/dist/{src/components → components}/Citadel/index.d.ts +0 -0
  53. /package/dist/{src/components → components}/Citadel/services/HistoryService.d.ts +0 -0
  54. /package/dist/{src/components → components}/Citadel/storage/BaseStorage.d.ts +0 -0
  55. /package/dist/{src/components → components}/Citadel/storage/LocalStorage.d.ts +0 -0
  56. /package/dist/{src/components → components}/Citadel/storage/MemoryStorage.d.ts +0 -0
  57. /package/dist/{src/components → components}/Citadel/storage/StorageFactory.d.ts +0 -0
  58. /package/dist/{src/components → components}/Citadel/storage/__tests__/LocalStorage.test.d.ts +0 -0
  59. /package/dist/{src/components → components}/Citadel/storage/__tests__/MemoryStorage.test.d.ts +0 -0
  60. /package/dist/{src/components → components}/Citadel/types/__tests__/command-registry.test.d.ts +0 -0
  61. /package/dist/{src/components → components}/Citadel/types/__tests__/segment-stack.test.d.ts +0 -0
  62. /package/dist/{src/components → components}/Citadel/types/cursor.d.ts +0 -0
  63. /package/dist/{src/components → components}/Citadel/types/index.d.ts +0 -0
  64. /package/dist/{src/components → components}/Citadel/types/segment-stack.d.ts +0 -0
  65. /package/dist/{src/components → components}/Citadel/types/state.d.ts +0 -0
  66. /package/dist/{src/components → components}/Citadel/types/storage.d.ts +0 -0
  67. /package/dist/{src/main.d.ts → main.d.ts} +0 -0
  68. /package/dist/{src/test → test}/setup.d.ts +0 -0
package/README.md CHANGED
@@ -1,15 +1,15 @@
1
1
  # Citadel CLI
2
2
 
3
- A hierarchical command-line interface (CLI) for web applications.
3
+ Citadel CLI enhances React applications by adding a keyboard-driven command line component to your application, allowing rapid task execution for power users and developers.
4
4
 
5
- Use cases:
5
+ ## Use Cases
6
6
 
7
- - Developers: Perform (multiple) REST API calls & view results, view/modify
8
- cookies/localstorage. Do JavaScript things without affecting the application.
9
- - "Poor man's Postman": execute API calls within the context of your application
10
- - Devops: Improve how you interface with your existing CI/CD web app
11
- - Power users: Provide a hook for advanced users of your internal or external
12
- applications to quickly perform complex actions
7
+ - **API Testing & Debugging**: Execute REST calls, inspect responses, and manipulate cookies/localStorage without leaving your
8
+ application context
9
+ - **Power User Workflows**: Transform repetitive click-through sequences into fast keyboard commands for advanced users
10
+ - **DevOps Integration**: Add command-line control to CI/CD dashboards and deployment tools for rapid operations
11
+ - **Internal Tool Enhancement**: Give your team's web applications the speed and efficiency of terminal interfaces
12
+ - Perform (multiple) REST API calls & view results, view/modify cookies/localstorage. Do JavaScript things without affecting the application.
13
13
 
14
14
  ![Animated screenshot of Citadel CLI](https://github.com/user-attachments/assets/b64da0f7-a4a0-4f76-bc03-c0e40c0e14e5)
15
15
 
@@ -44,20 +44,18 @@ following:
44
44
 
45
45
  ![screenshot_help_cmd](https://github.com/user-attachments/assets/1cc6fd58-7591-45f1-980a-46da15a1843a)
46
46
 
47
- When you execute a command the result is displayed in the output area. It shows
48
- the command that was executed, a timestamp, whether the command succesfully
49
- executed, and the command's output.
47
+ ## Adding Commands
50
48
 
51
- Adding your own commands is pretty straightforward. There are three steps to doing so.
49
+ To add your own commands:
52
50
 
53
- 1. Create a `CommandRegistry`
54
- 2. Add commands to the registry
51
+ 1. Create a `CommandRegistry` object
52
+ 2. Add commands to the registry object via the `addCommand` function
55
53
  3. Pass the registry to the `Citadel` component
56
54
 
57
- Let's add a simple `greet` command to demonstrate this.
55
+ For example, let's add a simple `greet` command.
58
56
 
59
57
  ```
60
- import { CommandRegistry, TextCommandResult } from "citadel_cli";
58
+ import { Citadel, CommandRegistry, TextCommandResult } from "citadel_cli";
61
59
 
62
60
  // 1. Create the registry where your commands will be stored
63
61
  const cmdRegistry = new CommandRegistry();
@@ -224,8 +222,8 @@ npm link
224
222
 
225
223
  5. (Optional) From the directory of the project you want to import Citadel into:
226
224
  ```bash
227
- npm link @jchilders/citadel_cli
228
- # ... your normal build/run steps ...
225
+ npm unlink citadel_cli && npm link citadel_cli
226
+ # ... your normal dev process ...
229
227
  ```
230
228
 
231
229
  Load your appliation and press <kbd>.</kbd>
@@ -254,7 +252,7 @@ Load your appliation and press <kbd>.</kbd>
254
252
  4. Write or update tests as needed
255
253
  5. Run the test suite to ensure everything passes:
256
254
  ```bash
257
- npm test
255
+ npm run test
258
256
  ```
259
257
  6. Commit your changes with a clear and descriptive commit message
260
258
  7. Push to your fork and submit a pull request
package/dist/App.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ declare function App(): import("react/jsx-runtime").JSX.Element;
2
+ export default App;
package/dist/citadel.css CHANGED
@@ -1 +1 @@
1
- ._container_141sr_3{position:fixed;height:var(--citadel-default-height);min-height:var(--citadel-min-height);max-height:var(--citadel-max-height);background-color:var(--citadel-bg);overflow:hidden;width:100%;box-sizing:border-box;margin:0;padding:0;bottom:0;left:0;right:0}._innerContainer_141sr_19{height:100%;width:100%;display:flex;flex-direction:column;margin:0;padding:0}._inputSection_141sr_28{border-top:1px solid var(--citadel-border);padding:1rem;margin:0;box-sizing:border-box}._resizeHandle_141sr_35{width:100%;height:6px;background:transparent;cursor:ns-resize;position:absolute;top:-3px;left:0;right:0;z-index:10;-moz-user-select:none;user-select:none;-webkit-user-select:none;pointer-events:all}._resizeHandle_141sr_35:hover{background:#ffffff1a}@keyframes _citadel_slideUp_141sr_64{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes _citadel_slideDown_141sr_68{0%{transform:translateY(0)}to{transform:translateY(100%)}}._citadel_slideUp_141sr_64{animation:_citadel_slideUp_141sr_64 .2s ease-out forwards}._citadel_slideDown_141sr_68{animation:_citadel_slideDown_141sr_68 .2s ease-out forwards}@keyframes _shake_e9b9w_1{0%,to{transform:translate(0)}25%{transform:translate(-4px)}75%{transform:translate(4px)}}@keyframes _flashBorder_e9b9w_1{0%,to{border-color:transparent}50%{border-color:#ef4444}}._invalidInput_e9b9w_12{animation:_shake_e9b9w_1 .2s ease-in-out,_flashBorder_e9b9w_1 .3s ease-in-out;border-width:1px;border-style:solid}
1
+ ._container_141sr_3{position:fixed;height:var(--citadel-default-height);min-height:var(--citadel-min-height);max-height:var(--citadel-max-height);background-color:var(--citadel-bg);overflow:hidden;width:100%;box-sizing:border-box;margin:0;padding:0;bottom:0;left:0;right:0}._innerContainer_141sr_19{height:100%;width:100%;display:flex;flex-direction:column;margin:0;padding:0}._inputSection_141sr_28{border-top:1px solid var(--citadel-border);padding:1rem;margin:0;box-sizing:border-box}._resizeHandle_141sr_35{width:100%;height:6px;background:transparent;cursor:ns-resize;position:absolute;top:-3px;left:0;right:0;z-index:10;-moz-user-select:none;user-select:none;-webkit-user-select:none;pointer-events:all}._resizeHandle_141sr_35:hover{background:#ffffff1a}@keyframes _citadel_slideUp_141sr_64{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes _citadel_slideDown_141sr_68{0%{transform:translateY(0)}to{transform:translateY(100%)}}._citadel_slideUp_141sr_64{animation:_citadel_slideUp_141sr_64 .2s ease-out forwards}._citadel_slideDown_141sr_68{animation:_citadel_slideDown_141sr_68 .2s ease-out forwards}