Flyfree: A CLI Tool for Elegant LLM Provider Management


What is Flyfree?

Flyfree is a CLI tool that makes it easy to manage and switch LLM provider configurations for AI coding tools like Claude Code and Codex.

Instead of manually editing configuration files for each tool, Flyfree provides a unified interface to:

  • Subscribe to different LLM providers (Zhipu AI, OpenRouter, etc.)
  • Switch between providers instantly
  • Keep automatic backups of your configurations
  • Manage everything through simple commands

The Problem It Solves

Let’s say you want to use MiniMax with the Codex CLI. Normally you would need to:

  1. Know where Codex stores its config
  2. Manually create and edit ~/.codex/config.toml
  3. Set environment variables
  4. Repeat this for every tool you use

With Flyfree, you just run:

npm i -g @llmapis/flyfree
ff sub 'ff://minimax?key={YOUR_API_KEY}' --auto
codex

That’s it! Flyfree handles the rest.


How to Use Flyfree

Installation

npm install -g flyfree
# or
npm i -g @llmapis/flyfree

Quick Start

1. Subscribe to a Provider

For Zhipu AI:

ff sub 'ff://z.ai?key=YOUR_API_KEY' -a zhipu --auto

For OpenRouter:

ff sub 'ff://openrouter?key=YOUR_API_KEY' -a openrouter --auto

2. Switch Between Providers

# List all subscribed providers
ff list

# Interactive switching
ff switch

# Direct switching
ff set claude-code zhipu
ff set claude-code openrouter

Common Commands

CommandDescription
ff sub <url>Subscribe to a provider
ff listShow all subscribed providers
ff set <agent> <provider>Switch provider for an agent
ff switchInteractive provider switching
ff resetReset configuration
ff restoreRestore from backup
ff unsub <provider>Unsubscribe from a provider

Built-in Providers

Flyfree supports these providers out of the box:

Zhipu AI

ff sub 'ff://z.ai?key=YOUR_API_KEY' -a zhipu --auto

Supports: Claude Code, Codex

OpenRouter

ff sub 'ff://openrouter?key=YOUR_API_KEY' -a openrouter --auto

Supports: Claude Code

Safe Backup System

Flyfree automatically backs up your original configurations:

  • Up to 10 historical versions
  • One-command restore: ff restore
  • List backups: ff restore --list

Example Workflows

Cost Optimization:

# Daily development (lower cost)
ff set claude-code zhipu

# Important tasks (higher quality)
ff set claude-code openrouter

Team Standardization:

# Subscribe to team config
ff sub https://team-config.company.com/llm -a team-standard --auto

# Everyone uses the same setup
ff set claude-code team-standard

Troubleshooting

Subscription failed?

DEBUG=1 ff sub https://example.com/config

Invalid API key?

ff sub 'ff://z.ai?key=YOUR_ACTUAL_KEY' -a test

Want to start fresh?

rm -rf ~/.ff/
ff sub 'ff://z.ai?key=KEY' -a zhipu --auto

Conclusion

Flyfree simplifies LLM provider management for AI coding tools. With a unified CLI interface, automatic backups, and built-in providers, it gives you flexibility without the configuration hassle.

Ready to try it?

npm i -g @llmapis/flyfree
ff --help

Links: