δΈζ | English
This is a proof-of-concept (PoC) project. NerveTerm is experimental software under active development. Many features are incomplete or unstable. It is NOT suitable for production use. Use at your own risk.
NerveTerm is an AI-powered shell wrapper that provides intelligent command completion, automatic error diagnosis, and natural language interaction. Built with Go and Bubble Tea, it aims to bridge the gap between traditional shell workflows and large language model assistance.
- Tab completion is currently non-functional - The inline suggestion system uses a different mechanism; traditional tab completion for file paths is not implemented
- Ghost text reliability varies - AI responses may sometimes duplicate typed text or provide irrelevant suggestions
- cd command - Uses a workaround; shell state management needs proper implementation
- Chinese input - May have display issues in certain terminal configurations
NerveTerm follows a clean architecture with functional programming patterns (using fp-go):
graph TB
subgraph TUI["TUI Layer (Bubble Tea)"]
MVU["Model ββ View ββ Update"]
end
subgraph Ports["Ports (Interfaces)"]
AIProv["AIProvider"]
ShellExec["ShellExecutor"]
end
subgraph Adapters["Adapters (Implementations)"]
OpenAI["OpenAI Adapter"]
LocalShell["Local Shell Executor"]
end
subgraph Core["Core (Business Logic)"]
Prompt["Prompt Builder"]
Intent["Intent Detection"]
Response["Response Parser"]
end
TUI --> Ports
Ports --> Adapters
Ports --> Core
Adapters --> Core
tui/- Bubble Tea application (Model-View-Update)adapters/- External service integrations (OpenAI, shell)core/- Business logic (prompt building, intent detection)ports/- Interface definitions for dependency inversionconfig/- Configuration management
- Go 1.25 or later
- OpenAI API key (or compatible API)
- Unix-like system (Linux, macOS)
git clone https://github.com/somhairle/nerveterm.git
cd nerveterm
go build ./cmd/nervetermgo run cmd/nerveterm/main.goNerveTerm uses a TOML configuration file located at:
~/.config/nerveterm/config.toml
The configuration is auto-generated on first run with default values:
[ai]
provider = "openai"
api_key = "sk-..." # Your OpenAI API key
base_url = "" # Optional: custom API endpoint
model = "gpt-4o"
[shell]
shell = "zsh" # Default shell to use
working_dir = "~" # Initial working directory
[ui]
theme = "dracula" # Color theme: dracula, light, etc.You can also configure via environment variables:
export NERVETERM_API_KEY="sk-..."
export NERVETERM_MODEL="gpt-4o"
export NERVETERM_SHELL="zsh"nerveterm/
βββ adapters/ # External service implementations
β βββ openai/ # OpenAI API adapter
β βββ shell/ # Shell execution adapter
βββ application/ # Application orchestration
βββ cmd/ # CLI entry points
β βββ nerveterm/
βββ config/ # Configuration management
β βββ record_ops.go # Functional record operations (fp-go)
βββ core/ # Domain logic
β βββ detector/ # Executable detection
β βββ intent/ # Intent analysis with predicates
β βββ prompt/ # Prompt building with monoids
β βββ response/ # LLM response parsing
β βββ shell/ # State monad for shell state
β βββ types/ # Shared types with fp-go helpers
βββ docs/ # Documentation
β βββ plans/ # Design documents
βββ ports/ # Interface definitions
βββ testutil/ # Testing utilities (assertions)
βββ tui/ # Terminal UI (Bubble Tea)
βββ history.go # Functional history operations
βββ lenses.go # Immutable state updates (optics)
βββ model.go
βββ traversal.go # Batch operations (optics)
βββ update.go
βββ view.go
# Run all tests
go test ./...
# Run with coverage
go test -cover ./...
# Run specific package tests
go test ./tui -v| Priority | Feature | Status |
|---|---|---|
| High | Working Tab completion (file paths) | Blocked |
| High | Stable ghost text suggestions | In Progress |
| Medium | Multi-line command input | Planned |
| Medium | Command history search (Ctrl+R) | Planned |
| Medium | Configurable keybindings | Planned |
| Low | Alternative LLM providers (Anthropic, etc.) | Planned |
| Low | Session persistence | Planned |
| Low | Plugin system | Planned |
# Clone the repository
git clone https://github.com/somhairle/nerveterm.git
cd nerveterm
# Install dependencies
go mod download
# Run the application
go run cmd/nerveterm/main.go- Follow Go conventions (
gofmt,golint) - Use functional patterns from fp-go where appropriate
- Write tests for new features
- Update documentation for API changes
- Ghost Completion Design - Detailed design for the ghost text completion feature
- Bubble Tea - TUI framework
- fp-go - Functional programming library for Go
- go-openai - OpenAI API client
MIT License - see LICENSE for details.
Copyright (c) 2026 Somhairle H. Marisol
