MCPcopy
hub / github.com/agentskills/agentskills / read_properties_cmd

Function read_properties_cmd

skills-ref/src/skills_ref/cli.py:55–73  ·  view source on GitHub ↗

Read and print skill properties as JSON. Parses the YAML frontmatter from SKILL.md and outputs the properties as JSON. Exit codes: 0: Success 1: Parse error

(skill_path: Path)

Source from the content-addressed store, hash-verified

53@main.command("read-properties")
54@click.argument("skill_path", type=click.Path(exists=True, path_type=Path))
55def read_properties_cmd(skill_path: Path):
56 """Read and print skill properties as JSON.
57
58 Parses the YAML frontmatter from SKILL.md and outputs the
59 properties as JSON.
60
61 Exit codes:
62 0: Success
63 1: Parse error
64 """
65 try:
66 if _is_skill_md_file(skill_path):
67 skill_path = skill_path.parent
68
69 props = read_properties(skill_path)
70 click.echo(json.dumps(props.to_dict(), indent=2))
71 except SkillError as e:
72 click.echo(f"Error: {e}", err=True)
73 sys.exit(1)
74
75
76@main.command("to-prompt")

Callers

nothing calls this directly

Calls 3

_is_skill_md_fileFunction · 0.85
read_propertiesFunction · 0.85
to_dictMethod · 0.80

Tested by

no test coverage detected