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.
- package/README.md +17 -19
- package/dist/App.d.ts +2 -0
- package/dist/citadel.css +1 -1
- package/dist/citadel.es.js +825 -812
- package/dist/citadel.umd.js +30 -15
- package/dist/{src/components → components}/Citadel/Citadel.d.ts +1 -1
- package/dist/{src/components → components}/Citadel/config/CitadelConfigContext.d.ts +9 -5
- package/dist/components/Citadel/config/hooks.d.ts +4 -0
- package/dist/{src/components → components}/Citadel/hooks/useCommandParser.d.ts +1 -1
- package/dist/{src/components → components}/Citadel/types/command-registry.d.ts +5 -1
- package/dist/{src/components → components}/Citadel/types/command-results.d.ts +2 -2
- package/dist/{src/components → components}/Citadel/types/help-command.d.ts +1 -1
- package/dist/{src/components → components}/Citadel/utils/logger.d.ts +5 -5
- package/dist/index.d.ts +4 -2
- package/package.json +10 -3
- package/dist/command_examples/basic-commands.d.ts +0 -2
- package/dist/dist/styles.css +0 -789
- package/dist/src/App.d.ts +0 -4
- package/dist/src/components/Citadel/commands/history-commands.d.ts +0 -2
- package/dist/src/components/Citadel/hooks/__tests__/useCommandTrie.test.d.ts +0 -1
- package/dist/src/components/Citadel/hooks/useCommandTrie.d.ts +0 -2
- package/dist/src/components/Citadel/types/__tests__/command-trie.test.d.ts +0 -1
- package/dist/src/components/Citadel/types/command-context.d.ts +0 -4
- package/dist/src/components/Citadel/types/command-trie.d.ts +0 -84
- package/dist/src/components/Citadel/utils/keySimulation.d.ts +0 -2
- package/dist/src/index.d.ts +0 -3
- /package/dist/{src/__test-utils__ → __test-utils__}/factories.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/Cursor.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/__tests__/Citadel.test.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/components/AvailableCommands.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/components/CommandInput.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/components/CommandOutput.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/components/CommandOutputLine.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/components/Spinner.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/components/__tests__/AvailableCommands.test.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/components/__tests__/CommandInput.test.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/components/__tests__/CommandOutput.test.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/components/__tests__/CommandOutputLine.test.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/components/__tests__/Spinner.test.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/config/__tests__/CitadelConfigContext.test.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/config/defaults.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/config/types.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/hooks/__tests__/useCitadelState.test.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/hooks/__tests__/useCommandHistory.test.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/hooks/__tests__/useCommandParser.test.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/hooks/useCitadelState.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/hooks/useCommandHistory.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/hooks/useGlobalShortcut.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/hooks/useSegmentStack.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/hooks/useSegmentStackVersion.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/hooks/useSlideAnimation.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/index.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/services/HistoryService.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/storage/BaseStorage.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/storage/LocalStorage.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/storage/MemoryStorage.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/storage/StorageFactory.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/storage/__tests__/LocalStorage.test.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/storage/__tests__/MemoryStorage.test.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/types/__tests__/command-registry.test.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/types/__tests__/segment-stack.test.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/types/cursor.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/types/index.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/types/segment-stack.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/types/state.d.ts +0 -0
- /package/dist/{src/components → components}/Citadel/types/storage.d.ts +0 -0
- /package/dist/{src/main.d.ts → main.d.ts} +0 -0
- /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
|
-
|
|
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
|
|
5
|
+
## Use Cases
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
|
|
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
|

|
|
15
15
|
|
|
@@ -44,20 +44,18 @@ following:
|
|
|
44
44
|
|
|
45
45
|

|
|
46
46
|
|
|
47
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
228
|
-
# ... your normal
|
|
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
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}
|
|
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}
|