CLI and TUI for submitting and monitoring Amazon SageMaker Processing Jobs and Pipelines.
Project description
SageMaker Ops CLI
smops is a command-line tool for operating Amazon SageMaker Processing Jobs and SageMaker Pipelines.
It can:
- Submit SageMaker Processing Jobs
- Start SageMaker Pipeline executions
- Show running Processing Jobs in an interactive TUI
- Show running and recently completed Pipeline executions in an interactive TUI
- Inspect Pipeline step status and failed step CloudWatch logs
- Work with one, many, or all configured AWS profiles
Installation
Install from PyPI:
pip install sagemaker-ops-cli
The installed command is:
smops --help
Install from GitHub:
pip install git+https://github.com/southpolemonkey/smops.git
Install from a local wheel:
pip install dist/sagemaker_ops_cli-0.2.0-py3-none-any.whl
Install with Homebrew:
brew tap southpolemonkey/smops https://github.com/southpolemonkey/smops
brew install sagemaker-ops-cli
If the formula is later moved into a dedicated southpolemonkey/homebrew-smops tap repository, users can use the shorter command:
brew tap southpolemonkey/smops
brew install sagemaker-ops-cli
For local development:
python -m venv .venv
source .venv/bin/activate
pip install -e .
To enable YAML config files:
pip install -e '.[yaml]'
Defaults
Set a default AWS region once so you do not need to pass --region on every command:
smops config set-region ap-southeast-2
smops config get-region
The config file is stored at ~/.config/smops/config.json by default. You can inspect it with:
smops config show
smops config path
Region resolution order is:
--regionSMOPS_DEFAULT_REGIONsmops config set-region ...- Region configured on the selected AWS profile
Build The Python Package
pip install -e '.[dev]'
python -m build
Build artifacts are written to dist/:
sagemaker_ops_cli-0.2.0-py3-none-any.whlsagemaker_ops_cli-0.2.0.tar.gz
Submit A Processing Job
The config file uses the same parameter structure as boto3 create_processing_job.
smops processing submit \
--profile dev \
--region us-east-1 \
--config examples/processing-job.json
Validate the request without submitting it:
smops processing submit --config examples/processing-job.json --dry-run
Start A Pipeline Execution
smops pipeline start \
--profile dev \
--region us-east-1 \
--name my-pipeline \
--display-name manual-run-001 \
--parameter InputDate=2026-06-30 \
--parameter Mode=prod
Interactive TUI
Open the TUI selector and choose between Pipelines and Processing Jobs:
smops tui --profile dev
Inside the TUI:
p/P: switch to the next AWS profile from your local AWS configs: start a pipeline or submit a processing job from the current TUIr: refreshq: quit
For pipeline starts, enter the pipeline name, optional display name, and optional comma-separated parameters such as InputDate=2026-07-01,Mode=test. For processing job submits, enter the path to a JSON/YAML config file using the same structure as boto3 create_processing_job.
Processing Jobs TUI
smops tui processing --profile dev --region us-east-1
Multiple profiles:
smops tui processing --profile dev --profile prod --region us-east-1
All profiles:
smops tui processing --all-profiles
Keyboard shortcuts:
Up/DownorLeft/Right: switch jobsp/P: switch to the next AWS profiles: submit a Processing Job from a JSON/YAML config filer: refreshq: quit
Pipelines TUI
smops tui pipelines --profile dev --region us-east-1
Filter to one pipeline:
smops tui pipelines --profile dev --region us-east-1 --name my-pipeline
By default, the TUI shows running executions plus executions completed within the last 3 hours, so you can inspect recent success and failure results. Use --hours to adjust the time window:
smops tui pipelines --profile dev --region us-east-1 --name my-pipeline --hours 6
Keyboard shortcuts:
Left/Right: switch focus between the executions and steps panelsUp/Down: move within the focused panelp/P: switch to the next AWS profiles: start a Pipeline executionl: load the CloudWatch log tail for the selected failed stepr: refreshq: quit
Log discovery is currently supported for these step job types:
- ProcessingJob:
/aws/sagemaker/ProcessingJobs - TrainingJob:
/aws/sagemaker/TrainingJobs - TransformJob:
/aws/sagemaker/TransformJobs
Non-Interactive Commands
smops processing list --profile dev --region us-east-1
smops processing wait --profile dev --region us-east-1 --name my-processing-job
smops pipeline list --profile dev --region us-east-1
smops pipeline list --profile dev --region us-east-1 --name my-pipeline --hours 6
smops pipeline steps --profile dev --region us-east-1 --execution-arn arn:aws:sagemaker:...
smops pipeline wait --profile dev --region us-east-1 --execution-arn arn:aws:sagemaker:...
smops pipeline inspect --profile dev --region us-east-1 --execution-arn arn:aws:sagemaker:...
smops pipeline diagnose --profile dev --region us-east-1 --execution-arn arn:aws:sagemaker:...
Most non-interactive commands support --json for agents and automation:
smops processing list --profile dev --region us-east-1 --json
smops processing wait --profile dev --region us-east-1 --name my-processing-job --json
smops pipeline start --profile dev --region us-east-1 --name my-pipeline --json
smops pipeline list --profile dev --region us-east-1 --json
smops pipeline steps --profile dev --region us-east-1 --execution-arn arn:aws:sagemaker:... --json
smops pipeline wait --profile dev --region us-east-1 --execution-arn arn:aws:sagemaker:... --json
smops pipeline inspect --profile dev --region us-east-1 --execution-arn arn:aws:sagemaker:... --json
smops pipeline diagnose --profile dev --region us-east-1 --execution-arn arn:aws:sagemaker:... --json
JSON responses use a stable envelope. Successful commands return status: "ok"; errors return status: "error" and a user-facing error message. List commands return items, count, and next_token.
pipeline inspect returns execution details, all steps, and failed steps. pipeline diagnose extends that with the first failed step, inferred SageMaker job type/name, CloudWatch log group and stream prefix, log tail, and suggested next actions.
processing list reads 20 running jobs per page by default. If the output includes Next token, pass it to fetch the next page:
smops processing list --profile dev --region us-east-1 --max-results 20
smops processing list --profile dev --region us-east-1 --max-results 20 --next-token '<token>'
When pipeline list is used without --name, it scans 10 pipelines per page by default. This avoids long hangs in AWS accounts with many pipelines. If the output includes Next token, pass it to continue scanning:
smops pipeline list --profile dev --region us-east-1 --pipeline-page-size 10
smops pipeline list --profile dev --region us-east-1 --pipeline-page-size 10 --next-token '<token>'
AWS Permissions
The AWS identity used by smops needs at least these permissions:
sagemaker:CreateProcessingJobsagemaker:StartPipelineExecutionsagemaker:ListProcessingJobssagemaker:DescribeProcessingJobsagemaker:ListPipelinessagemaker:ListPipelineExecutionssagemaker:DescribePipelineExecutionsagemaker:ListPipelineExecutionStepslogs:DescribeLogStreamslogs:GetLogEvents
Mock AWS Profile
This repository includes mock AWS config files for local demos of profile switching and CLI argument parsing. They do not write to your real ~/.aws files:
export AWS_CONFIG_FILE=examples/aws/config
export AWS_SHARED_CREDENTIALS_FILE=examples/aws/credentials
export AWS_PROFILE=mock-dev
export AWS_DEFAULT_REGION=us-east-1
You can also load the sample environment file directly:
set -a
source examples/aws/mock.env
set +a
Then run:
smops processing submit --config examples/processing-job.json --dry-run
smops processing list --profile mock-dev
smops tui processing --profile mock-dev
The bundled credentials are dummy values. They are only intended for dry runs, mock environments, local endpoints, or tests that use botocore Stubber/moto. They will not authenticate against real AWS.
E2E Tests
The tests use moto to simulate AWS SageMaker and CloudWatch Logs. They do not call real AWS services:
pip install -e '.[dev]'
pytest
Coverage includes:
- Processing Job submission and paginated running job lists
- Pipeline execution start and active/recent execution lists
- Pipeline step status display
- Failed step CloudWatch Logs tailing
- Processing Job TUI keyboard navigation with up, down, left, and right
- Pipeline TUI execution, step, and failed log loading
- Multiple AWS profile resolution
Moto does not currently implement list_pipeline_execution_steps, so that paginator is faked in memory in the tests. The other SageMaker and CloudWatch Logs calls run inside the moto environment.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sagemaker_ops_cli-0.2.0.tar.gz.
File metadata
- Download URL: sagemaker_ops_cli-0.2.0.tar.gz
- Upload date:
- Size: 28.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea111b1ff74319d9584963ec3232b25e74f9ecb597f81fa92ea7add5fdfaa43b
|
|
| MD5 |
7b632b4001205b479dfc845d997cf027
|
|
| BLAKE2b-256 |
bd0355cce15119745aafd21dc23c12363ff5ff75ad581c71ef490c7dea4b56c7
|
File details
Details for the file sagemaker_ops_cli-0.2.0-py3-none-any.whl.
File metadata
- Download URL: sagemaker_ops_cli-0.2.0-py3-none-any.whl
- Upload date:
- Size: 22.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb2df3d1a3586e6fc4583e5a477998194b93ac40640e8876e2fd20640dd66034
|
|
| MD5 |
342a1fe17cd1dec70543e454cc4ab4ac
|
|
| BLAKE2b-256 |
7c952933ab7e2ab5d6caf91f44497cfe894d47c533813b26e3db64c1f8f81d03
|