Thanks for your interest in contributing! Here's how to get started.
# Clone the repo
git clone https://github.com/rustlabs/nexus-cli.git
cd nexus-cli
# Install dependencies
npm install
# Run in dev mode (hot reload)
npm run dev
# Build
npm run build
# Run built version
npm run startUse ttyd to test the TUI in a browser:
ttyd --port 7681 --writable node dist/index.js
# Open http://localhost:7681src/
├── index.ts # CLI entry point (commander)
├── commands/ # CLI command handlers
│ ├── auth.ts # Login/logout
│ ├── chat.ts # Chat sessions
│ ├── config.ts # Configuration
│ ├── nexus.tsx # TUI launcher
│ ├── status.ts # Status & diagnostics
│ ├── swarm.tsx # Swarm CLI actions
│ └── tasks.ts # Task management
├── ui/
│ ├── app/ # App shell, keyboard router, state
│ ├── layout/ # TopBar, StatusBar, ThreePaneLayout
│ ├── views/ # LogsView, MarketplaceView, SettingsView, SwarmView
│ ├── overlays/ # CommandPalette, WorkspaceSwitcher, ConfirmDialog
│ ├── constants/ # Theme, keybinds, copy
│ └── state/ # AppContext, types
├── runtime/ # Mock runtime, types
├── data/ # Provider configs
├── types/ # Agent types & presets
├── api/ # API client
└── utils/ # Config, logger, updater
- Keyboard routing:
useKeyboardRouter.tsuses a stableuseCallbackwith refs to avoid ink's keystroke-dropping bug - Views stay mounted: All views render simultaneously with
display: none— each view'suseInputmust guard withactiveModecheck - Mode handlers: Each view registers
modeHandlers[mode].onKeyin auseEffectwith[]deps, accessing state via refs
- Fork the repo
- Create a feature branch:
git checkout -b feat/my-feature - Make your changes
- Build and test:
npm run build - Commit with a descriptive message
- Open a PR against
master
- TypeScript strict mode
- Functional React components with hooks
- Keep views focused — one file per tab
- Use
THEMEandCOLORSfrom constants for styling