安裝自由代码, 您终端的 AI 自由编码代理器
自由码读取您的工程, 编辑您批准的 diff 文件, 运行测试并修正失败的内容 。 一行安装在MacOS、Linux或Windows上。
curl -fsSL https://free.ai/install.sh | sh
irm https://free.ai/install.ps1 | iex
诺尔顿,皮或管理权首先需要。 再运行同一行升级 。
自由开始: 6,000 Token 每天无账号, 30,000 一天有确认的自由账户 。
安装其他方式
The one-line installer uses uv, then pipx, then a private Python environment, whichever works first. If you already use one of these tools, install the freeai-code package directly:
uv tool install freeai-code
pipx install freeai-code
pip install freeai-code
npm install -g freeai-code
npm 包件需要 Python 3.9 或机器上更新的 。
安装指定版本
# macOS / Linux
curl -fsSL https://free.ai/install.sh | FREE_CODE_VERSION=<version> sh
# Windows (PowerShell)
$env:FREE_CODE_VERSION = "<version>"; irm https://free.ai/install.ps1 | iex
强制使用一种安装方法,将FREE_CODE_INSTALLER设为UV、pipx或venv 设置为相同的安装方法。
检查它是否有效
free-code --version
首跑
在您的工程文件夹中打开终端并启动会话 。 工作时没有账户
cd your-project
free-code
# Or one task at a time
free-code ask "How does the auth system work?"
free-code run "Add unit tests for the User model"
默认的安全模式正在运行: 您看到 diff 并批准每个文件在运行前编辑和命令 。 第一次,自由代码询问是否发送匿名失事报告。 默认答案为否。
签名和 API 键
Signing in raises your daily free allowance and lets you use paid models from your token balance. Your browser opens at Free.ai, you press Approve, and the CLI receives a key automatically.
free-code login # opens your browser
free-code login --no-browser # over SSH: approve from any device with a short code
free-code login --manual # paste a key or choose your own provider
free-code logout # forget the key on this machine
您也可以在您的账户中创建键并设置它,这对服务器和 CI 来说是有用的:
free-code config set token sk-free-...
# or, for one shell or a CI job
export FREE_CODE_TOKEN=sk-free-...
使用您自己的提供者密钥
自由代码也与您自己的 OpenAI、人类学、谷歌或 OpenRouter 键合作。 然后向那个提供你钥匙的供应商提出要求。
free-code config set provider anthropic
free-code config set api_key sk-ant-...
选取模型
free-code lists every model Free.ai serves, free tier models first. Free tier models cost no tokens within your daily allowance; paid models are billed in tokens.
free-code models # chat models, free tier first
free-code models --free # only models that cost no tokens
free-code models --type image # image, video, tts, stt, ocr, music ...
free-code config set model <id> # default model for new sessions
内部会话, 类型/ 模式转换 。 浏览所有模型
共同命令
| 命令 | 它可以做什么 |
|---|---|
free-code | 在此文件夹中启动交互式会话 |
free-code -c | 恢复此工程的最新会话 |
free-code ask "..." | 问一个有关代码库的问题 |
free-code run "..." | 执行一项编码任务 |
free-code -p "..." | 打印答题和退出, 用于脚本和 CI |
free-code sessions | 列出您可以恢复的保存的会话列表 |
free-code tools | 显示代理商可用和需要批准的工具 |
free-code cloud "..." --repo URL | 在 Free.ai 云中运行任务并获取报告 |
free-code tasks | 列出您最近完成的云任务 |
free-code rc | 监视并从 Free.ai 应用程序驱动会话 |
free-code mcp add | 连接 MCP 服务器 |
free-code update | 升级至最新版本 |
free-code config | 显示您的设置 |
除了编辑文件和运行命令之外,该代理商还可以将图像、语言、音乐和视频生成到您的项目中,抄录音频,读取截图和PDFs的文字,搜索网站并引用引文,翻译本地文件。
更新和卸封
通过安装的任何东西进行自由码更新升级。 要删除它,请使用相同的工具 :
free-code update
uv tool uninstall freeai-code
pipx uninstall freeai-code
pip uninstall freeai-code
npm uninstall -g freeai-code
如果安装者创建了自己的环境,请删除主目录中的.free-code文件夹和.local/bin中的free-code文件。 您的设置和保存的会话也生活在. free-code中。
排除故障
自由代码: 找不到命令
安装文件夹尚未在您的 PATH 上 。 在Windows上,打开一个新的终端。 在 macOS 或 Linux 上, 添加到您的 shell 配置中, 并打开一个新的终端 :
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc # or ~/.zshrc
今天的免费匿名限制已用完
Run free-code login to sign in and get the larger daily allowance of a free account, or add tokens to use paid models. 见定价
安装器无法下载 uv
Some networks block astral.sh. Install with pipx or pip instead, or set FREE_CODE_INSTALLER=venv to use your own Python 3.9 or newer.
德比安或Ubuntu 上的 python3 - m vev 失败
用 appt 安装 python3-venv 软件包, 然后再运行安装行 。
还卡住? 或引发GitHub的话题。 GitHub issues
常当问题
开始在终端中使用 AI 编码
curl -fsSL https://free.ai/install.sh | sh