Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions docs/source/en/package_reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -3363,7 +3363,7 @@ $ hf skills [OPTIONS] COMMAND [ARGS]...

* `add`: Download a Hugging Face skill and install...
* `preview`: Print the generated `hf-cli` SKILL.md to...
* `upgrade`: Upgrade installed Hugging Face marketplace...
* `update`: Update installed Hugging Face marketplace...

### `hf skills add`

Expand Down Expand Up @@ -3416,32 +3416,32 @@ $ hf skills preview [OPTIONS]

* `--help`: Show this message and exit.

### `hf skills upgrade`
### `hf skills update`

Upgrade installed Hugging Face marketplace skills.
Update installed Hugging Face marketplace skills.

**Usage**:

```console
$ hf skills upgrade [OPTIONS] [NAME]
$ hf skills update [OPTIONS] [NAME]
```

**Arguments**:

* `[NAME]`: Optional installed skill name to upgrade.
* `[NAME]`: Optional installed skill name to update.

**Options**:

* `--claude`: Upgrade skills installed for Claude.
* `--claude`: Update skills installed for Claude.
* `-g, --global`: Use global skills directories instead of the current project.
* `--dest PATH`: Upgrade skills in a custom skills directory.
* `--dest PATH`: Update skills in a custom skills directory.
* `--help`: Show this message and exit.

Examples
$ hf skills upgrade
$ hf skills upgrade hf-cli
$ hf skills upgrade huggingface-gradio --dest=~/my-skills
$ hf skills upgrade --claude
$ hf skills update
$ hf skills update hf-cli
$ hf skills update huggingface-gradio --dest=~/my-skills
$ hf skills update --claude

Learn more
Use `hf <command> --help` for more information about a command.
Expand Down
20 changes: 10 additions & 10 deletions src/huggingface_hub/cli/skills.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,20 +430,20 @@ def skills_add(


@skills_cli.command(
"upgrade",
"update",
examples=[
"hf skills upgrade",
"hf skills upgrade hf-cli",
"hf skills upgrade huggingface-gradio --dest=~/my-skills",
"hf skills upgrade --claude",
"hf skills update",
"hf skills update hf-cli",
"hf skills update huggingface-gradio --dest=~/my-skills",
"hf skills update --claude",
],
)
def skills_upgrade(
def skills_update(
name: Annotated[
str | None,
typer.Argument(help="Optional installed skill name to upgrade.", show_default=False),
typer.Argument(help="Optional installed skill name to update.", show_default=False),
] = None,
claude: Annotated[bool, typer.Option("--claude", help="Upgrade skills installed for Claude.")] = False,
claude: Annotated[bool, typer.Option("--claude", help="Update skills installed for Claude.")] = False,
global_: Annotated[
bool,
typer.Option(
Expand All @@ -455,11 +455,11 @@ def skills_upgrade(
dest: Annotated[
Path | None,
typer.Option(
help="Upgrade skills in a custom skills directory.",
help="Update skills in a custom skills directory.",
),
] = None,
) -> None:
"""Upgrade installed Hugging Face marketplace skills."""
"""Update installed Hugging Face marketplace skills."""
roots = _resolve_update_roots(claude=claude, global_=global_, dest=dest)

results = _skills.apply_updates(roots, selector=name)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3838,18 +3838,18 @@ def test_add_installs_marketplace_skill_to_dest(self, runner: CliRunner, tmp_pat
assert skill_dir.joinpath("SKILL.md").is_file()
assert skill_dir.joinpath(".hf-skill-manifest.json").is_file()

def test_upgrade_checks_remote_revision_for_installed_skill(self, runner: CliRunner, tmp_path: Path) -> None:
def test_update_checks_remote_revision_for_installed_skill(self, runner: CliRunner, tmp_path: Path) -> None:
dest = tmp_path / "managed-skills"
add_result = runner.invoke(app, ["skills", "add", "huggingface-gradio", "--dest", str(dest)])
assert add_result.exit_code == 0, add_result.output

result = runner.invoke(app, ["skills", "upgrade", "--dest", str(dest)])
result = runner.invoke(app, ["skills", "update", "--dest", str(dest)])

assert result.exit_code == 0, result.output
skill_dir = dest / "huggingface-gradio"
assert skill_dir.joinpath("SKILL.md").is_file()
assert skill_dir.joinpath(".hf-skill-manifest.json").is_file()
# Live marketplace content can change between the add and upgrade calls.
# Live marketplace content can change between the add and update calls.
assert any(
status in result.stdout
for status in (
Expand Down
Loading