Skip to content

Commit 86d72c2

Browse files
committed
[CLI] Remove deprecated --claude option in 2.x
1 parent 5214cb1 commit 86d72c2

3 files changed

Lines changed: 6 additions & 20 deletions

File tree

‎docs/source/en/package_reference/cli.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4308,7 +4308,6 @@ $ hf skills add [OPTIONS] [NAME]
43084308

43094309
**Options**:
43104310

4311-
* `--claude`: (Deprecated) No longer needed: skills are always installed for Claude Code too.
43124311
* `-g, --global`: Install globally (user-level) instead of in the current project directory.
43134312
* `--dest PATH`: Install into a custom destination (path to skills directory).
43144313
* `--force`: Overwrite existing skills in the destination.
@@ -4379,7 +4378,6 @@ $ hf skills update [OPTIONS] [NAME]
43794378

43804379
**Options**:
43814380

4382-
* `--claude`: (Deprecated) No longer needed: skills are always installed for Claude Code too.
43834381
* `-g, --global`: Use global skills directories instead of the current project.
43844382
* `--dest PATH`: Update skills in a custom skills directory.
43854383
* `--help`: Show this message and exit.

‎src/huggingface_hub/cli/skills.py‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -330,12 +330,6 @@ def _install_to(skills_dir: Path, skill_name: str, force: bool) -> Path:
330330
raise CLIError(f"{exc}\nRe-run with --force to overwrite.") from exc
331331

332332

333-
_CLAUDE_FLAG_DEPRECATED = (
334-
"`--claude` is deprecated and will be removed in a future release:"
335-
" skills are always installed for Claude Code too."
336-
)
337-
338-
339333
def _create_symlink(agent_skills_dir: Path, skill_name: str, central_skill_path: Path, force: bool) -> Path:
340334
"""Create a relative symlink from agent directory to the central skill location."""
341335
agent_skills_dir = agent_skills_dir.expanduser().resolve()
@@ -429,10 +423,6 @@ def skills_add(
429423
str,
430424
Argument(help="Marketplace skill name.", show_default=False),
431425
] = DEFAULT_SKILL_ID,
432-
claude: Annotated[
433-
bool,
434-
Option("--claude", help="(Deprecated) No longer needed: skills are always installed for Claude Code too."),
435-
] = False,
436426
global_: Annotated[
437427
bool,
438428
Option(
@@ -463,8 +453,6 @@ def skills_add(
463453
The skill is also symlinked into Claude Code's skills directory (`.claude/skills` or `~/.claude/skills`,
464454
honoring `CLAUDE_CONFIG_DIR` when set), unless `--dest` is used.
465455
"""
466-
if claude:
467-
out.warning(_CLAUDE_FLAG_DEPRECATED)
468456
if dest is not None:
469457
if global_:
470458
raise CLIError("--dest cannot be combined with --global.")
@@ -496,10 +484,6 @@ def skills_update(
496484
str | None,
497485
Argument(help="Optional installed skill name to update.", show_default=False),
498486
] = None,
499-
claude: Annotated[
500-
bool,
501-
Option("--claude", help="(Deprecated) No longer needed: skills are always installed for Claude Code too."),
502-
] = False,
503487
global_: Annotated[
504488
bool,
505489
Option(
@@ -516,8 +500,6 @@ def skills_update(
516500
] = None,
517501
) -> None:
518502
"""Update installed Hugging Face marketplace skills."""
519-
if claude:
520-
out.warning(_CLAUDE_FLAG_DEPRECATED)
521503
roots = _resolve_update_roots(global_=global_, dest=dest)
522504

523505
results = _skills.update_skills(roots, selector=name, hf_cli_content=build_skill_md())

‎tests/test_cli.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5297,6 +5297,12 @@ def test_collect_leaf_commands_finds_deeply_nested(self) -> None:
52975297

52985298

52995299
class TestSkillsHfCliCLI:
5300+
@pytest.mark.parametrize("command", ["add", "update"])
5301+
def test_claude_option_is_removed(self, runner: CliRunner, command: str) -> None:
5302+
result = runner.invoke(app, ["skills", command, "--claude"])
5303+
assert result.exit_code != 0
5304+
assert "No such option '--claude'" in result.output
5305+
53005306
def test_add_and_update_generate_skill_locally(self, runner: CliRunner, tmp_path: Path) -> None:
53015307
"""The default `hf-cli` skill is generated locally from the installed CLI (no marketplace download)."""
53025308
dest = tmp_path / "managed-skills"

0 commit comments

Comments
 (0)