add-command

Solid

Add support for a new CLI command. Use when implementing a handler or adding to SIMPLE_SAFE.

Data & Documents 236 stars 22 forks Updated today MIT

Install

View on GitHub

Quality Score: 88/100

Stars 20%
79
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

Add support for `$ARGUMENTS` in Dippy. ## 1. Research **tldr pages:** ``` ls ~/source/tldr/pages/*/$ARGUMENTS*.md cat ~/source/tldr/pages/*/$ARGUMENTS.md ``` **CLI docs:** ``` $ARGUMENTS --help man $ARGUMENTS ``` Note which operations are read-only vs mutations. ## 2. Decide: Handler or SIMPLE_SAFE? - **SIMPLE_SAFE**: Always safe regardless of arguments (read-only, no destructive flags). Go to step 3A. - **Handler**: Needs subcommand/flag analysis. Go to step 3B. ## 3A. SIMPLE_SAFE Path Add to `SIMPLE_SAFE` in `src/dippy/core/allowlists.py` and add tests to `tests/test_simple.py` in the appropriate category. Skip to step 5. ## 3B. Handler Path Create `tests/cli/test_$ARGUMENTS.py`: ```python """Test cases for $ARGUMENTS.""" import pytest from conftest import is_approved, needs_confirmation TESTS = [ # Safe operations ("$ARGUMENTS <safe-subcommand>", True), ("$ARGUMENTS --help", True), # Unsafe operations ("$ARGUMENTS <unsafe-subcommand>", False), ] @pytest.mark.parametrize("command,expected", TESTS) def test_command(check, command: str, expected: bool): result = check(command) if expected: assert is_approved(result), f"Expected approve: {command}" else: assert needs_confirmation(result), f"Expected confirm: {command}" ``` ## 4. Implement Handler Create `src/dippy/cli/$ARGUMENTS.py`: ```python """$ARGUMENTS handler for Dippy.""" from dippy.cli import Classification, HandlerContext COMMANDS = ["$ARGUMENTS"] SAF...

Details

Author
ldayton
Repository
ldayton/Dippy
Created
5 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category