Command-line tools are still a common way to work with AI. They give better control and fit naturally into everyday workflows, which is why many people continue to use them.
A common issue with CLI-based tools is that they are often tied to a single provider. Switching between options usually means updating configs and handling multiple API keys. In some cases, it may even involve changing tools. This can slow things down and make everyday work feel a bit frustrating.
Bifrost CLI aims to simplify this setup. It provides a single way to connect CLI tools to multiple providers, without changing how the tools are used. In this article, let us look at how it works and how to get started.
What is Bifrost CLI
Bifrost is an open-source AI gateway that works between applications and model providers. It offers provider-compatible endpoints such as OpenAI, Anthropic, and Gemini formats. It manages request routing, API keys, and response formatting in one place, so separate setups for each provider are not required.
Bifrost CLI was recently released to extend this setup to command-line workflows. It allows existing CLI tools to connect through the Bifrost gateway in place of calling providers directly. The CLI tool continues to work in the same way, with only the endpoint updated.
The CLI tool is configured with Bifrost as the base URL. After this, all requests go through the gateway. Bifrost routes each request to the selected provider, converts it into the required API format, and returns a compatible response. The CLI workflow stays the same, with support for multiple providers through a single endpoint.
Key Features of Bifrost CLI
Bifrost CLI brings several practical features that improve how CLI-based workflows are set up and managed:
- Automatic Setup for CLI Tools: Configures base URLs, API keys, and model settings for each agent. This reduces manual steps and keeps the environment ready to use.
-
Model Discovery from Gateway: Fetches available models directly from the Bifrost gateway using the
/v1/modelsendpoint. This ensures the CLI always reflects the current set of available options. - MCP Integration for Tool Access: Attaches Bifrost’s MCP server to tools like Claude Code. This allows access to external tools and extended capabilities from within the CLI.
- Session Activity Indicators: Displays activity badges for each tab. It becomes easy to see if a session is running, idle, or has triggered an alert.
- Secure Credential Storage: Stores selections and keys securely. Virtual keys are saved in the OS keyring and are not written in plain text on disk.
Getting Started
Bifrost CLI is quick to set up and runs directly from the terminal. The flow includes starting the gateway, launching the CLI, and selecting the agent and model through a guided setup.
Step 1: Start the Bifrost Gateway
Make sure the gateway is running locally (default: http://localhost:8080):
npx -y @maximhq/bifrost
Step 2: Install and Launch Bifrost CLI
In a new terminal, run:
npx -y @maximhq/bifrost-cli
If installed, you can run:
bifrost
Step 3: Enter Gateway Details
Provide the Bifrost endpoint URL.
For local setup, this is usually: http://localhost:8080
If authentication is enabled, you can also enter a virtual key at this stage.
Step 4: Choose a CLI Agent
Select the CLI agent you want to use, such as:
- Codex CLI
- Claude Code
- Gemini CLI
- Opencode
The CLI shows which agents are available and can install missing ones during setup.
Step 5: Select a Model
The CLI fetches available models from the gateway and shows them in a searchable list.
You can choose one directly or enter a model name manually.
Step 6: Launch the Session
Review the configuration and start the session. The selected agent runs with the chosen model and setup.
Step 7: Work with Sessions
After launch, the CLI stays open in a tabbed interface.
You can open new sessions, switch between them, or close them without restarting the CLI. Each tab shows the current activity state.
Understanding the Bifrost CLI Session Flow
Bifrost CLI is built for repeated, session-based use in the terminal. You can switch between runs, update settings, and continue your work without having to go through the full setup again each time.
Here are the key steps in the session flow:
- Launch: Select the agent and model, then start the session.
- Work: Use the agent as usual. All requests go through Bifrost.
-
Switch Sessions: Press
Ctrl + Bto open the tab bar, switch between sessions, or start a new one. - Return: When a session ends, the CLI returns to the setup screen with the previous configuration.
- Relaunch: Change the agent or model, or rerun the same setup.
- Persistence: The last configuration is saved and shown the next time the CLI starts.
Working with Multiple Models
Bifrost CLI makes it easy to work with different models from the same setup. You do not need to change configurations or restart the tool each time you want to try a different option.
During setup, the CLI fetches available models from the Bifrost gateway and shows them in a list. You can select one directly or enter a model name if you already know what you want to use.
If you want to try another model, you can start a new session and choose a different one. Each session runs separately, so you can compare outputs or test different setups side by side.
All requests go through Bifrost, so differences between providers are handled in the background. The CLI experience stays the same across models.
When to Use Bifrost CLI
Bifrost CLI is useful when working with multiple providers or running repeated sessions from the terminal. Since it is built on top of Bifrost, it also brings the benefits of a central gateway into CLI workflows.
- Testing Different Models: Try different models across providers from the same setup.
- Running Iterative Sessions: Start, stop, and relaunch sessions with minor configuration changes.
- Working from the Terminal: Keep the entire workflow inside the CLI, with Bifrost handling routing in the background.
- Comparing Outputs: Run multiple sessions side by side and observe how different models respond.
- Managing Multiple Providers: Use Bifrost as a single entry point to work across providers in one place.
- Centralized Control with Bifrost: Route all requests through Bifrost for consistent handling of API keys, requests, and responses.
This setup helps keep workflows consistent and organized across different providers and sessions.
Conclusion
Bifrost CLI brings multi-provider access into the terminal through a single setup. It keeps existing workflows intact and reduces the need to manage separate configurations.
You can run sessions, switch agents, and try different models from the same interface, with Bifrost handling routing and integration in the background.
To get started or explore more details, check the Bifrost CLI documentation.





Top comments (0)