Fluxio
← Back to the blog

Shell Aliases for Coding Agents With Live Token Replies

Coding agents, liveEN

§1 One terminal shortcut for each coding-agent model

A shell alias is a nickname for a command. Instead of remembering a coding agent’s model option every time you open your terminal, you can save two short commands: one for routine work and another for harder problems.

For example, you might type agent-fast when asking for a small test and agent-deep when investigating an unfamiliar codebase. Both shortcuts launch the same coding agent, but they request different models. If your agent and API connection support streaming, replies can appear token by token rather than arriving as one finished block.

§2 Model selection and token streaming are separate settings

Your coding agent is the terminal application that reads your request and may inspect files, propose edits, or run tools. The model is the AI system behind those decisions. The API provider or relay carries requests between them.

An alias changes the command you launch. It does not make a model faster, enable streaming automatically, or guarantee that every model supports your agent’s tools. Streaming also does not mean the agent is safe to run unattended. Keep its permission prompts and review its changes.

§3 Check your agent’s model option before creating aliases

Start with the agent’s help command. For Codex, run codex --help and check the model-selection option supported by your installed version. The examples below use --model.

Next, find the exact model identifiers accepted by your configured provider. A display name such as Claude Haiku 4.5 or Claude Sonnet 5.5 is not necessarily the identifier your command must send. Also confirm that the selected model works with your agent’s required API interface and tool features.

§4 Create two Codex aliases in Bash or Zsh

Open your shell configuration file: usually ~/.bashrc for interactive Bash sessions or ~/.zshrc for Zsh. Add the following lines, putting each command on its own line and replacing both placeholder values with verified model identifiers.

  • – FAST_MODEL='YOUR_FAST_MODEL_ID' stores the identifier for routine coding requests.
  • – DEEP_MODEL='YOUR_DEEP_MODEL_ID' stores the identifier for more demanding requests.
  • – alias agent-fast='codex --model "$FAST_MODEL"' creates your routine-work shortcut.
  • – alias agent-deep='codex --model "$DEEP_MODEL"' creates your deeper-work shortcut.

The single quotes around each alias definition preserve the variable reference until you run the shortcut. That lets you update a model variable without rewriting the alias. These variables do not contain credentials.

Open a new terminal, or reload the appropriate file with source ~/.bashrc or source ~/.zshrc. Then run agent-fast. Use alias agent-fast to inspect the saved command if it behaves unexpectedly.

§5 Connect Fluxio before relying on model shortcuts

Fluxio fits this setup when you want a streaming-first, pay-per-token API relay with one key across multiple model families. It works with coding tools including Codex, Claude Code, and Gemini CLI, as well as OpenAI SDK clients. Your aliases remain local shortcuts; Fluxio handles the configured API connection.

Fluxio’s API base is https://api.fluxioapi.com. OpenAI-style clients add /v1. Follow the setup instructions for your particular agent rather than assuming every tool reads the same environment variables. An OpenAI SDK configuration is not automatically a working Claude Code configuration.

Keep your API key out of aliases, shared dotfiles, and source control. Use the credential mechanism recommended for your client. Configure the provider first, verify one ordinary request, and only then add model-switching shortcuts.

§6 Test each alias with a small streaming request

Ask each shortcut to explain a short function before allowing repository edits. Check the selected model in the agent’s session information or provider usage records. Watch whether text arrives incrementally, while remembering that some tools buffer output or show progress instead of raw token streams.

Switching aliases normally starts a new invocation; it does not replace the model inside an already-running session. Keep your naming simple, compare usefulness and cost on real tasks, and review every proposed change.

Sign up for Fluxio to try your model-switching setup.

Create a Fluxio account →

More from the current