claude-ai-models 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,85 @@
1
+ # claude-ai-models
2
+
3
+ A [Claude Code](https://claude.com/claude-code) skill that fetches the latest AI model IDs from **Anthropic**, **OpenAI**, and **Google** — so Claude always uses up-to-date model names in your code.
4
+
5
+ **No API keys needed.** The skill scrapes public sources to get the latest model lists.
6
+
7
+ ## Why?
8
+
9
+ Claude's training data has a knowledge cutoff. When you ask it to write code calling AI APIs, it often uses outdated model IDs (e.g., `gpt-4-turbo` when `gpt-5.2` already exists). This skill fixes that by fetching the real, current model list before writing any code.
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ npx claude-ai-models
15
+ ```
16
+
17
+ That's it. The skill is now active in Claude Code.
18
+
19
+ ## How it works
20
+
21
+ When Claude writes code that calls an AI API, it automatically runs a bash script that:
22
+
23
+ 1. **Anthropic** — Scrapes the [official docs page](https://docs.anthropic.com/en/docs/about-claude/models) for `claude-*` model IDs
24
+ 2. **OpenAI** — Fetches the [SDK source file](https://github.com/openai/openai-python/blob/main/src/openai/types/shared/chat_model.py) on GitHub (auto-generated from their OpenAPI spec — the true source of truth)
25
+ 3. **Google** — Scrapes the [Gemini docs page](https://ai.google.dev/gemini-api/docs/models) for `gemini-*` model IDs
26
+
27
+ The script does all the heavy lifting (curl + grep/sort), so Claude only receives a clean list of model IDs — minimal token usage.
28
+
29
+ ## Commands
30
+
31
+ ```bash
32
+ npx claude-ai-models install # Install (default)
33
+ npx claude-ai-models uninstall # Remove the skill
34
+ npx claude-ai-models test # Fetch models to verify it works
35
+ npx claude-ai-models help # Show help
36
+ ```
37
+
38
+ ## Manual usage
39
+
40
+ You can also run the fetch script directly:
41
+
42
+ ```bash
43
+ bash ~/.claude/skills/ai-models/fetch-models.sh # All providers
44
+ bash ~/.claude/skills/ai-models/fetch-models.sh --anthropic # Anthropic only
45
+ bash ~/.claude/skills/ai-models/fetch-models.sh --openai # OpenAI only
46
+ bash ~/.claude/skills/ai-models/fetch-models.sh --google # Google only
47
+ ```
48
+
49
+ ## Example output
50
+
51
+ ```
52
+ === LATEST AI MODELS (2026-02-08) ===
53
+
54
+ ## ANTHROPIC (Claude)
55
+
56
+ claude-opus-4-6
57
+ claude-sonnet-4-5
58
+ claude-haiku-4-5
59
+ ...
60
+
61
+ ## OPENAI
62
+
63
+ gpt-5.2
64
+ gpt-5.1
65
+ gpt-4o
66
+ o4-mini
67
+ o3
68
+ ...
69
+
70
+ ## GOOGLE (Gemini)
71
+
72
+ gemini-3-pro
73
+ gemini-2.5-pro
74
+ gemini-2.5-flash
75
+ ...
76
+ ```
77
+
78
+ ## Requirements
79
+
80
+ - `jq` — Install with `brew install jq` (macOS) or `apt install jq` (Linux)
81
+ - `curl` — Usually pre-installed
82
+
83
+ ## License
84
+
85
+ MIT
package/bin/cli.js ADDED
@@ -0,0 +1,108 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require("fs");
4
+ const path = require("path");
5
+ const os = require("os");
6
+ const { execSync } = require("child_process");
7
+
8
+ const SKILL_NAME = "ai-models";
9
+ const SKILL_DIR = path.join(os.homedir(), ".claude", "skills", SKILL_NAME);
10
+ const SOURCE_DIR = path.join(__dirname, "..", "skill");
11
+
12
+ const args = process.argv.slice(2);
13
+ const command = args[0] || "install";
14
+
15
+ function install() {
16
+ console.log("Installing claude-ai-models skill...\n");
17
+
18
+ // Ensure ~/.claude/skills/ exists
19
+ const skillsRoot = path.join(os.homedir(), ".claude", "skills");
20
+ fs.mkdirSync(skillsRoot, { recursive: true });
21
+
22
+ // Create skill directory
23
+ fs.mkdirSync(SKILL_DIR, { recursive: true });
24
+
25
+ // Copy skill files
26
+ const files = fs.readdirSync(SOURCE_DIR);
27
+ for (const file of files) {
28
+ const src = path.join(SOURCE_DIR, file);
29
+ const dest = path.join(SKILL_DIR, file);
30
+ fs.copyFileSync(src, dest);
31
+ console.log(` Copied ${file}`);
32
+ }
33
+
34
+ // Make fetch script executable
35
+ const scriptPath = path.join(SKILL_DIR, "fetch-models.sh");
36
+ if (fs.existsSync(scriptPath)) {
37
+ fs.chmodSync(scriptPath, 0o755);
38
+ }
39
+
40
+ console.log(`\nInstalled to ${SKILL_DIR}`);
41
+ console.log("\nThe skill is now available in Claude Code.");
42
+ console.log("It will automatically fetch latest model IDs when you write AI API code.");
43
+ console.log("\nYou can also run it manually:");
44
+ console.log(` bash ${scriptPath}`);
45
+ console.log(` bash ${scriptPath} --anthropic`);
46
+ console.log(` bash ${scriptPath} --openai`);
47
+ console.log(` bash ${scriptPath} --google`);
48
+ }
49
+
50
+ function uninstall() {
51
+ console.log("Uninstalling claude-ai-models skill...\n");
52
+
53
+ if (fs.existsSync(SKILL_DIR)) {
54
+ fs.rmSync(SKILL_DIR, { recursive: true });
55
+ console.log(`Removed ${SKILL_DIR}`);
56
+ console.log("\nSkill uninstalled successfully.");
57
+ } else {
58
+ console.log("Skill not found — nothing to remove.");
59
+ }
60
+ }
61
+
62
+ function test() {
63
+ console.log("Testing ai-models skill...\n");
64
+
65
+ const scriptPath = path.join(SKILL_DIR, "fetch-models.sh");
66
+ if (!fs.existsSync(scriptPath)) {
67
+ console.error("Skill not installed. Run: npx claude-ai-models install");
68
+ process.exit(1);
69
+ }
70
+
71
+ try {
72
+ const output = execSync(`bash "${scriptPath}"`, {
73
+ encoding: "utf-8",
74
+ timeout: 60000,
75
+ });
76
+ console.log(output);
77
+ } catch (err) {
78
+ console.error("Script failed:", err.message);
79
+ process.exit(1);
80
+ }
81
+ }
82
+
83
+ switch (command) {
84
+ case "install":
85
+ install();
86
+ break;
87
+ case "uninstall":
88
+ uninstall();
89
+ break;
90
+ case "test":
91
+ test();
92
+ break;
93
+ case "help":
94
+ case "--help":
95
+ case "-h":
96
+ console.log("claude-ai-models — Claude Code skill for fetching latest AI model IDs\n");
97
+ console.log("Usage: npx claude-ai-models [command]\n");
98
+ console.log("Commands:");
99
+ console.log(" install Install the skill to ~/.claude/skills/ (default)");
100
+ console.log(" uninstall Remove the skill");
101
+ console.log(" test Run the fetch script to verify it works");
102
+ console.log(" help Show this help message");
103
+ break;
104
+ default:
105
+ console.error(`Unknown command: ${command}`);
106
+ console.error("Run: npx claude-ai-models help");
107
+ process.exit(1);
108
+ }
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "claude-ai-models",
3
+ "version": "1.0.0",
4
+ "description": "Claude Code skill that fetches latest AI model IDs from Anthropic, OpenAI, and Google — no API keys needed",
5
+ "bin": {
6
+ "claude-ai-models": "bin/cli.js"
7
+ },
8
+ "keywords": [
9
+ "claude",
10
+ "claude-code",
11
+ "skill",
12
+ "ai-models",
13
+ "anthropic",
14
+ "openai",
15
+ "google",
16
+ "gemini",
17
+ "gpt",
18
+ "llm"
19
+ ],
20
+ "author": "Tontoon7",
21
+ "license": "MIT",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "https://github.com/Tontoon7/claude-ai-models"
25
+ },
26
+ "files": [
27
+ "bin/",
28
+ "skill/"
29
+ ]
30
+ }
package/skill/SKILL.md ADDED
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: ai-models
3
+ description: Fetch latest AI model IDs from Anthropic, OpenAI, and Google APIs to use accurate model names in code
4
+ metadata:
5
+ tags: ai, models, api, anthropic, openai, google, claude, gpt, gemini
6
+ invocation:
7
+ user_invocable: true
8
+ ---
9
+
10
+ ## When to use
11
+
12
+ Use this skill **automatically** whenever you write code that calls AI APIs and need to specify a model ID.
13
+
14
+ **Triggers:**
15
+ - Writing API calls to Anthropic, OpenAI, or Google AI
16
+ - Setting `model` parameters in any AI SDK (Vercel AI SDK, LangChain, etc.)
17
+ - User asks about latest available models
18
+ - Any code involving `model:` or `model=` for AI providers
19
+
20
+ ## How to use
21
+
22
+ Run the fetch script — it scrapes public sources, no API keys needed:
23
+
24
+ ```bash
25
+ bash ~/.claude/skills/ai-models/fetch-models.sh
26
+ ```
27
+
28
+ Options:
29
+ - `--all` (default): All providers
30
+ - `--anthropic`: Anthropic only
31
+ - `--openai`: OpenAI only
32
+ - `--google`: Google Gemini only
33
+
34
+ **Sources:**
35
+ - Anthropic: official docs page (docs.anthropic.com)
36
+ - OpenAI: SDK source of truth on GitHub (auto-generated from OpenAPI spec)
37
+ - Google: official Gemini docs (ai.google.dev)
38
+
39
+ ## Rules
40
+
41
+ 1. **Always run the script** before using any model ID in code — never guess or use memorized IDs
42
+ 2. **Use the exact model ID** from the script output
43
+ 3. **Pick the right tier** for the use case:
44
+ - **Flagship** (Opus / GPT-4o / Gemini Pro): Complex reasoning, high quality
45
+ - **Balanced** (Sonnet / GPT-4o-mini / Gemini Flash): Best speed/quality ratio, default choice
46
+ - **Fast** (Haiku / GPT-3.5 / Gemini Flash Lite): Speed-first, simple tasks, cost-effective
47
+ 4. **Prefer aliases** (e.g. `claude-sonnet-4-5`) over dated versions unless pinning is needed
@@ -0,0 +1,116 @@
1
+ #!/usr/bin/env bash
2
+ # Fetch latest AI model IDs from public sources (no API keys needed)
3
+ # Usage: ./fetch-models.sh [--anthropic|--openai|--google|--all]
4
+
5
+ set -uo pipefail
6
+
7
+ ANTHROPIC_URL="https://docs.anthropic.com/en/docs/about-claude/models"
8
+ OPENAI_URL="https://raw.githubusercontent.com/openai/openai-python/main/src/openai/types/shared/chat_model.py"
9
+ GOOGLE_URL="https://ai.google.dev/gemini-api/docs/models"
10
+
11
+ fetch_anthropic() {
12
+ echo "## ANTHROPIC (Claude)"
13
+ echo ""
14
+
15
+ local html
16
+ html=$(curl -sL --max-time 20 "$ANTHROPIC_URL" 2>/dev/null) || html=""
17
+
18
+ if [ -z "$html" ]; then
19
+ echo " ERROR: Could not fetch $ANTHROPIC_URL"
20
+ return
21
+ fi
22
+
23
+ local models
24
+ models=$(echo "$html" \
25
+ | grep -oE 'claude-(opus|sonnet|haiku)-[a-z0-9._-]+' \
26
+ | sort -t'-' -k2,2 -k3,3rn -k4,4rn \
27
+ | uniq \
28
+ | head -30 2>/dev/null) || models=""
29
+
30
+ if [ -n "$models" ]; then
31
+ echo "$models" | while read -r model; do echo " $model"; done
32
+ else
33
+ echo " No models found. Page structure may have changed."
34
+ fi
35
+ echo ""
36
+ }
37
+
38
+ fetch_openai() {
39
+ echo "## OPENAI"
40
+ echo ""
41
+
42
+ local content
43
+ content=$(curl -sL --max-time 20 "$OPENAI_URL" 2>/dev/null) || content=""
44
+
45
+ if [ -z "$content" ]; then
46
+ echo " ERROR: Could not fetch $OPENAI_URL"
47
+ return
48
+ fi
49
+
50
+ local models
51
+ models=$(echo "$content" \
52
+ | grep -oE '"(gpt-[0-9][a-z0-9._-]*|o[0-9][-a-z0-9]*|chatgpt-[a-z0-9-]+|codex-[a-z0-9-]+)"' \
53
+ | tr -d '"' \
54
+ | sort -t'-' -k1,1 -k2,2rn \
55
+ | uniq \
56
+ | head -40 2>/dev/null) || models=""
57
+
58
+ if [ -n "$models" ]; then
59
+ echo "$models" | while read -r model; do echo " $model"; done
60
+ else
61
+ echo " No models found. Source file may have changed."
62
+ fi
63
+ echo ""
64
+ }
65
+
66
+ fetch_google() {
67
+ echo "## GOOGLE (Gemini)"
68
+ echo ""
69
+
70
+ local html
71
+ html=$(curl -sL --max-time 20 "$GOOGLE_URL" 2>/dev/null) || html=""
72
+
73
+ if [ -z "$html" ]; then
74
+ echo " ERROR: Could not fetch $GOOGLE_URL"
75
+ return
76
+ fi
77
+
78
+ local models
79
+ models=$(echo "$html" \
80
+ | grep -oE 'gemini-[0-9][a-z0-9._-]*' \
81
+ | grep -v '_[0-9]$' \
82
+ | sort -t'-' -k2,2rn -k3,3r \
83
+ | uniq \
84
+ | head -30 2>/dev/null) || models=""
85
+
86
+ if [ -n "$models" ]; then
87
+ echo "$models" | while read -r model; do echo " $model"; done
88
+ else
89
+ echo " No models found. Page structure may have changed."
90
+ fi
91
+ echo ""
92
+ }
93
+
94
+ # Main
95
+ PROVIDER="${1:---all}"
96
+
97
+ echo "=== LATEST AI MODELS ($(date +%Y-%m-%d)) ==="
98
+ echo ""
99
+
100
+ case "$PROVIDER" in
101
+ --anthropic) fetch_anthropic ;;
102
+ --openai) fetch_openai ;;
103
+ --google) fetch_google ;;
104
+ --all)
105
+ fetch_anthropic
106
+ fetch_openai
107
+ fetch_google
108
+ ;;
109
+ *)
110
+ echo "Usage: $0 [--anthropic|--openai|--google|--all]"
111
+ exit 1
112
+ ;;
113
+ esac
114
+
115
+ echo "---"
116
+ echo "Use the model IDs above in your API calls."