BSE_Code 1.6.0

dotnet tool install --global BSE_Code --version 1.6.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local BSE_Code --version 1.6.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=BSE_Code&version=1.6.0
                    
nuke :add-package BSE_Code --version 1.6.0
                    

๐Ÿค– BSE-Code

The AI coding assistant that lives in your terminal โ€” works with ANY LLM, zero lock-in, zero compromise.

Chat with your codebase, read and write files, run shell commands, connect MCP servers, build reusable skills, persist project memory, and pick up right where you left off โ€” all from a gorgeous interactive REPL.

NuGet npm License: MIT


โœจ Why BSE-Code?

๐ŸŒ Any LLM, anywhere OpenRouter, OpenAI, Anthropic, Google AI, Ollama, LM Studio, Local AI Foundry, or any OpenAI-compatible endpoint
๐Ÿ†“ Start for free OpenRouter's free tier gives you Gemini 2.5 Pro, Llama 4, DeepSeek R1 โ€” no credit card
๐Ÿ  Fully local Ollama or LM Studio โ€” no API key, no data leaving your machine
๐Ÿง  Context-aware Project memory, skills, and MCP tools are all injected automatically into every session
๐Ÿ’พ Session persistence Save and resume conversations per project โ€” never lose context again
๐ŸŽจ Beautiful terminal UI 6 built-in themes, interactive slash picker, history navigation, full cursor editing
โšก Instant shell access !git status, !npm run build โ€” run any command without leaving the chat
๐Ÿ“‚ File injection @src/auth.ts โ€” drop any file or directory straight into your prompt

๐Ÿš€ Install

via .NET tool (NuGet)

Requires .NET 10 SDK.

dotnet tool install --global BSE_Code

Update to the latest version:

dotnet tool update --global BSE_Code

via npm

Requires Node.js 18+. No .NET SDK needed โ€” the binary is bundled.

npm install -g bse-code

๐ŸŒ Supported Providers

# Provider Models API Key
1 ๐Ÿ”€ OpenRouter 100+ models, free tier available Yes (free at openrouter.ai)
2 ๐ŸŸข OpenAI GPT-4o, o3, o1, GPT-3.5 Yes
3 ๐ŸŸฃ Anthropic Claude 3.7/3.5 Sonnet, Haiku, Opus Yes
4 ๐Ÿ”ต Google AI Gemini 2.5 Pro/Flash, 2.0, 1.5 Yes (free tier)
5 ๐Ÿฆ™ Ollama llama3, mistral, qwen, deepseekโ€ฆ โŒ No (local)
6 ๐Ÿ–ฅ๏ธ LM Studio Any model loaded in LM Studio โŒ No (local)
7 ๐Ÿญ Local AI Foundry Phi-4, Phi-3.5 Mini, and more โŒ No (local)
8 โš™๏ธ Custom Any OpenAI-compatible endpoint Optional

๐Ÿง™ First-run Setup

On first run, an interactive wizard walks you through everything:

  1. ๐ŸŽฏ Pick a provider
  2. ๐Ÿ”— Set the base URL (pre-filled for known providers)
  3. ๐Ÿ”‘ Enter your API key (skipped for local providers)
  4. ๐Ÿค– Browse available models and pick one
  5. ๐Ÿ’พ Everything saved to ~/.bse-code/config.json

Re-run the wizard any time:

bse-code --config

โšก Quick-start by provider

๐Ÿ”€ OpenRouter โ€” free models, no credit card

bse-code --config
# Select [1] OpenRouter
# Get a free key at: https://openrouter.ai/keys
# Pick Gemini 2.5 Pro, Llama 4, DeepSeek R1 โ€” all free!

๐Ÿฆ™ Ollama โ€” fully local, zero cost

ollama pull llama3.2
bse-code --config
# Select [5] Ollama โ†’ accept default URL โ†’ pick your model

๐ŸŸข OpenAI

bse-code --config
# Select [2] OpenAI โ†’ https://platform.openai.com/api-keys

๐ŸŸฃ Anthropic

bse-code --config
# Select [3] Anthropic โ†’ https://console.anthropic.com/settings/keys

๐Ÿ”ต Google AI (Gemini)

bse-code --config
# Select [4] Google AI โ†’ https://aistudio.google.com/app/apikey

๐Ÿ–ฅ๏ธ LM Studio

# 1. Open LM Studio, load a model, start the local server
bse-code --config
# Select [6] LM Studio โ†’ accept default URL (http://localhost:1234/v1)

๐Ÿญ Local AI Foundry

bse-code --config
# Select [7] Local AI Foundry โ†’ accept default URL (http://localhost:5272/v1)

โš™๏ธ Custom endpoint

bse-code --config
# Select [8] Custom โ†’ enter your URL, key, and model name

๐Ÿ’ป Usage

bse-code
  โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
  โ”‚   โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—                โ”‚
  โ”‚   โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•                โ”‚
  โ”‚   โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—   โ”€ code         โ”‚
  โ”‚   โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•                  โ”‚
  โ”‚   โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—                โ”‚
  โ”‚   โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•                โ”‚
  โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
  provider: OpenRouter
  model   : google/gemini-2.5-pro-exp-03-25:free
  theme   : default
  cwd     : my-project
  ๐Ÿง  skills : 2 loaded
  ๐Ÿ”Œ mcp    : 5 tools from 1 server(s)
  ๐Ÿ’พ memory : 1 BSE.md file(s) loaded
  type /help for commands ยท /exit to quit ๐Ÿš€

 my-project (main) โฏ

โšก One-shot mode

bse-code -p "explain the auth flow in src/auth/"
bse-code -p "list all TODO comments" --output-format json

๐Ÿณ๏ธ All CLI flags

bse-code                              # ๐Ÿ” Interactive REPL
bse-code -p "<prompt>"                # โšก One-shot prompt
bse-code --model <model-id>           # ๐Ÿค– Override model for this session
bse-code --theme <name>               # ๐ŸŽจ Set color theme for this session
bse-code --output-format json|text    # ๐Ÿ“„ Output format (one-shot only)
bse-code --config                     # โš™๏ธ  Re-run the setup wizard
bse-code --version, -v                # ๐Ÿ”ข Show version
bse-code --help, -h                   # โ“ Show help

๐Ÿช„ Special Input Prefixes

Two power-user shortcuts that make BSE-Code feel like a real dev tool:

@ โ€” File & directory injection

Drop any file or folder straight into your prompt. Tab-completes paths as you type.

@src/auth.ts explain this file
@src/auth/ summarize all files in this folder
@README.md what's missing from this doc?

Directories inject up to 20 files automatically โ€” perfect for asking about a whole module at once.

! โ€” Shell passthrough

Run any shell command instantly, no AI involved, output right in your terminal.

!git status
!dotnet build
!npm run test
!ls -la src/

โŒจ๏ธ REPL Slash Commands

๐Ÿ”ง Core

Command Description
/clear ๐Ÿงน Wipe conversation history โ€” fresh start
/model [id] ๐Ÿค– Show current model or switch to a new one mid-session
/compact [hint] ๐Ÿ—œ๏ธ Ask the AI to summarize history and trim tokens
/stats ๐Ÿ“Š Show session stats (duration, turns, tool calls, messages, model, provider, theme, skills, MCP tools)
/tools ๐Ÿ”ง List all available built-in and MCP tools
/help โ“ Show all commands
/exit or /quit ๐Ÿ‘‹ Quit

๐ŸŽจ Appearance

Command Description
/theme ๐ŸŽจ List all available themes with active marker
/theme <name> ๐ŸŽจ Switch theme โ€” persisted to config

๐Ÿง  Skills

Command Description
/skills ๐Ÿ“‹ List all loaded skills (user + project level)
/<skill-name> โ–ถ๏ธ Invoke a skill
/<skill-name> @file.ts โ–ถ๏ธ Invoke a skill with a file argument

๐Ÿ”Œ MCP

Command Description
/mcp ๐Ÿ”Œ List all connected MCP servers and their tools
/mcp reload ๐Ÿ”„ Hot-reload MCP servers without restarting

๐Ÿ’พ Memory

Command Description
/memory ๐Ÿ’พ Show all loaded BSE.md files
/memory add <text> โœ๏ธ Append a note to ./BSE.md instantly
/memory refresh ๐Ÿ”„ Reload all BSE.md files and refresh the system prompt
/init ๐ŸŽ‰ Scaffold a BSE.md in the current directory

๐Ÿ“ Sessions

Command Description
/save <tag> ๐Ÿ’พ Save the current conversation with a tag
/resume ๐Ÿ“‚ List all saved sessions for this project
/resume <tag> โ–ถ๏ธ Restore a saved session and pick up where you left off

๐ŸŽฎ Interactive Input โ€” Feels Like a Real Shell

The REPL has a fully interactive input reader. No more typing blind.

/ โ€” Slash command picker

Type / and an inline menu pops up instantly:

  /  โ†‘โ†“ navigate ยท Enter select ยท Esc cancel
  โ–ถ /clear                ๐Ÿงน clear conversation history
    /model                ๐Ÿค– show or switch model
    /compact              ๐Ÿ—œ๏ธ  summarize history to save tokens
    /theme                ๐ŸŽจ list or set color theme
    /skills               ๐Ÿง  list loaded skills
    /mcp                  ๐Ÿ”Œ list MCP servers and tools
    /memory               ๐Ÿ’พ show loaded BSE.md files
    /save                 ๐Ÿ’พ save conversation
    /resume               โ–ถ๏ธ  list or resume a saved session
    โ€ฆ
  • โฌ†๏ธโฌ‡๏ธ Arrow keys navigate the list
  • โŒจ๏ธ Type more characters to filter live โ€” /th narrows to /theme
  • โ†ฉ๏ธ Enter selects, Esc cancels and lets you type manually
  • โ‡ฅ Tab completes the top match
  • ๐Ÿง  Your skills appear right alongside built-in commands

๐Ÿ“œ History navigation

  • โฌ†๏ธโฌ‡๏ธ arrows cycle through previous inputs โ€” just like your shell
  • Your current draft is preserved when you browse back

โœ๏ธ Full cursor editing

  • โฌ…๏ธโžก๏ธ move the cursor anywhere in the line
  • Home / End jump to start or end instantly
  • Backspace / Delete work at any cursor position

โ‡ฅ Tab completion

  • On /<cmd> โ€” completes or opens the slash picker
  • On @<path> โ€” completes file and directory paths from the filesystem

๐Ÿง  Skills โ€” Reusable AI Workflows

Skills are markdown files that give the AI reusable instructions or workflows. Write once, invoke from any project.

๐Ÿ“‚ Locations (both are loaded and merged):

  • ~/.bse-code/skills/ โ€” user-level, available in every project
  • .bse-code/skills/ โ€” project-level, scoped to this repo

Example skill (.bse-code/skills/review.md):

# Code Review

Review the provided code for:
- Correctness and logic errors
- Performance issues
- Security vulnerabilities
- Code style and readability

Provide specific, actionable feedback with line references.

Invoke it:

/review
/review @src/PaymentService.cs

Skills are also injected into the system prompt automatically โ€” the AI always knows what skills are available. ๐Ÿš€


๐Ÿ’พ Project Memory (BSE.md)

BSE.md files are loaded automatically at startup and injected into every session's system prompt. Teach the AI about your project once โ€” it remembers forever. Similar to Claude's CLAUDE.md and Gemini's GEMINI.md.

๐Ÿ—๏ธ Hierarchy โ€” all three are merged:

File Scope
~/.bse-code/BSE.md ๐ŸŒ Global โ€” your personal preferences across all projects
./BSE.md ๐Ÿ“ Project โ€” tech stack, commands, coding standards
./BSE.local.md ๐Ÿ”’ Local overrides โ€” add to .gitignore

Scaffold one instantly:

bse-code
/init

This creates a BSE.md template with sections for project overview, tech stack, dev commands, and coding standards โ€” ready to fill in.

Add notes on the fly:

/memory add always use async/await, never .Result or .Wait()
/memory add run `dotnet test` before committing

๐Ÿ”Œ MCP (Model Context Protocol)

Connect any external tool or service to BSE-Code via MCP servers. GitHub, databases, Slack, custom APIs โ€” if it speaks MCP, it works here. Tools are discovered automatically and made available to the AI.

Config file: ~/.bse-code/mcp.json

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"],
      "disabled": false
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "your-token"
      }
    }
  }
}
  • MCP tools are available to the AI as mcp__serverName__toolName
  • Hot-reload without restarting: /mcp reload ๐Ÿ”„
  • Inspect what's connected: /mcp
  • Disable a server without removing it: "disabled": true

๐Ÿ”จ Built-in AI Tools

The AI can use these tools autonomously to get things done:

Tool What it does
๐Ÿ“– read_file Read any file's contents
โœ๏ธ Write Write or create a file (auto-creates parent directories)
๐Ÿ–ฅ๏ธ Bash Execute shell commands โ€” cross-platform (cmd.exe on Windows, bash on Unix)
๐Ÿ“‚ list_dir List files and subdirectories at a path
๐Ÿ” glob Find files matching a glob pattern (e.g. src/**/*.cs)
๐Ÿ”Ž grep Search files with a regex pattern (up to 200 matches, recursive by default)
๐Ÿ”Œ mcp__*__* Any tool from your connected MCP servers

Tool calls are shown inline as the AI works โ€” you see exactly what it's doing in real time. โœ“ or โœ— per call.


๐Ÿ’พ Session Management

Never lose a good conversation. Save any session with a tag and resume it later โ€” even across restarts.

/save auth-refactor
/resume
# shows all saved sessions for this project:
#   auth-refactor   2025-04-24 14:32   18 messages   [gpt-4o]
#   bug-hunt        2025-04-23 09:15   31 messages   [claude-3-5-sonnet]

/resume auth-refactor
# โ–ถ๏ธ  Resumed session 'auth-refactor' (18 messages) โ€” welcome back!

Sessions are stored per-project in ~/.bse-code/sessions/ using a SHA-256 hash of the project path โ€” no collisions, no mess. Each session records the tag, model, timestamp, working directory, and full message history.


๐Ÿ“Š Session Statistics

See exactly what's happening in your session:

/stats
  Session stats ๐Ÿ“Š
    โฑ  duration   : 00:23:41
    ๐Ÿ’ฌ turns      : 12
    ๐Ÿ”ง tool calls : 34
    ๐Ÿ“จ messages   : 47
    ๐Ÿค– model      : google/gemini-2.5-pro-exp-03-25:free
    ๐ŸŒ provider   : OpenRouter
    ๐ŸŽจ theme      : dracula
    ๐Ÿง  skills     : 3
    ๐Ÿ”Œ mcp tools  : 8

๐Ÿ—œ๏ธ Conversation Compaction

Running low on context? Compact the conversation into a tight summary without losing the important bits.

/compact
/compact focus on the auth changes we made

The AI summarizes the conversation, the history is trimmed, and you keep going โ€” same context, way fewer tokens. ๐ŸŽฏ


๐ŸŽจ Themes

Six beautiful built-in themes. Switch any time, persisted automatically.

Theme Accent Vibe
default ๐Ÿฉต Cyan Classic terminal
dracula ๐Ÿ’œ Magenta/Purple Dark and moody
monokai ๐Ÿ’› Yellow Warm and punchy
ocean ๐Ÿ’™ Blue Cool and calm
forest ๐Ÿ’š Green Fresh and focused
light ๐Ÿฉต Dark on light For light terminals

Each theme customizes accent, prompt, response, tool calls, success/error states, skills, MCP, and git branch colors.

/theme dracula          # switch and persist
bse-code --theme ocean  # one session only

โš™๏ธ Configuration

Config file: ~/.bse-code/config.json

{
  "provider": "OpenRouter",
  "api_key": "sk-or-...",
  "model": "google/gemini-2.5-pro-exp-03-25:free",
  "base_url": "https://openrouter.ai/api/v1",
  "theme": "default"
}

For local providers โ€” no API key needed:

{
  "provider": "Ollama",
  "api_key": "local",
  "model": "llama3.2",
  "base_url": "http://localhost:11434/v1",
  "theme": "forest"
}

๐ŸŒ Environment variables

Environment variables always override the config file โ€” great for CI/CD or switching contexts fast.

Variable Description
BSE_PROVIDER Provider name (OpenRouter, OpenAI, Anthropic, Google, Ollama, LmStudio, LocalAiFoundry, Custom)
BSE_API_KEY API key for the selected provider
BSE_MODEL Model ID to use
BSE_BASE_URL Override the API base URL

๐Ÿ”„ Legacy variables OPENROUTER_API_KEY, OPENROUTER_MODEL, OPENROUTER_BASE_URL are still accepted for backwards compatibility.

PowerShell (persist):

[System.Environment]::SetEnvironmentVariable('BSE_PROVIDER', 'OpenAI', 'User')
[System.Environment]::SetEnvironmentVariable('BSE_API_KEY', 'your-key', 'User')
[System.Environment]::SetEnvironmentVariable('BSE_MODEL', 'gpt-4o', 'User')

Bash (persist):

export BSE_PROVIDER="Ollama"
export BSE_MODEL="llama3.2"
# No BSE_API_KEY needed for local providers

๐Ÿ“ File Structure

~/.bse-code/
โ”œโ”€โ”€ config.json          # โš™๏ธ  Provider, API key, model, base URL, theme
โ”œโ”€โ”€ mcp.json             # ๐Ÿ”Œ MCP server definitions
โ”œโ”€โ”€ BSE.md               # ๐ŸŒ Global memory (injected into every session)
โ”œโ”€โ”€ skills/
โ”‚   โ””โ”€โ”€ *.md             # ๐Ÿง  User-level skills (available in all projects)
โ””โ”€โ”€ sessions/
    โ””โ”€โ”€ <project-hash>/  # ๐Ÿ’พ Saved conversations, isolated per project
        โ””โ”€โ”€ *.json

.bse-code/               # Project-level (commit this to your repo)
โ”œโ”€โ”€ BSE.md               # ๐Ÿ“ Project memory
โ””โ”€โ”€ skills/
    โ””โ”€โ”€ *.md             # ๐Ÿง  Project-level skills

./BSE.md                 # ๐Ÿ“ Project memory (root level, same as above)
./BSE.local.md           # ๐Ÿ”’ Local overrides โ€” add to .gitignore

๐Ÿ“ฆ Dependencies

Package Version
OpenAI 2.10.0

๐Ÿ“„ License

MIT

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.6.0 81 4/25/2026
1.5.0 77 4/25/2026
1.4.0 84 4/24/2026
1.3.0 94 4/24/2026
1.2.0 87 4/24/2026
1.1.0 86 4/24/2026
1.0.0 92 4/24/2026