VanaAPI

← 文章

Coding Agents on Windows, macOS and Linux

终端里的 AgentEN2026-10-24

A coding agent can inspect a repository, propose changes and run development commands. The workflow is similar on Windows, macOS and Linux, but shell syntax, file permissions and runtime locations differ. This walkthrough uses Claude Code as a concrete example, then explains what to check when choosing Codex or Gemini CLI.

§ Step 1: Choose your working environment

Start with a terminal, Git and a current Node.js LTS release supported by your chosen agent. Check the agent’s current installation requirements before installing it.

  • Windows: Choose native PowerShell or Windows Subsystem for Linux (WSL). WSL is useful for repositories that depend on Unix shell scripts. If you choose WSL, install Git, Node.js and the agent inside that Linux distribution rather than mixing Windows and Linux executables.
  • macOS: Use Terminal or another terminal application. Install your runtime using a trusted package manager or version manager. Some projects also require Apple’s command-line developer tools.
  • Linux: Use your distribution’s terminal and package tools, checking that the packaged Node.js version meets the agent’s requirements.

Run git --version, node --version and npm --version. If any command is missing, resolve that before proceeding.

§ Step 2: Prepare a small, reversible task

Open your repository and run git status. Commit or otherwise preserve existing work, then create a branch with git switch -c agent-first-task. Run the project’s normal tests once so you know whether failures already exist.

For WSL, keep Linux-heavy projects in the Linux filesystem where practical. Avoid sharing one dependency directory between Windows and Linux: native packages, executable permissions and path handling may differ.

§ Step 3: Install and check the agent

One installation option for Claude Code is npm install -g @anthropic-ai/claude-code. Follow its current platform requirements, then run claude --version to confirm that your shell can find it.

If installation produces permission errors on macOS or Linux, prefer a user-owned Node.js installation rather than immediately using elevated privileges. On Windows, reopen the terminal if a newly installed executable is not yet on your PATH.

§ Step 4: Configure Vana API

Create a Vana API account, generate an API key and check the available model identifiers in your account. Vana API provides one endpoint, https://api.vanaapi.com, with OpenAI-compatible access plus Anthropic Messages and Gemini native protocols. Usage is billed per real token, with no monthly fee.

For Claude Code, configure its Anthropic connection in the terminal where you will launch it. In macOS, Linux or WSL using Bash or Zsh, run export ANTHROPIC_BASE_URL='https://api.vanaapi.com' and export ANTHROPIC_API_KEY='YOUR_VANA_API_KEY'. Replace the placeholder with your key.

In Windows PowerShell, use $env:ANTHROPIC_BASE_URL = 'https://api.vanaapi.com' and $env:ANTHROPIC_API_KEY = 'YOUR_VANA_API_KEY'. These settings apply to the current shell and processes launched from it.

Do not commit credentials or paste them into agent prompts. Check for conflicting authentication settings or an existing login if the agent uses an unexpected account. Select an available model, such as Claude Sonnet 5.5, using the exact API identifier supplied by Vana API rather than guessing from its display name.

§ Step 5: Run a controlled first session

Launch claude from the repository root. First ask it to inspect the project without editing: “Summarize the application structure, identify the test command and propose one small improvement.”

Next, approve a narrowly scoped change. Require the agent to explain commands before running them, and review requests involving package installation, deletion, network access or files outside the repository. Keep permission prompts enabled while establishing trust.

§ Step 6: Verify and adapt

Review git diff, run tests yourself and inspect new dependencies before committing. Confirm that usage appears in your Vana API account.

For Codex or Gemini CLI, use that tool’s current custom-provider configuration instructions. Match its required protocol, authentication method and model identifier to Vana API’s documented settings. Do not reuse Anthropic environment variables for other clients, or assume that OpenAI compatibility guarantees every agent-specific feature. Validate the connection with a small request before granting repository access.