Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mersh

Cisco-style interactive CLI for the Meraki Dashboard API, with hierarchical context switching (org / network / device) and show commands generated from OpenAPI GET operations.

Install

pip install -e ".[dev]"

Requires Python 3.10+.

Auth

# PowerShell
$env:MERAKI_DASHBOARD_API_KEY = "your-key"

# bash
export MERAKI_DASHBOARD_API_KEY=your-key

Or inside the shell:

mersh# set api-key <key>
mersh# save

Config is stored at ~/.mersh/config.json (override with MERSH_CONFIG).

Usage

mersh
# or
python -m mersh
mersh# show organizations
mersh# org 123456
mersh-Org-123456# show networks
mersh-Org-123456# network N_abc
mersh-Org-123456-Net-N_abc# show
mersh-Org-123456-Net-N_abc# device Q2XX-YYYY
mersh-Org-123456-Net-N_abc-Dev-Q2XX-YYYY# show clients
mersh-Org-123456-Net-N_abc-Dev-Q2XX-YYYY# exit
mersh-Org-123456-Net-N_abc# end
mersh# 

Context navigation:

Command Effect
org <id> Enter org context; prompt becomes mersh-Org-<id>#
network <id> Enter network context (from org)
device <serial> Enter device context
exit Pop one context level (from root: quit)
end Return to root context

GET operations map to show ... in the matching context (path params owned by the context are implicit). Non-GET operations remain as camelCase operationId commands in that context. Extra key=value tokens become query/body kwargs.

One-shot:

mersh -c "show organizations"
mersh -c "org 123456" -c "show networks"

Regenerate CLI from OpenAPI

python -m mersh.generate
# or
mersh-generate

# Org-specific / Early Access:
python -m mersh.generate -o ORG_ID -k YOUR_API_KEY

Artifacts:

  • src/mersh/data/cli_commands.json — multi-context command trees (root / org / network / device)
  • src/mersh/data/operations.json — param + context metadata for exec_api

Manual overlays:

  • src/mersh/cli/commands_manual.json — root navigation (org, device, set api-key, …)
  • src/mersh/cli/commands_contexts.json — per-context exit / end / network / device

Tests

pytest

About

Cisco-style Meraki Dashboard CLI with OpenAPI-generated show commands and org/network/device context switching

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages