@go-go-golems/os-repl
v0.1.6
Published
Reusable React terminal and REPL UI components with theme CSS.
Downloads
1,009
Maintainers
Readme
@go-go-golems/os-repl
Terminal and REPL-oriented React UI components and theme styles from go-go-os.
This package is useful when you want command-line or terminal-like interaction patterns inside a React app. It can be used directly, and it is also reused by higher-level packages such as @go-go-golems/os-widgets.
Installation
npm install @go-go-golems/os-repl react react-dom @reduxjs/toolkit react-reduxMain exports
The package exports:
MacReplMAC_REPL_STATE_KEYcreateMacReplStateSeedmacReplActionsmacReplReducerselectMacReplState- REPL controller helpers such as
resolveReplCompletionStateandexecuteReplSubmission - built-in sample data and demo driver helpers
Theme usage
Import the package theme CSS:
import '@go-go-golems/os-repl/theme';If you are already importing @go-go-golems/os-widgets/theme, the REPL theme is already included there.
Minimal example
import { Provider } from 'react-redux';
import { configureStore } from '@reduxjs/toolkit';
import {
MacRepl,
MAC_REPL_STATE_KEY,
macReplReducer,
} from '@go-go-golems/os-repl';
import '@go-go-golems/os-repl/theme';
const store = configureStore({
reducer: {
[MAC_REPL_STATE_KEY]: macReplReducer,
},
});
export function App() {
return (
<Provider store={store}>
<MacRepl />
</Provider>
);
}When to use this package
Use @go-go-golems/os-repl when you want:
- a retro/mac-style REPL component
- command submission and completion behavior
- terminal-oriented UI building blocks
Do not start with this package if your goal is a general design-system consumer app. In that case, begin with @go-go-golems/os-core and add os-repl only when you specifically need REPL functionality.
Notes
- This package is published as ESM.
- The theme export is CSS-only and intended as a side-effect import.
- The reducer and state key are intended for explicit Redux store wiring in standalone consumers.
License
MIT
