Overview
Add scm local command group for listing device configuration versions and downloading config files as XML. Wraps the new client.local_config service from SDK 0.13.0.
Context
SDK 0.13.0 adds client.local_config with:
- List versions: Get configuration version history for a device
- Download config: Download a specific config version as raw XML (uses
raw_response for binary download)
- Pydantic models for local config version data
Dependencies
Design Decisions (from brainstorming session 2026-04-16)
- Top-level command group:
scm local list and scm local download (not nested under existing groups)
- Download output: Default to stdout,
--output <path> writes to file
- Follows existing CLI patterns: Typer app,
@handle_command_errors, consistent option naming
Scope
- In scope:
- New command module:
src/scm_cli/commands/local.py
- Subcommands:
scm local list --device <name> and scm local download --device <name> --version <id> [--output config.xml]
- SDK client methods in
sdk_client.py: list_local_config_versions(), download_local_config()
- Validator models in
validators.py (if needed for input validation)
- Mock mode support with realistic sample data
- Register in
main.py as top-level command group
- Tests:
tests/test_local_commands.py
- Documentation:
docs/cli/local/ pages
- Update
mkdocs.yml nav
- Out of scope:
- Device operations commands (see separate issue)
- Config diff/comparison features (future enhancement)
CLI Interface
# List config versions for a device
scm local list --device fw-01
# Download a specific version to stdout
scm local download --device fw-01 --version 42
# Download to a file
scm local download --device fw-01 --version 42 --output fw-01-v42.xml
# Mock mode
scm local list --device fw-01 --mock
Acceptance Criteria
Implementation Notes
- Download uses
raw_response=True in Scm.request() — the response body is raw XML bytes
- For stdout output, decode XML as UTF-8; for file output, write binary
- Table columns for list: version number, date, author/source, description (based on SDK model fields)
- Follow
commands/jobs.py as a pattern reference — similar "list + show detail" structure
Overview
Add
scm localcommand group for listing device configuration versions and downloading config files as XML. Wraps the newclient.local_configservice from SDK 0.13.0.Context
SDK 0.13.0 adds
client.local_configwith:raw_responsefor binary download)Dependencies
Design Decisions (from brainstorming session 2026-04-16)
scm local listandscm local download(not nested under existing groups)--output <path>writes to file@handle_command_errors, consistent option namingScope
src/scm_cli/commands/local.pyscm local list --device <name>andscm local download --device <name> --version <id> [--output config.xml]sdk_client.py:list_local_config_versions(),download_local_config()validators.py(if needed for input validation)main.pyas top-level command grouptests/test_local_commands.pydocs/cli/local/pagesmkdocs.ymlnavCLI Interface
Acceptance Criteria
src/scm_cli/commands/local.pyexists withlistanddownloadsubcommandsscm local list --device <name>shows config versions in table formatscm local download --device <name> --version <id>outputs XML to stdoutscm local download --output <path>writes XML to filetests/test_local_commands.pycovering list, download-to-stdout, download-to-file, error casesmkdocs.ymlmake qualitypassesImplementation Notes
raw_response=TrueinScm.request()— the response body is raw XML bytescommands/jobs.pyas a pattern reference — similar "list + show detail" structure