db-claude-bridge
v0.1.2
Published
A lightweight bridge that lets the Claude Code CLI authenticate and run through Databricks Foundation Models using Databricks OAuth.
Maintainers
Readme
DB Claude Bridge
A lightweight bridge that lets the Claude Code CLI authenticate and run through Databricks Foundation Models using Databricks OAuth.
This lightweight bridge provides seamless integration between Claude Code CLI and Databricks Foundation Models, handling Databricks OAuth authentication automatically so you can focus on using powerful language models.
Installation
npm install -g db-claude-bridgeOr with yarn:
yarn global add db-claude-bridgeQuick Start
Just run db-claude-bridge - it handles authentication automatically!
# Run Claude through Databricks (handles login & auth automatically)
db-claude-bridge
# Or pass a prompt directly
db-claude-bridge "What is Python?"
# Check status
db-claude-bridge statusOn first run, it will:
- Prompt for your Databricks workspace URL
- Open browser for OAuth authentication
- Install Claude CLI if needed
- Start your interactive session
How it Works
This lightweight bridge handles Databricks OAuth authentication and configures Claude Code CLI to run through Databricks Foundation Models. Simply authenticate once with your Databricks workspace, and the bridge automatically manages OAuth tokens, enabling Claude Code CLI to seamlessly access Foundation Models hosted on Databricks.
Configuration
The bridge stores configuration in:
~/.db-claude-bridge/config.json- Bridge settings and OAuth tokens~/.claude/settings.json- Claude Code CLI config (managed automatically by the bridge)
Managing Configuration
# View current bridge configuration
db-claude-bridge config
# Update Databricks workspace URL
db-claude-bridge config --host https://your-workspace.databricks.com
# Reset bridge settings and OAuth tokens
db-claude-bridge config --reset
# Use different workspace for one session
db-claude-bridge --host https://your-workspace.databricks.com loginCommands
db-claude-bridge- Run Claude through Databricks (handles authentication automatically)db-claude-bridge login- Explicitly authenticate with Databricks OAuth (optional, done automatically)db-claude-bridge logout- Clear OAuth authentication tokensdb-claude-bridge status- Check Claude Code CLI and Databricks OAuth statusdb-claude-bridge config- Manage bridge configuration and OAuth settings
Requirements
- Node.js 16.0+ (Node.js 16, 18, or 20 recommended)
- Claude Code CLI (automatically installed by the bridge if missing)
- Databricks workspace with Foundation Models access
Development
git clone https://github.com/ahdbilal/db-claude-bridge-npm.git
cd db-claude-bridge-npm
# Install dependencies
npm install
# Build the project
npm run build
# Run tests
npm test
# Run linting
npm run lint
# Format code
npm run formatAPI Usage
You can also use this package programmatically:
import { DatabricksClaudeCore } from 'db-claude-bridge';
const core = new DatabricksClaudeCore(
'https://your-workspace.cloud.databricks.com',
null,
false // debug mode
);
// Check authentication status
const [isAuth, email] = core.isAuthenticated();
// Authenticate
core.authenticate();
// Get token
const token = core.getDatabricksToken();
// Update Claude config
core.updateClaudeConfig(token);Troubleshooting
OAuth authentication issues:
db-claude-bridge logout
db-claude-bridge loginBridge configuration issues:
db-claude-bridge config --resetDebug the bridge:
db-claude-bridge --debug statusLicense
Apache License 2.0 - see LICENSE file.
