{"id":49238018,"url":"https://github.com/deepgram/njord","last_synced_at":"2026-04-24T17:37:06.221Z","repository":{"id":335515368,"uuid":"1003858261","full_name":"deepgram/njord","owner":"deepgram","description":null,"archived":false,"fork":false,"pushed_at":"2026-01-30T20:33:58.000Z","size":1271,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-31T09:39:00.398Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deepgram.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-17T19:20:52.000Z","updated_at":"2026-01-30T20:34:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/deepgram/njord","commit_stats":null,"previous_names":["deepgram/njord"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/deepgram/njord","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepgram%2Fnjord","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepgram%2Fnjord/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepgram%2Fnjord/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepgram%2Fnjord/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deepgram","download_url":"https://codeload.github.com/deepgram/njord/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepgram%2Fnjord/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32234726,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-24T17:37:05.541Z","updated_at":"2026-04-24T17:37:06.211Z","avatar_url":"https://github.com/deepgram.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Njord\n\n**Interactive LLM REPL - Navigate the vast ocean of AI conversations**\n\nNamed after the Norse god of the sea and sailors, Njord guides you through the vast ocean of AI conversations with a powerful terminal-based interface for multiple AI providers.\n\n## Features\n\n### 🤖 Multi-Provider AI Support\n- **OpenAI**: Latest models including o3-pro, o3, o4-mini, gpt-4.1 series with reasoning model support\n- **Anthropic**: Claude 4 and 3.x models (Sonnet, Opus, Haiku) with thinking mode support\n- **Google Gemini**: Gemini 2.5 Pro, Flash, and Flash Lite models\n- **Smart Model Detection**: Automatic provider switching based on model selection\n\n### 💬 Advanced Chat Experience\n- **Real-time Streaming**: Live response streaming with proper interruption handling\n- **Thinking Mode**: See AI reasoning process for supported Anthropic models\n- **Multi-line Input**: Triple-backtick code blocks for complex prompts\n- **Smart Interruption**: Ctrl-C handling with message queuing and retry logic\n- **Tab Completion**: Intelligent command and parameter completion with hints\n\n### 📁 Powerful Session Management\n- **Auto-saving**: Sessions automatically saved when they contain AI interactions\n- **Session Operations**: Save, load, fork, merge, and continue sessions\n- **Safe Loading**: Load copies of sessions without modifying originals\n- **Recent Sessions**: Quick access to recently used conversations\n- **Session Search**: Full-text search across all saved sessions with highlighted excerpts\n- **Session Summarization**: Generate AI-powered summaries of conversations for quick review\n\n### 🔧 Code Block Management\n- **Automatic Extraction**: Code blocks automatically detected and numbered\n- **Universal Clipboard**: Copy to system clipboard + OSC52 for SSH/terminal compatibility\n- **File Operations**: Save code blocks directly to files\n- **Safe Execution**: Execute bash, Python, and JavaScript with confirmation prompts\n- **Language Support**: Syntax detection for multiple programming languages\n\n### 🎨 Professional Terminal UI\n- **Colored Output**: Syntax highlighting for code blocks and role-based message coloring\n- **Message History**: Navigate conversation history with timestamps and metadata\n- **Command System**: Comprehensive slash commands for all operations\n- **Input History**: Arrow key navigation through previous inputs\n- **Status Display**: Current model, provider, and configuration at startup\n\n## Quick Start\n\n### Prerequisites\n\nYou'll need at least one API key from the supported providers:\n\n- **OpenAI**: Get your API key from [OpenAI Platform](https://platform.openai.com/api-keys)\n- **Anthropic**: Get your API key from [Anthropic Console](https://console.anthropic.com/)\n- **Google Gemini**: Get your API key from [Google AI Studio](https://aistudio.google.com/app/apikey)\n\n### Installation\n\n#### Option 1: Download Pre-built Binary\n\nDownload the latest release from the [releases page](https://github.com/yourusername/njord/releases).\n\n#### Option 2: Build from Source\n\n```bash\n# Clone the repository\ngit clone https://github.com/yourusername/njord.git\ncd njord\n\n# Build the project\ncargo build --release\n\n# The binary will be at target/release/njord\n```\n\n#### Option 3: Install with Cargo\n\nIf you have Rust/Cargo installed, you can build and install directly to your PATH:\n\n```bash\n# Clone and install in one step\ngit clone https://github.com/yourusername/njord.git\ncd njord\ncargo install --path .\n\n# Or for a static binary (requires musl tools on Linux)\nrustup target add x86_64-unknown-linux-musl\ncargo install --path . --target x86_64-unknown-linux-musl\n\n# Now njord should be available in your PATH\nnjord --help\n```\n\n### Setup\n\nSet your API keys as environment variables:\n\n```bash\n# Set at least one API key\nexport OPENAI_API_KEY=\"your-openai-key-here\"\nexport ANTHROPIC_API_KEY=\"your-anthropic-key-here\"\nexport GEMINI_API_KEY=\"your-gemini-key-here\"\n```\n\n### Usage\n\nStart Njord:\n\n```bash\n./njord\n```\n\nOr with command-line options:\n\n```bash\n# Start with a specific model\n./njord --model gpt-4\n\n# Start with custom temperature\n./njord --temperature 0.9\n\n# Load a saved session\n./njord --load-session \"my-session\"\n\n# Start fresh session\n./njord --new-session\n```\n\n## Command Reference\n\n### 🤖 Model \u0026 Provider Management\n- `/models` - List all available models across providers\n- `/model MODEL` - Switch to any model (auto-detects provider)\n- `/status` - Show current provider, model, and configuration\n\n### 💬 Session Management\n- `/chat new` - Start fresh session\n- `/chat save NAME` - Save current session\n- `/chat load NAME` - Load safe copy of session\n- `/chat continue [NAME]` - Resume most recent or named session\n- `/chat fork NAME` - Save current session and start fresh\n- `/chat merge NAME` - Merge another session into current\n- `/chat list` - List all saved sessions with metadata\n- `/chat recent` - Show recently used sessions\n- `/chat delete NAME` - Delete saved session\n- `/chat rename NEW_NAME [OLD_NAME]` - Rename sessions\n- `/chat auto-rename [NAME]` - Auto-generate session titles using LLM\n- `/chat auto-rename-all` - Bulk auto-rename all anonymous sessions\n\n### 📝 Message \u0026 History\n- `/history` - Show full conversation with timestamps\n- `/undo [N]` - Remove last N messages (default 1)\n- `/goto N` - Jump to message N, removing later messages\n- `/search TERM` - Search across all sessions with highlighted results\n- `/summarize [NAME]` - Generate AI summary of session (defaults to current)\n\n### 🔧 Code Block Operations\n- `/blocks` - List all code blocks in current session\n- `/block N` - Display specific code block with syntax highlighting\n- `/copy N` - Copy code block to clipboard (system + OSC52)\n- `/save N FILENAME` - Save code block to file\n- `/exec N` - Execute code block with safety confirmation\n\n### ⚙️ Configuration\n- `/system [PROMPT]` - Set/view/clear system prompt\n- `/temp VALUE` - Set temperature (0.0-2.0, model-dependent)\n- `/max-tokens N` - Set maximum response tokens\n- `/thinking on|off` - Enable/disable thinking mode (Anthropic models)\n- `/thinking-budget N` - Set thinking token budget\n\n### 🔍 Utilities\n- `/help` - Show all commands\n- `/clear` - Clear terminal screen\n- `/quit` - Exit Njord\n\n### 💡 Pro Tips\n- **Multi-line Input**: Start with ``` and end with ``` on its own line\n- **Smart Interruption**: Use Ctrl-C to cancel requests - messages are queued for retry\n- **Tab Completion**: Press Tab for command completion with helpful hints\n- **Universal Clipboard**: `/copy` works in SSH sessions and all terminal types\n- **Session Safety**: `/chat load` creates copies, originals remain unchanged\n\n## Development\n\n### Prerequisites\n\n- Rust 1.70+ (install from [rustup.rs](https://rustup.rs/))\n- Git\n\n### Building\n\n```bash\n# Clone the repository\ngit clone https://github.com/yourusername/njord.git\ncd njord\n\n# Build in development mode\ncargo build\n\n# Build optimized release\ncargo build --release\n\n# Run directly with cargo\ncargo run -- --help\n```\n\n### Building Static Binary\n\nFor deployment or distribution, you can build a statically-linked binary with zero runtime dependencies:\n\n#### On Debian/Ubuntu:\n\n```bash\n# Install musl tools\nsudo apt update\nsudo apt install musl-tools musl-dev\n\n# Add musl target\nrustup target add x86_64-unknown-linux-musl\n\n# Build static binary\ncargo build --release --target x86_64-unknown-linux-musl\n\n# Binary will be at target/x86_64-unknown-linux-musl/release/njord\n```\n\n#### On other platforms:\n\n```bash\n# macOS (already statically links by default)\ncargo build --release\n\n# Windows\ncargo build --release --target x86_64-pc-windows-msvc\n```\n\n### Running Tests\n\n```bash\n# Run all tests\ncargo test\n\n# Run tests with output\ncargo test -- --nocapture\n\n# Run specific test\ncargo test test_name\n```\n\n### Code Structure\n\n```\nsrc/\n├── main.rs           # Application entry point\n├── cli.rs            # Command-line argument parsing\n├── config.rs         # Configuration management\n├── repl.rs           # Main REPL loop and logic\n├── ui.rs             # User interface and terminal handling\n├── commands.rs       # Command parsing and execution\n├── session.rs        # Chat session management\n├── history.rs        # Session persistence\n└── providers/        # LLM provider implementations\n    ├── mod.rs        # Provider trait and factory\n    ├── openai.rs     # OpenAI API integration\n    ├── anthropic.rs  # Anthropic API integration\n    └── gemini.rs     # Google Gemini API integration\n```\n\n## Configuration\n\n### Environment Variables\n\n```bash\n# API Keys (at least one required)\nexport OPENAI_API_KEY=\"your-openai-key\"\nexport ANTHROPIC_API_KEY=\"your-anthropic-key\"\nexport GEMINI_API_KEY=\"your-gemini-key\"\n\n# Optional defaults\nexport NJORD_DEFAULT_MODEL=\"gpt-4\"\nexport NJORD_DEFAULT_TEMPERATURE=\"0.7\"\n```\n\n### Command Line Options\n\n```bash\nnjord --help\n```\n\n## Supported Models\n\n### OpenAI\n- `o3-pro` (latest reasoning model)\n- `o3` (reasoning model)\n- `o4-mini` (fast reasoning model)\n- `o3-mini` (compact reasoning model)\n- `o1-pro` (reasoning model)\n- `o1` (reasoning model)\n- `gpt-4.1` (latest chat model)\n- `gpt-4o`\n- `gpt-4.1-mini`\n- `gpt-4o-mini`\n- `gpt-4.1-nano`\n\n### Anthropic\n- `claude-sonnet-4-20250514` (latest, supports thinking)\n- `claude-opus-4-20250514` (supports thinking)\n- `claude-3-7-sonnet-20250219` (supports thinking)\n- `claude-3-5-sonnet-20241022`\n- `claude-3-5-haiku-20241022`\n- `claude-3-5-sonnet-20240620`\n\n### Google Gemini\n- `gemini-2.5-pro`\n- `gemini-2.5-flash`\n- `gemini-2.5-flash-lite`\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Make your changes\n4. Add tests if applicable\n5. Commit your changes (`git commit -m 'Add amazing feature'`)\n6. Push to the branch (`git push origin feature/amazing-feature`)\n7. Open a Pull Request\n\n## License\n\nThis project is licensed under the ISC License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- Named after Njörðr, the Norse god associated with the sea, seafaring, wind, fishing, wealth, and crop fertility\n- Built with [Rust](https://www.rust-lang.org/) for performance and safety\n- Uses [rustls](https://github.com/rustls/rustls) for pure Rust TLS implementation\n- Terminal interface powered by [rustyline](https://github.com/kkawakam/rustyline)\n- Universal clipboard support via [arboard](https://github.com/1Password/arboard) and OSC52 escape sequences\n- Developed with [Aider](https://aider.chat/) - the entire project was collaboratively built using Aider and Claude-4-Sonnet\n\n## What's New in v0.3.0\n\n- **Enhanced Retry Logic**: Exponential backoff retry system with 5 attempts (0.5s to 16s backoff)\n- **Improved Test Isolation**: Environment variable handling refactored for reliable testing\n- **Docker Support**: Multi-stage Dockerfile with cargo-chef for efficient builds and static linking\n- **Rust Toolchain**: Pinned to Rust 1.85.1 for consistent builds across environments\n\n## What's New in v0.2.0\n\n- **Complete Code Management System**: Extract, view, copy, save, and execute code blocks\n- **Universal Clipboard Integration**: Works in SSH sessions and all terminal environments\n- **Advanced Session Operations**: Fork, merge, continue, and safe loading of sessions\n- **Full-Text Search**: Search across all sessions with intelligent excerpt highlighting\n- **Session Summarization**: AI-powered summaries for quick conversation review\n- **Auto-Renaming System**: LLM-generated session titles with bulk processing support\n- **Enhanced Tab Completion**: Smart command completion with helpful hints\n- **Thinking Mode Support**: See AI reasoning process for supported Anthropic models\n- **Robust Interruption Handling**: Ctrl-C with message queuing and retry logic\n- **Professional Terminal UI**: Syntax highlighting, colored output, and status displays\n\n## Roadmap\n\nSee [ROADMAP.md](ROADMAP.md) for planned features and development phases.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepgram%2Fnjord","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepgram%2Fnjord","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepgram%2Fnjord/lists"}