Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /zloeber_SecretZero /src /secretzero /cli_skills.py
| """CLI commands for bundled SecretZero skill management.""" | |
| from __future__ import annotations | |
| import click | |
| from rich.console import Console | |
| from secretzero.skills import ( | |
| SUPPORTED_TARGETS, | |
| install_skills_for_targets, | |
| list_bundled_skills, | |
| resolve_skill_names, | |
| resolve_targets, | |
| skill_markdown, | |
| ) | |
| console = Console() | |
| def skills_group(ctx: click.Context) -> None: | |
| """Install and inspect bundled SecretZero agent skills.""" | |
| if ctx.invoked_subcommand is None: | |
| click.echo(ctx.get_help()) | |
| def skills_list() -> None: | |
| """List bundled skills available for install.""" | |
| bundled = list_bundled_skills() | |
| if not bundled: | |
| console.print("[yellow]No bundled skills found in package data.[/yellow]") | |
| return | |
| console.print("[bold]Bundled skills:[/bold]") | |
| for skill_name in bundled: | |
| console.print(f"- {skill_name}") | |
| def skills_show(skill_name: str | None) -> None: | |
| """Show a bundled skill document.""" | |
| if not skill_name: | |
| skill_names = list_bundled_skills() | |
| if not skill_names: | |
| console.print("[yellow]No bundled skills found in package data.[/yellow]") | |
| return | |
| console.print("[bold]Available skills:[/bold]") | |
| for item in skill_names: | |
| console.print(f"- {item}") | |
| console.print("[dim]Use `secretzero skills show <name>` to print SKILL.md content.[/dim]") | |
| return | |
| content = skill_markdown(skill_name) | |
| if not content: | |
| console.print(f"[red]Skill '{skill_name}' not found.[/red]") | |
| raise click.Abort() | |
| console.print(content) | |
| def skills_install( | |
| scope: str, | |
| targets: tuple[str, ...], | |
| disable_targets: tuple[str, ...], | |
| skills: tuple[str, ...], | |
| dry_run: bool, | |
| ) -> None: | |
| """Install bundled skills into supported agent targets.""" | |
| selected_targets = resolve_targets( | |
| mode="skills", | |
| scope=scope, # type: ignore[arg-type] | |
| enable_targets=list(targets), | |
| disable_targets=list(disable_targets), | |
| ) | |
| if not selected_targets: | |
| console.print( | |
| "[yellow]No targets selected. Use --target to choose targets explicitly.[/yellow]" | |
| ) | |
| return | |
| try: | |
| selected_skills = resolve_skill_names(list(skills) if skills else None) | |
| except ValueError as exc: | |
| console.print(f"[red]{exc}[/red]") | |
| raise click.Abort() from exc | |
| results = install_skills_for_targets( | |
| targets=selected_targets, | |
| scope=scope, # type: ignore[arg-type] | |
| skill_names=selected_skills if skills else None, | |
| dry_run=dry_run, | |
| ) | |
| for result in results: | |
| line = f"[{result.target}] {result.details} -> {result.path}" | |
| if result.dry_run: | |
| console.print(f"[dim](dry run)[/dim] {line}") | |
| elif result.applied: | |
| console.print(f"[green]{line}[/green]") | |
| else: | |
| console.print(f"[yellow]{line}[/yellow]") | |
Xet Storage Details
- Size:
- 4 kB
- Xet hash:
- 5189096c8a1ff90d05559b1b21f6ab7551fb03deab62d8590f8b50679c8bdb5b
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.