Feature Description
Make the skillware CLI easy to run and easy to discover after pip install "skillware[cli]", on Windows and Unix, with or without Python on PATH.
A. Documentation, installation and PATH
Update docs/usage/cli.md (and README Quick Start if needed):
- After
pip install "skillware[cli]", the skillware command lives in Python's Scripts directory (e.g. %LOCALAPPDATA%\Programs\Python\Python313\Scripts\ on Windows).
- If
skillware is not recognized, add both Python3x\ and Python3x\Scripts\ to PATH, or use fallbacks (see B).
- Document Windows:
py -3.13 -m pip install "skillware[cli]", verify with where skillware.
- Document Unix:
python3 -m pip install "skillware[cli]", verify with which skillware.
- Clarify: core-only
pip install skillware does not install rich; CLI requires [cli] extra.
B. Run without PATH (industry standard)
Add skillware/__main__.py so this works everywhere Python can import the package:
python -m skillware
python -m skillware list
python -m skillware list --category compliance
python -m skillware --help
Delegate to skillware.cli:main. Matches common Python packaging (pytest, pip, black, etc.). Console script entry point in pyproject.toml stays as primary when Scripts is on PATH.
Optional: one-line hint on ImportError / first run if someone tries -m skillware before this lands (not required once __main__.py exists).
C. Unified help (fix menu item 4 + expand --help)
Bug: Interactive menu 4 / help calls parser.print_help() (stderr, minimal). Users expect the same content as docs.
Fix:
- Add
cmd_help(console) that prints rich, user-facing help to the same console as the menu (stdout via Rich).
- Wire menu
help and top-level skillware --help / -h to cmd_help (or shared helper), not raw argparse stderr only.
- Include in help output:
Keep skillware list --help for flag-level detail (argparse subparser help is fine there).
D. CLI robustness (small, same PR if trivial)
- Add
--version / -V at top level (print installed skillware version; useful for support).
- Ensure
cmd_interactive always receives help helper (no branch that prints "Run skillware --help" only).
- Tests in
tests/test_cli.py:
python -m skillware equivalent (import skillware.__main__ or run main with argv)
- Interactive
help / 4 prints expected sections (category example, issuer example)
--version output
- Update
docs/usage/cli.md menu table: help item behavior matches implementation.
Out of scope (existing or separate issues)
Rationale
Contributors and users hit friction right after install: skillware not found (Scripts not on PATH), python -m skillware failing, and help that only lists {list} while filters and examples live in docs only. Fixing discoverability and help in one pass reduces support burden and matches expectations set by tools like pip, pytest, and ollama-style CLIs (command on PATH + module fallback).
Implementation Idea
Files: skillware/__main__.py (new), skillware/cli.py, docs/usage/cli.md, README.md (Quick Start PATH note), tests/test_cli.py
-
skillware/__main__.py
from skillware.cli import main
if __name__ == "__main__":
main()
-
cmd_help(console) in cli.py
- Rich-formatted sections: Usage, Commands, Examples, Install, Docs link
- Reuse strings or a small constant block; avoid duplicating all of cli.md
-
main()
parser.add_argument("--version", "-V", action="version", version=...)
- On
-h / --help with no subcommand: call cmd_help(Console()) then return (do not enter interactive menu)
cmd_interactive(parser=parser) → pass help_fn=cmd_help instead of relying on parser.print_help()
-
Docs
- New subsection Running the CLI under Installation in cli.md: PATH, fallbacks, Windows
py launcher
-
Tests
test_main_module_invocation (subprocess or importlib)
test_cmd_help_includes_list_examples
test_interactive_help_dispatches_to_cmd_help
Acceptance Criteria
Affected Pages
skillware/__main__.py (new), skillware/cli.py, docs/usage/cli.md, README.md, tests/test_cli.py
Related
#81 (paths), #83 (test), #130 / #131 (polish done), #132 (version advisory, separate)
Feature Description
Make the
skillwareCLI easy to run and easy to discover afterpip install "skillware[cli]", on Windows and Unix, with or without Python on PATH.A. Documentation, installation and PATH
Update
docs/usage/cli.md(and README Quick Start if needed):pip install "skillware[cli]", theskillwarecommand lives in Python's Scripts directory (e.g.%LOCALAPPDATA%\Programs\Python\Python313\Scripts\on Windows).skillwareis not recognized, add bothPython3x\andPython3x\Scripts\to PATH, or use fallbacks (see B).py -3.13 -m pip install "skillware[cli]", verify withwhere skillware.python3 -m pip install "skillware[cli]", verify withwhich skillware.pip install skillwaredoes not installrich; CLI requires[cli]extra.B. Run without PATH (industry standard)
Add
skillware/__main__.pyso this works everywhere Python can import the package:Delegate to
skillware.cli:main. Matches common Python packaging (pytest, pip, black, etc.). Console script entry point inpyproject.tomlstays as primary when Scripts is on PATH.Optional: one-line hint on
ImportError/ first run if someone tries-m skillwarebefore this lands (not required once__main__.pyexists).C. Unified help (fix menu item 4 + expand
--help)Bug: Interactive menu 4 / help calls
parser.print_help()(stderr, minimal). Users expect the same content as docs.Fix:
cmd_help(console)that prints rich, user-facing help to the same console as the menu (stdout via Rich).helpand top-levelskillware --help/-htocmd_help(or shared helper), not raw argparse stderr only.list(available),paths/test(stubs → [Feat]: CLI commands to set and repair skill directory paths (sub-issue of #16) #81 / [Feat]: CLI command to run skill tests (sub-issue of #16) #83)skillware, menu keys,q/ Ctrl+Clistflags with examples:--category,--issuer,--skills-rootdocs/usage/cli.mdpip install "skillware[cli]"Keep
skillware list --helpfor flag-level detail (argparse subparser help is fine there).D. CLI robustness (small, same PR if trivial)
--version/-Vat top level (print installed skillware version; useful for support).cmd_interactivealways receives help helper (no branch that prints "Run skillware --help" only).tests/test_cli.py:python -m skillwareequivalent (importskillware.__main__or run main with argv)help/4prints expected sections (category example, issuer example)--versionoutputdocs/usage/cli.mdmenu table: help item behavior matches implementation.Out of scope (existing or separate issues)
paths([Feat]: CLI commands to set and repair skill directory paths (sub-issue of #16) #81),test([Feat]: CLI command to run skill tests (sub-issue of #16) #83),doctor,examples([Feat]: cli skillware examples command and list --examples coverage flag #126) — stubs stay; only document in help.__main__.py).Rationale
Contributors and users hit friction right after install:
skillwarenot found (Scripts not on PATH),python -m skillwarefailing, and help that only lists{list}while filters and examples live in docs only. Fixing discoverability and help in one pass reduces support burden and matches expectations set by tools likepip,pytest, andollama-style CLIs (command on PATH + module fallback).Implementation Idea
Files:
skillware/__main__.py(new),skillware/cli.py,docs/usage/cli.md,README.md(Quick Start PATH note),tests/test_cli.pyskillware/__main__.pycmd_help(console)incli.pymain()parser.add_argument("--version", "-V", action="version", version=...)-h/--helpwith no subcommand: callcmd_help(Console())then return (do not enter interactive menu)cmd_interactive(parser=parser)→ passhelp_fn=cmd_helpinstead of relying onparser.print_help()Docs
pylauncherTests
test_main_module_invocation(subprocess or importlib)test_cmd_help_includes_list_examplestest_interactive_help_dispatches_to_cmd_helpAcceptance Criteria
docs/usage/cli.mddocuments PATH (Python + Scripts),[cli]extra, and fallbacks (python -m skillware, full path toskillware.exe)python -m skillwareandpython -m skillware listwork when package is installedskillware --helpand interactive menu 4 / help show the same rich help (commands, flags, examples for category/issuer/root)skillware list --category/--issuer/--skills-rootstill work; examples appear in top-level help--versionprints installed versiontests/test_cli.pycovers__main__, help content, and interactive helppytest tests/test_cli.pyandflake8passAffected Pages
skillware/__main__.py(new),skillware/cli.py,docs/usage/cli.md,README.md,tests/test_cli.pyRelated
#81 (paths), #83 (test), #130 / #131 (polish done), #132 (version advisory, separate)