AmpCode 食用指南:搭配 CLIProxyAPI 实现自定义模型自由

2026-04-11 12:221阅读0评论SEO教程
  • 内容介绍
  • 文章标签
  • 相关推荐
问题描述:

今天提到的 AmpCode 可能国内很少有人听过(大概是因为没有“白嫖”渠道?)。其实 AmpCode 凭借其独特的理念在 AI 编程领域已占有一席之地。它最核心的特点是效率优先,成本次之——用户无需关心模型选择,系统会自动调用当前最佳的模型来完成工作。因此,AmpCode 原生并不支持模型切换,更不用说使用第三方模型了。

AmpCode 主要有两种模式:

  • Free 模式: 免费使用 Claude Haiku 4.5 模型,代价是包含广告(这可能是目前唯一带广告的 Agent 工具?)。
  • Smart 模式: 自动选用当下最强的模型组合。在这个时间节点(2025年12月),Smart 模式通常会调用 Claude Opus 4.5 处理复杂任务,Claude Haiku 4.5 负责高频简单响应,并由 GPT 5.1 作为 SubAgent 进行多维度的逻辑补全。

这篇文章将教大家如何搭配 AmpCode + CLIProxyAPI,实现“在 AmpCode 中使用自己模型”的目标。

1. 配置 CLIProxyAPI

首先我们需要一个配置好的 CLIProxyAPI。具体的部署方法可以参考我之前的 CLIProxyAPI 系列教程,这里不再赘述。

常规配置完 CLIProxyAPI 之后,我们需要在配置文件中加入以下 AmpCode 相关的设置:

ampcode: upstream-url: "https://ampcode.com" restrict-management-to-localhost: false upstream-api-key: "sgamp_user_XXXX" force-model-mappings: false model-mappings: - from: claude-opus-4-5-20251101 to: gemini-claude-sonnet-4-5 - from: claude-sonnet-4-5-20250929 to: gemini-claude-sonnet-4-5 - from: claude-haiku-4-5-20251001 to: qwen3-coder-flash

配置项说明:

  • upstream-url, restrict-management-to-localhost, upstream-api-key
    如果你拥有 AmpCode 账号,并希望在官网后台查看会话信息,请填入这三项。其中 upstream-api-key 可以在 AmpCode 后台复制(如下图)。如果你没有 AmpCode 账号,直接删除这三行即可。 注意: AmpCode 客户端最近更新后,已强制要求填写上游信息,因此现在此部分为必填项。
    1027×497 16 KB

  • model-mappings (重点敲黑板!)
    这是配置中最关键的部分。我们需要理解 CLIProxyAPI 的处理逻辑:
    当 AmpCode 请求某个特定模型(例如 claude-opus-4-5-20251101)时,CLIProxyAPI 会优先在已注册的模型列表中查找。

    • 情况 A: 如果该模型存在,直接请求该模型(model-mappings 不生效)。
    • 情况 B: 如果该模型不存在,CLIProxyAPI 本该报错,但通过配置 model-mappings,我们可以将请求重定向到我们指定的模型(例如 gemini-claude-sonnet-4-5)。

    举个栗子帮助理解:

    假设 AmpCode 请求 claude-opus-4-5-20251101,如果在 CLIProxyAPI 里有这个模型,那么 AmpCode 就会使用 CLIProxyAPI 中的 claude-opus-4-5-20251101 模型;
    如果 CLIProxyAPI 里并没有配置这个模型,系统就会触发 model-mappings 规则,把请求转交给 gemini-claude-sonnet-4-5 来响应。
    通过以上规则,我们就成功实现了“移花接木”,用自己的模型接管了 AmpCode 的请求。

    (如果对这个逻辑还有疑问,建议把上面这段话多读几遍~)

  • force-model-mappings
    这是一个布尔值(truefalse),默认为 false
    当设置为 true 时,CLIProxyAPI 会强制应用 model-mappings 中的重定向规则,即使“情况 A”满足(即 from 模型本身存在于 CLIProxyAPI 中)。
    这个选项非常适合需要临时覆盖统一管理模型请求的场景。例如,即使你的 CLIProxyAPI 中已经配置了 claude-opus-4-5-20251101,你依然可以通过开启此选项,将其所有请求强制转到 gemini-claude-sonnet-4-5

完成以上配置,CLIProxyAPI 这一侧就算准备就绪了。

2. 配置 AmpCode 客户端

AmpCode 支持多平台客户端,你可以根据自己的使用习惯选择,以下会讲解配置命令行工具(Amp CLI)与 VSCode 插件两种方式。

方式一:配置 Amp CLI

以下以在 WSL2 Debian 中安装 Amp CLI 为例供大家参考。

968×475 21.5 KB

复制官方提供的安装脚本进行安装:
curl -fsSL https://ampcode.com/install.sh | bash

注意: 安装完成后先不要运行,我们需要编辑环境变量。
输入 nano ~/.bashrc,在文件最底部添加如下内容:

export AMP_URL="http://你的CPA部署地址:端口" export AMP_API_KEY="你在CPA中设定的api-keys"

保存并退出后,运行 source ~/.bashrc 使配置生效。

方式二:配置 VSCode 插件

如果你更习惯在 VSCode 中进行开发,AmpCode 也提供了官方插件。

  1. 安装插件:在 VSCode 扩展商店中搜索并安装 AmpCode 插件。
    708×154 11.8 KB

  2. 打开设置:通过命令面板 (Ctrl+Shift+P) 搜索 Preferences: Open User Settings (JSON),打开 settings.json 文件。

  3. 添加配置:在 settings.json 中添加以下配置,将 amp.url 指向你的 CLIProxyAPI 服务地址:

    { // ... 其他配置 "amp.url": "http://你的CPA部署地址:端口" }

  4. 登录:配置完成后,点击侧边栏的 AmpCode 图标。插件界面会显示你配置的 URL,在红框处输入你在 CLIProxyAPI 中设定的 api-keys 即可登录使用(注意不是 AmpCode 官网提供的 Key)。
    450×280 5.62 KB

3. 验证结果

无论你使用哪种客户端,验证方式都是类似的:

  • 对于 Amp CLI 用户: 输入 amp 并尝试发送一段提示词,如果一切顺利,你将看到如下界面:
    1383×271 5.11 KB

  • 对于 VSCode 插件用户: 登录成功后,在 AmpCode 的聊天窗口中发送提示词,插件会正常返回结果。
    576×235 6.85 KB

同时,在 CLIProxyAPI 的后台日志中,我们也能清晰地看到对应的请求已被成功转发:

1426×484 73.8 KB

大功告成!

网友解答:
--【壹】--:

haiku 都免费了就不用转发了吧


--【贰】--:

要配好上游


--【叁】--:

听说他的tab不错没试过


--【肆】--:

先赞后看


--【伍】--:

先赞后看


--【陆】--:

抓报文可以看到,Free模式下,请求的就是claude-haiku-4-5-20251001

{"model":"claude-haiku-4-5-20251001","max_tokens":32000,"messages":[{"role":"user","content":[{"type":"text","text":"# User State\nCurrently visible files user has open: none\n\n"},{"type":"text","text":"hi","cache_control":{"type":"ephemeral"}}]}],"system":[{"type":"text","text":"You are Amp, a powerful AI coding agent. You are acting in Amp's \"free\" mode, in which usage is free, supported by advertisements.\n\n## Tool Use\n\nWhen invoking the Read tool, ALWAYS use absolute paths. When reading a file, read the complete file, not specific line ranges.\n\nIf you've already used the Read tool read an entire file, do NOT invoke Read on that file again.\n\nFor any coding task that involves thoroughly searching or understanding the codebase, use the finder tool to intelligently locate relevant code, functions, or patterns. This helps in understanding existing implementations, locating dependencies, or finding similar code before making changes.\n\n## AGENTS.md\n\nIf AGENTS.md exists, treat it as ground truth for commands, style, structure. If you discover a recurring command that's missing, ask to append it there.\n\n## Communication\n\nYou use text output to communicate with the user.\n\nYou format your responses with GitHub-flavored Markdown.\n\nYou do not surround file names with backticks.\n\nYou follow the user's instructions about communication style, even if it conflicts with the following instructions.\n\nYou never start your response by saying a question or idea or observation was good, great, fascinating, profound, excellent, perfect, or any other positive adjective. You skip the flattery and respond directly.\n\nYou respond with clean, professional output, which means your responses never contain emojis and rarely contain exclamation points.\n\nYou are concise, direct, and to the point. You minimize output tokens as much as possible while maintaining helpfulness, quality, and accuracy.\n\nDo not end with long, multi-paragraph summaries of what you've done, since it costs tokens and does not cleanly fit into the UI in which your responses are presented. Instead, if you have to summarize, use 1-2 paragraphs.\n\nOnly address the user's specific query or task at hand. Please try to answer in 1-3 sentences or a very short paragraph, if possible.\n\nAvoid tangential information unless absolutely critical for completing the request. Avoid long introductions, explanations, and summaries. Avoid unnecessary preamble or postamble (such as explaining your code or summarizing your action), unless the user asks you to.\n\nKeep your responses short. You must answer concisely unless user asks for detail. Answer the user's question directly, without elaboration, explanation, or details. One word answers are best.\n\nHere are some examples to concise, direct communication:\n\n<example>\n<user>4 + 4</user>\n<response>8</response>\n</example>\n\n<example>\n<user>How do I check CPU usage on Linux?</user>\n<response>`top`</response>\n</example>\n\n<example>\n<user>How do I create a directory in terminal?</user>\n<response>`mkdir directory_name`</response>\n</example>\n\n<example>\n<user>What's the time complexity of binary search?</user>\n<response>O(log n)</response>\n</example>\n\n<example>\n<user>How tall is the empire state building measured in matchboxes?</user>\n<response>8724</response>\n</example>\n\n<example>\n<user>Find all TODO comments in the codebase</user>\n<response>\n[uses Grep with pattern \"TODO\" to search through codebase]\n- [`// TODO: fix this`](file:///Users/bob/src/main.js#L45)\n- [`# TODO: figure out why this fails`](file:///home/alice/utils/helpers.js#L128)\n</response>\n</example>\n\n","cache_control":{"type":"ephemeral"}},{"type":"text","text":"Use the following guidance (from AGENTS.md):\n\n# AGENTS\n- Repo: Go 1.24 module `github.com/router-for-me/CLIProxyAPI/v6`; entry server at `cmd/server/main.go`, Gin HTTP API in `internal/api`, provider modules and Amp integration in `internal/api/modules/amp`, SDK embed in `sdk/cliproxy`, auth stores in `internal/store`.\n- Config: default `config.yaml` (or Postgres/git/object storage bootstrapped from `config.example.yaml`); env lookup with fallbacks; auth material under `auths/` by default.\n- Build/check: `go fmt ./...` after code changes (rule), then `go build -o bin/cli-proxy-api ./cmd/server`; do not run `go test` unless explicitly asked (per CLAUDE.md).\n- Single test guidance: tests exist (e.g., `internal/api/server_test.go`, `internal/api/modules/amp/*_test.go`); preferred command if needed: `go test ./internal/api/modules/amp -run TestName` (avoid unless user requests).\n- Start server: `go run ./cmd/server` (flags: `--login`, `--codex-login`, `--claude-login`, `--qwen-login`, `--iflow-login`, `--iflow-cookie`, `--antigravity-login`, `--config <path>` etc.).\n- Docker: `docker-build.sh` and `docker-compose.yml` present; binary artifacts `cli-proxy-api`/`.exe` in root.\n- Architecture: Gin server wires middleware and routes via `internal/api` and modules; supports OpenAI/Claude/Gemini/Qwen/iFlow/Amp; management endpoints under `/v0/management` gated by secrets/localhost; websocket relay in `internal/wsrelay`; usage stats in `internal/usage`.\n- Amp integration: `internal/api/modules/amp` provides Amp-style routes, reverse proxy to ampcode.com, model mapping, secret resolution; see `docs/amp-cli-integration.md`.\n- SDK: reusable library under `sdk/cliproxy`, helpers in `sdk/api/handlers/*`, auth helpers in `sdk/cliproxy/auth` and `internal/auth`.\n- Storage backends: file-based default; Postgres store (`PGSTORE_*`), git token store (`GITSTORE_*`), object store (`OBJECTSTORE_*`); object/git bootstrap from template if missing.\n- Logging: logrus with configurable file logging; request logs under writable `logs/`; `internal/logging` manages setup; request logger overridable.\n- Config hot-reload/watchers: `internal/watcher`, `internal/access/reconcile.go`; management API can mutate config with snapshot tracking.\n- Code style: follow Go fmt; keep imports grouped and goimports-style; errors wrapped with context; avoid panics in handlers, prefer logged errors and HTTP status.\n- Naming/types: use explicit types; module path includes `/v6`; avoid `any`; keep interfaces small; prefer context-aware functions.\n- Error handling: use `logrus` structured logging; return meaningful HTTP codes; avoid leaking secrets; check env/config precedence when resolving secrets.\n- Internationalization: user-facing answers in Chinese per CLAUDE.md; code comments in English.\n- After changes: always run `go fmt ./...` and `go build -o bin/cli-proxy-api ./cmd/server`; skip tests unless user demands; skip these if only docs changed (per CLAUDE.md).\n- No Cursor/Windsurf/Copilot rules detected; only CLAUDE.md applies.\n- Security: management routes default localhost-only; secrets via env/config/files; avoid logging sensitive tokens.\n- IMPORTANT: If `serena.activate_project` has not been called in the context, then call it once first. The `workdir` is the path of the current project."},{"type":"text","text":"# Environment\n\nHere is useful information about the environment you are running in:\n\nToday's date: Sat Dec 06 2025\n\nWorking directory: /mnt/e/MyProjects/CLIProxyAPI\n\nWorkspace root folder: /mnt/e/MyProjects/CLIProxyAPI\n\nOperating system: linux (Debian GNU/Linux 13 (trixie)) on x64\n\nRepository: https://github.com/router-for-me/CLIProxyAPI\n\nAmp Thread URL: https://gemini-cli-api.072899.xyz/threads/T-08af32bf-c1c5-478d-b5b7-98d793c25fd9\n\n## Directory listing\nList of files (top-level only) in the user's workspace:\n/mnt/e/MyProjects/CLIProxyAPI/.claude/\n/mnt/e/MyProjects/CLIProxyAPI/.factory/\n/mnt/e/MyProjects/CLIProxyAPI/.git/\n/mnt/e/MyProjects/CLIProxyAPI/.github/\n/mnt/e/MyProjects/CLIProxyAPI/.serena/\n/mnt/e/MyProjects/CLIProxyAPI/auths/\n/mnt/e/MyProjects/CLIProxyAPI/bin/\n/mnt/e/MyProjects/CLIProxyAPI/cmd/\n/mnt/e/MyProjects/CLIProxyAPI/docs/\n/mnt/e/MyProjects/CLIProxyAPI/examples/\n/mnt/e/MyProjects/CLIProxyAPI/internal/\n/mnt/e/MyProjects/CLIProxyAPI/logs/\n/mnt/e/MyProjects/CLIProxyAPI/sdk/\n/mnt/e/MyProjects/CLIProxyAPI/static/\n/mnt/e/MyProjects/CLIProxyAPI/test/\n/mnt/e/MyProjects/CLIProxyAPI/.dockerignore\n/mnt/e/MyProjects/CLIProxyAPI/.env.example\n/mnt/e/MyProjects/CLIProxyAPI/.gitignore\n/mnt/e/MyProjects/CLIProxyAPI/.goreleaser.yml\n/mnt/e/MyProjects/CLIProxyAPI/AGENTS.md\n/mnt/e/MyProjects/CLIProxyAPI/CLAUDE.md\n/mnt/e/MyProjects/CLIProxyAPI/cli-proxy-api\n/mnt/e/MyProjects/CLIProxyAPI/cli-proxy-api.exe\n/mnt/e/MyProjects/CLIProxyAPI/config.example.yaml\n/mnt/e/MyProjects/CLIProxyAPI/config.yaml\n/mnt/e/MyProjects/CLIProxyAPI/docker-build.ps1\n/mnt/e/MyProjects/CLIProxyAPI/docker-build.sh\n/mnt/e/MyProjects/CLIProxyAPI/docker-compose.yml\n/mnt/e/MyProjects/CLIProxyAPI/Dockerfile\n/mnt/e/MyProjects/CLIProxyAPI/go.mod\n/mnt/e/MyProjects/CLIProxyAPI/go.sum\n/mnt/e/MyProjects/CLIProxyAPI/LICENSE\n/mnt/e/MyProjects/CLIProxyAPI/README_CN.md\n/mnt/e/MyProjects/CLIProxyAPI/README.md\n","cache_control":{"type":"ephemeral"}}],"tools":[{"name":"Bash","description":"Executes the given shell command in the user's default shell.\n\n- Do NOT chain commands with `;` or `&&` or use `&` for background processes; make separate tool calls instead\n- Do NOT use interactive commands (REPLs, editors, password prompts)\n- Output is truncated to the last 50000 characters\n- Environment variables and `cd` do not persist between commands; use the `cwd` parameter instead\n- Only the last 50000 characters of the output will be returned to you along with how many lines got truncated, if any; rerun with a grep or head/tail filter if needed\n- On Windows, use PowerShell commands and `\\` path separators\n- ALWAYS quote file paths: `cat \"path with spaces/file.txt\"`\n- Use finder/Grep instead of find/grep, Read instead of cat, edit_file instead of sed\n- Only run `git commit` and `git push` if explicitly instructed by the user.\n","input_schema":{"type":"object","properties":{"cmd":{"type":"string","description":"The shell command to execute"},"cwd":{"type":"string","description":"Absolute path to a directory where the command will be executed (must be absolute, not relative)"}},"required":["cmd"]}},{"name":"create_file","description":"Create or overwrite a file in the workspace.\n\nUse this tool when you want to create a new file with the given content, or when you want to replace the contents of an existing file.\n\nPrefer this tool over `edit_file` when you want to ovewrite the entire contents of a file.\n","input_schema":{"type":"object","properties":{"path":{"type":"string","description":"The absolute path of the file to be created (must be absolute, not relative). If the file exists, it will be overwritten. ALWAYS generate this argument first."},"content":{"type":"string","description":"The content for the file."}},"required":["path","content"]}},{"name":"edit_file","description":"Make edits to a text file.\n\nReplaces `old_str` with `new_str` in the given file.\n\nReturns a git-style diff showing the changes made as formatted markdown, along with the line range ([startLine, endLine]) of the changed content. The diff is also shown to the user.\n\nThe file specified by `path` MUST exist, and it MUST be an absolute path. If you need to create a new file, use `create_file` instead.\n\n`old_str` MUST exist in the file. Use tools like `Read` to understand the files you are editing before changing them.\n\n`old_str` and `new_str` MUST be different from each other.\n\nSet `replace_all` to true to replace all occurrences of `old_str` in the file. Else, `old_str` MUST be unique within the file or the edit will fail. Additional lines of context can be added to make the string more unique.\n\nIf you need to replace the entire contents of a file, use `create_file` instead, since it requires less tokens for the same action (since you won't have to repeat the contents before replacing)\n","input_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"path":{"description":"The absolute path to the file (MUST be absolute, not relative). File must exist. ALWAYS generate this argument first.","type":"string"},"old_str":{"description":"Text to search for. Must match exactly.","type":"string"},"new_str":{"description":"Text to replace old_str with.","type":"string"},"replace_all":{"description":"Set to true to replace all matches of old_str. Else, old_str must be an unique match.","default":false,"type":"boolean"}},"required":["path","old_str","new_str"],"additionalProperties":false}},{"name":"finder","description":"Intelligently search your codebase: Use it for complex, multi-step search tasks where you need to find code based on functionality or concepts rather than exact matches. Anytime you want to chain multiple grep calls you should use this tool.\n\nWHEN TO USE THIS TOOL:\n- You must locate code by behavior or concept\n- You need to run multiple greps in sequence\n- You must correlate or look for connection between several areas of the codebase.\n- You must filter broad terms (\"config\", \"logger\", \"cache\") by context.\n- You need answers to questions such as \"Where do we validate JWT authentication headers?\" or \"Which module handles file-watcher retry logic\"\n\nWHEN NOT TO USE THIS TOOL:\n- When you know the exact file path - use Read directly\n- When looking for specific symbols or exact strings - use glob or Grep\n- When you need to create, modify files, or run terminal commands\n\nUSAGE GUIDELINES:\n1. Always spawn multiple search agents in parallel to maximise speed.\n2. Formulate your query as a precise engineering request.\n ✓ \"Find every place we build an HTTP error response.\"\n ✗ \"error handling search\"\n3. Name concrete artifacts, patterns, or APIs to narrow scope (e.g., \"Express middleware\", \"fs.watch debounce\").\n4. State explicit success criteria so the agent knows when to stop (e.g., \"Return file paths and line numbers for all JWT verification calls\").\n5. Never issue vague or exploratory commands - be definitive and goal-oriented.\n","input_schema":{"type":"object","properties":{"query":{"type":"string","description":"The search query describing to the agent what it should. Be specific and include technical terms, file types, or expected code patterns to help the agent find relevant code. Formulate the query in a way that makes it clear to the agent when it has found the right thing."}},"required":["query"]}},{"name":"glob","description":"Fast file pattern matching tool that works with any codebase size\n\nUse this tool to find files by name patterns across your codebase. It returns matching file paths sorted by most recent modification time first.\n\n## File pattern syntax\n\n- `**/*.js` - All JavaScript files in any directory\n- `src/**/*.ts` - All TypeScript files under the src directory (searches only in src)\n- `*.json` - All JSON files in the current directory\n- `**/*test*` - All files with \"test\" in their name\n- `web/src/**/*` - All files under the web/src directory\n- `**/*.{js,ts}` - All JavaScript and TypeScript files (alternative patterns)\n- `src/[a-z]*/*.ts` - TypeScript files in src subdirectories that start with lowercase letters\n\n# Examples\n\nFind all typescript files in the codebase\n```json\n{\"filePattern\":\"**/*.ts\"}\n```\n\nFind all test files under a specific directory\n```json\n{\"filePattern\":\"src/**/*test*.ts\"}\n```\n\nSearch for svelte component files in the web/src directory\n```json\n{\"filePattern\":\"web/src/**/*.svelte\"}\n```\n\nFind the 10 most recently modified JSON files\n```json\n{\"filePattern\":\"**/*.json\",\"limit\":10}\n```\n","input_schema":{"type":"object","properties":{"filePattern":{"type":"string","description":"Glob pattern like \"**/*.js\" or \"src/**/*.ts\" to match files"},"limit":{"type":"number","description":"Maximum number of results to return"},"offset":{"type":"number","description":"Number of results to skip (for pagination)"}},"required":["filePattern"],"additionalProperties":false}},{"name":"Grep","description":"Search for exact text patterns in files using ripgrep, a fast keyword search tool.\n\n# When to use this tool\n- Finding exact text matches (variable names, function calls, specific strings)\n- Use finder for semantic/conceptual searches\n\n# Strategy\n- Use 'path' or 'glob' to narrow searches; run multiple focused calls rather than one broad search\n- Uses Rust-style regex (escape `{` and `}`); use `literal: true` for literal text search\n\n# Constraints\n- Results are limited to 100 matches (up to 10 per file)\n- Lines are truncated at 200 characters\n\n# Examples\n\nFind a specific function name across the codebase\n```json\n{\"pattern\":\"registerTool\",\"path\":\"core/src\"}\n```\n\nSearch for interface definitions in a specific directory\n```json\n{\"pattern\":\"interface ToolDefinition\",\"path\":\"core/src/tools\"}\n```\n\nUse a case-sensitive search to find the exact string `ERROR:`\n```json\n{\"pattern\":\"ERROR:\",\"caseSensitive\":true}\n```\n\nFind TODO comments in frontend code\n```json\n{\"pattern\":\"TODO:\",\"path\":\"web/src\"}\n```\n\nFind a specific function name in test files\n```json\n{\"pattern\":\"restoreThreads\",\"glob\":\"**/*.test.ts\"}\n```\n\nFind all REST API endpoint definitions\n```json\n{\"pattern\":\"app\\\\.(get|post|put|delete)\\\\([\\\"']\",\"path\":\"server\"}\n```\n\nLocate CSS class definition in stylesheets\n```json\n{\"pattern\":\"\\\\.container\\\\s*\\\\{\",\"path\":\"web/src/styles\"}\n```\n\n# Complementary to finder\n- Use finder first to locate relevant code concepts\n- Then use Grep to find specific implementations or all occurrences\n- For complex tasks, iterate between both tools to refine your understanding\n","input_schema":{"type":"object","properties":{"pattern":{"type":"string","description":"The pattern to search for (regex)"},"path":{"type":"string","description":"The file or directory path to search in. Cannot be used with glob."},"glob":{"type":"string","description":"The glob pattern to search for. Cannot be used with path."},"caseSensitive":{"type":"boolean","description":"Whether to search case-sensitively"},"literal":{"type":"boolean","description":"Whether to treat the pattern as a literal string instead of a regex"}},"required":["pattern"]}},{"name":"Read","description":"Read a file or list a directory from the file system. If the path is a directory, it returns a line-numbered list of entries. If the file or directory doesn't exist, an error is returned.\n\n- The path parameter MUST be an absolute path.\n- By default, this tool returns the first 1000 lines. To read more, call it multiple times with different read_ranges.\n- Use the Grep tool to find specific content in large files or files with long lines.\n- If you are unsure of the correct file path, use the glob tool to look up filenames by glob pattern.\n- The contents are returned with each line prefixed by its line number. For example, if a file has contents \"abc\\\n\", you will receive \"1: abc\\\n\". For directories, entries are returned one per line (without line numbers) with a trailing \"/\" for subdirectories.\n- This tool can read images (such as PNG, JPEG, and GIF files) and present them to the model visually.\n- When possible, call this tool in parallel for all files you will want to read.","input_schema":{"type":"object","properties":{"path":{"type":"string","description":"The absolute path to the file or directory (MUST be absolute, not relative)."},"read_range":{"type":"array","items":{"type":"number"},"minItems":2,"maxItems":2,"description":"An array of two integers specifying the start and end line numbers to view. Line numbers are 1-indexed. If not provided, defaults to [1, 1000]. Examples: [500, 700], [700, 1400]"}},"required":["path"]}},{"name":"read_thread","description":"Read and extract relevant content from another Amp thread by its ID.\n\nThis tool fetches a thread (locally or from the server if synced), renders it as markdown, and uses AI to extract only the information relevant to your specific goal. This keeps context concise while preserving important details.\n\n## When to use this tool\n\n- When the user pastes or references an Amp thread URL (format: https://ampcode.com/threads/T-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) in their message\n- When the user references a thread ID (format: T-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx or @T-abc123)\n- When the user asks to \"apply the same approach from [thread URL]\"\n- When the user says \"do what we did in [thread URL]\"\n- When the user says \"implement the plan we devised in [thread URL]\"\n- When you need to extract specific information from a referenced thread\n\n## When NOT to use this tool\n\n- When no thread ID is mentioned\n- When working within the current thread (context is already available)\n\n## Parameters\n\n- **threadID**: The thread identifier in format T-{uuid} (e.g., \"T-a38f981d-52da-47b1-818c-fbaa9ab56e0c\")\n- **goal**: A clear description of what information you're looking for in that thread. Be specific about what you need to extract.\n\n# Examples\n\nUser asks \"Implement the plan we devised in https://ampcode.com/threads/T-3f1beb2b-bded-4fda-96cc-1af7192f24b6\"\n```json\n{\"threadID\":\"T-3f1beb2b-bded-4fda-96cc-1af7192f24b6\",\"goal\":\"Extract the implementation plan, design decisions, architecture approach, and any code patterns or examples discussed\"}\n```\n\nUser asks: \"Do what we did in https://ampcode.com/threads/T-f916b832-c070-4853-8ab3-5e7596953bec, but for the Kraken tool\"\n```json\n{\"threadID\":\"T-f916b832-c070-4853-8ab3-5e7596953bec\",\"goal\":\"Extract the implementation approach, code patterns, techniques used, and any relevant code examples that can be adapted for the Kraken tool\"}\n```\n\nUser asks: \"Take the SQL queries from https://ampcode.com/threads/T-95e73a95-f4fe-4f22-8d5c-6297467c97a5 and turn it into a reusable script\"\n```json\n{\"threadID\":\"T-95e73a95-f4fe-4f22-8d5c-6297467c97a5\",\"goal\":\"Extract all SQL queries, their purpose, parameters, and any context needed to understand how to make them reusable\"}\n```\n\nUser asks: \"Apply the same fix from @T-def456 to this issue\"\n```json\n{\"threadID\":\"T-def456\",\"goal\":\"Extract the bug description, root cause, the fix/solution, and relevant code changes\"}\n```\n","input_schema":{"type":"object","properties":{"threadID":{"type":"string","description":"The thread ID in format T-{uuid} (e.g., \"T-a38f981d-52da-47b1-818c-fbaa9ab56e0c\")"},"goal":{"type":"string","description":"A clear description of what information you need from the thread. Be specific about what to extract."}},"required":["threadID","goal"]}},{"name":"read_web_page","description":"Read the contents of a web page at a given URL.\n\nWhen only the url parameter is set, it returns the contents of the webpage converted to Markdown.\n\nWhen an objective is provided, it returns excerpts relevant to that objective.\n\nIf the user asks for the latest or recent contents, pass `forceRefetch: true` to ensure the latest content is fetched.\n\nDo NOT use for access to localhost or any other local or non-Internet-accessible URLs; use `curl` via the Bash instead.\n\n# Examples\n\nSummarize recent changes for a library. Force refresh because freshness is important.\n```json\n{\"url\":\"https://example.com/changelog\",\"objective\":\"Summarize the API changes in this software library.\",\"forceRefetch\":true}\n```\n\nExtract all text content from a web page\n```json\n{\"url\":\"https://example.com/docs/getting-started\"}\n```\n","input_schema":{"type":"object","properties":{"url":{"type":"string","description":"The URL of the web page to read"},"objective":{"type":"string","description":"A natural-language description of the research goal. If set, only relevant excerpts will be returned. If not set, the full content of the web page will be returned. "},"forceRefetch":{"type":"boolean","description":"Force a live fetch of the URL (default: use a cached version that may be a few days old)"}},"required":["url"]}},{"name":"skill","description":"Load a specialized skill that provides domain-specific instructions and workflows.\n\nWhen you recognize that a task matches one of the available skills listed below, use this tool to load the full skill instructions.\n\nThe skill will inject detailed instructions, workflows, and access to bundled resources (scripts, references, templates) into the conversation context.\n\nParameters:\n- name: The name of the skill to load (must match one of the skills listed below)\n\nExample: To use the web-browser skill for interacting with web pages, call this tool with name: \"web-browser\"\n\n# Available Skills\n\nNo skills available. Skills can be added to `.amp/skills/` in your workspace.","input_schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the skill to load"},"arguments":{"type":"string","description":"Optional arguments to pass to the skill"}},"required":["name"]}},{"name":"todo_read","description":"Read the current todo list for the session","input_schema":{"type":"object","properties":{},"required":[]}},{"name":"todo_write","description":"Update the todo list for the current session. To be used proactively and often to track progress and pending tasks.","input_schema":{"type":"object","properties":{"todos":{"type":"array","description":"The list of todo items. This replaces any existing todos.","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the todo item"},"content":{"type":"string","description":"The content/description of the todo item"},"status":{"type":"string","enum":["completed","in-progress","todo"],"description":"The current status of the todo item"}},"required":["id","content","status"]}}},"required":["todos"]}},{"name":"web_search","description":"Search the web for information relevant to a research objective.\n\nUse when you need up-to-date or precise documentation. Use `read_web_page` to fetch full content from a specific URL.\n\n# Examples\n\nGet API documentation for a specific provider\n```json\n{\"objective\":\"I want to know the request fields for the Stripe billing create customer API. Prefer Stripe's docs site.\"}\n```\n\nSee usage documentation for newly released library features\n```json\n{\"objective\":\"I want to know how to use SvelteKit remote functions, which is a new feature shipped in the last month.\",\"search_queries\":[\"sveltekit\",\"remote function\"]}\n```\n","input_schema":{"type":"object","properties":{"objective":{"type":"string","description":"A natural-language description of the broader task or research goal, including any source or freshness guidance"},"search_queries":{"type":"array","items":{"type":"string"},"description":"Optional keyword queries to ensure matches for specific terms are prioritized (recommended for best results)"},"max_results":{"type":"number","description":"The maximum number of results to return (default: 5)"}},"required":["objective"]}}],"stream":true,"thinking":{"type":"enabled","budget_tokens":4000}}


--【柒】--: hKFirEs:

Free 模式: 免费使用 Claude Haiku 4.5 模型,代价是包含广告(这可能是目前唯一带广告的 Agent 工具?)。

ampcode.com

Models

Amp uses the best model for each task: leading generalist foundation models for complex reasoning and planning, and smaller specialized models for fast, accurate responses in specific domains.


--【捌】--:

他的paid模型要花多少钱?


--【玖】--:

有详细配置么,这边试了下不行。
→ amp
Error: Unexpected error inside Amp CLI.


--【拾】--:

先赞后看


--【拾壹】--:

先赞后看


--【拾贰】--:

mark一下


--【拾叁】--:

先赞后看


--【拾肆】--:

这还真没关注过


--【拾伍】--:

好文章


--【拾陆】--:

谢谢佬,最近正在找 vscode上augment 的平替,感觉 amp 不错,现在还能接自己的 api ,超越了都 。先配置好试试看。


--【拾柒】--:

确实不错,更新了下教程,加了VSCode插件的配置方式


--【拾捌】--:

太强了,大佬


--【拾玖】--:

要的,免费是要看广告,只有Haiku,Smart模式下的Haiku不是免费的