Skip to main content
argparse-scaffolder Generate argparse-based Python CLI applications with subparsers, type converters, and standard library patterns. Creates lightweight Python CLIs without external dependencies.
Jump to install Skills Marketplace Discover and explore AI skills built by the community.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Copy promptShow prompt details A direct command skips the review prompt. Inspect the source before running it.
npx skills add https://github.com/a5c-ai/babysitter --skill argparse-scaffolderThe command stays on one line. Scroll horizontally to inspect it before copying.
Prefer a local copy? Download the files currently available to SkillsMP.
Download Zip Downloading... name argparse-scaffolder description Generate argparse-based Python CLI applications with subparsers, type converters, and standard library patterns. Creates lightweight Python CLIs without external dependencies. allowed-tools Read, Write, Edit, Bash, Glob, Grep graph {"domains":["domain:software-engineering"],"specializations":["specialization:cli-mcp-development"],"skillAreas":["skill-area:cli-design","skill-area:cli-tooling","skill-area:command-line-interface-tools"],"roles":["role:backend-engineer","role:platform-engineer"],"workflows":["workflow:feature-development"],"topics":["topic:developer-experience"]}
Argparse Scaffolder
Generate a complete argparse CLI application with Python standard library, subparsers, and best practices.
Capabilities
Generate Python-based argparse CLI projects
Create subparser hierarchies for subcommands
Set up custom type converters and actions
Configure mutually exclusive groups
Implement parent parsers for shared arguments
Set up standard Python project structure
Usage
Invoke this skill when you need to:
Bootstrap a CLI using Python standard library only
Create a lightweight CLI without external dependencies
Set up subparsers for command hierarchies
Build CLIs that need to run on any Python installation
Inputs
Parameter Type Required Description
projectName string Yes Name of the CLI project (kebab-case) description string Yes Short description of the CLI commands array No List of commands to scaffold pythonVersion string No Python version requirement (default: ">=3.8") useSubparsers boolean No Use subparsers for commands (default: true)
Command Structure {
"commands" : [
{
"name" : "convert" ,
"description" : "Convert file formats" ,
"arguments" : [
{ "name" : "input" , "help" : "Input file path" } ,
{ "name" : "output" , "help" : "Output file path" , "nargs" : "?" }
] ,
"options" : [
{ "flags" : [ "-f" , "--format" ] , "choices" : [ "json" , "yaml" , "xml" ] } ,
{ "flags" : [ "-v" , "--verbose" ] , "action" : "store_true" }
]
}
]
}
Output Structure <projectName>/
โโโ pyproject.toml
โโโ README.md
โโโ .gitignore
โโโ src/
โ โโโ <package_name>/
โ โโโ __init__.py
โ โโโ __main__.py # Entry point
โ โโโ cli.py # Argparse setup
โ โโโ commands/
โ โ โโโ __init__.py
โ โ โโโ <command>.py # Command handlers
โ โโโ types/
โ โ โโโ __init__.py
โ โ โโโ converters.py # Custom type converters
โ โโโ utils/
โ โโโ __init__.py
โ โโโ helpers.py # Helper functions
โโโ tests/
โโโ __init__.py
โโโ test_<command>.py
Generated Code Patterns
Main CLI Entry (src//cli.py) import argparse
import sys
from typing import Optional , Sequence
from .commands import convert, validate
def create_parser () -> argparse.ArgumentParser:
"""Create the argument parser with all subcommands."""
parser = argparse.ArgumentParser(
prog='<projectName>' ,
description='<description>' ,
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog='''
Examples:
%(prog)s convert input.json output.yaml
%(prog)s validate config.yaml --strict
'''
)
parser.add_argument(
'-v' , '--verbose' ,
action='store_true' ,
help ='Enable verbose output'
)
parser.add_argument(
'--version' ,
action='version' ,
version='%(prog)s 1.0.0'
)
subparsers = parser.add_subparsers(
dest='command' ,
title='commands' ,
description='Available commands' ,
help ='Command to run'
)
convert.register_parser(subparsers)
validate.register_parser(subparsers)
return parser
def main (argv: Optional [Sequence [str ]] = None ) -> int :
"""Main entry point."""
parser = create_parser()
args = parser.parse_args(argv)
if args.command is None :
parser.print_help()
return 1
return args.func(args)
if __name__ == '__main__' :
sys.exit(main())
Command Template (src//commands/convert.py) import argparse
from pathlib import Path
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from argparse import _SubParsersAction
def register_parser (subparsers: '_SubParsersAction[argparse.ArgumentParser]' ) -> None :
"""Register the convert subparser."""
parser = subparsers.add_parser(
'convert' ,
help ='Convert file formats' ,
description='Convert files between different formats.' ,
formatter_class=argparse.RawDescriptionHelpFormatter,
)
parser.add_argument(
'input' ,
type =Path,
help ='Input file path'
)
parser.add_argument(
'output' ,
type =Path,
nargs='?' ,
help ='Output file path (default: stdout)'
)
parser.add_argument(
'-f' , '--format' ,
choices=['json' , 'yaml' , 'xml' ],
default='json' ,
help ='Output format (default: %(default)s)'
)
group = parser.add_mutually_exclusive_group()
group.add_argument('--compact' , action='store_true' , help ='Compact output' )
group.add_argument('--pretty' , action='store_true' , help ='Pretty print' )
parser.set_defaults(func=execute)
def execute (args: argparse.Namespace ) -> int :
"""Execute the convert command."""
print (f"Converting {args.input } to {args.format } " )
if args.output:
print (f"Output: {args.output} " )
return 0
Custom Type Converter import argparse
from pathlib import Path
def existing_file (value: str ) -> Path:
"""Type converter for existing file paths."""
path = Path(value)
if not path.exists():
raise argparse.ArgumentTypeError(f"File not found: {value} " )
if not path.is_file():
raise argparse.ArgumentTypeError(f"Not a file: {value} " )
return path
def port_number (value: str ) -> int :
"""Type converter for port numbers."""
try :
port = int (value)
except ValueError:
raise argparse.ArgumentTypeError(f"Invalid port number: {value} " )
if not 1 <= port <= 65535 :
raise argparse.ArgumentTypeError(f"Port must be 1-65535: {value} " )
return port
Dependencies [project]
name = "<projectName>"
version = "1.0.0"
requires-python = ">=3.8"
dependencies = []
[project.optional-dependencies]
dev = [
"pytest>=7.0.0" ,
"pytest-cov>=4.0.0" ,
"mypy>=1.0.0" ,
]
[project.scripts]
<projectName> = "<package_name>.cli:main"
Workflow
Validate inputs - Check project name, commands structure
Create directory structure - Set up Python project layout
Generate pyproject.toml - Configure project metadata
Create CLI entry point - Argparse setup with subparsers
Generate commands - Individual command handlers
Create type converters - Custom argument types
Set up tests - pytest test structure
Generate main .py - Package execution support
Best Practices Applied
Zero external dependencies for core CLI
Type hints throughout
Custom type converters for validation
Mutually exclusive argument groups
Parent parsers for shared arguments
Proper help text and examples
References
Target Processes
cli-application-bootstrap
argument-parser-setup
cli-command-structure-design
Related occupations SOC
Based on SOC occupation classification
More from this repository
Reference for querying the Atlas knowledge graph through its MCP tools โ the SECONDARY enrichment/comparison layer that adds best-practice context to systems you have ALREADY scanned from your real sources (`az`, repos, dirs). Use when you need to look up nodes, edges, kinds, clusters, stats, or wiki pages in Atlas to compare against your real inventory. (atlas graph, query atlas, atlas mcp, search the graph, graph neighbors, atlas record, atlas kinds, enrichment layer)
Atlas turns your STATED NEED into a real systems atlas by SCANNING your actual sources (Azure via `az`, git repos, local dirs) and process/data mining them, THEN enriching against the Atlas knowledge graph. Use this skill when asked to inventory/map your real systems, scan your cloud + repos + directories, mine the real processes or data they contain, or collect their real constraints/gotchas. (atlas, scan my systems, inventory our azure account, map my repos, real systems atlas, process mining, data mining, collect nuances, system discovery)
assimilate-popular-workflows This skill should be used when the user asks to "find skills in the wild", "assimilate popular workflows", "discover SKILL.md files in repos", "research external skills", "find workflow patterns", "survey the skill landscape", "what skills exist out there", or wants to investigate public repositories for extractable processes, babysitter plugins, and reusable procedural insights. Searches GitHub for SKILL.md files, classifies repos by archetype, and maintains structured research under docs/reference-repos/.