CLI Commands Reference
Complete reference for all ModelKnife command-line interface commands
💡 Access Control: Commands marked with 🔒 require developer access, and ⚠️ require admin access. Use mk team status
to check your access level.
CLI Command Groups
ML Workflow Management
Infrastructure Management
Configuration & Setup
Team & Access Control
Pipeline Commands (mk p) 🔒
Manage ML workflows and pipeline deployments across SageMaker, Glue, and Step Functions
mk p deploy
Deploy ML pipeline modules with unified orchestration.
mk p deploy [OPTIONS]
Option | Description | Default |
---|---|---|
--base-path |
The folder path of the configuration file | Current directory |
--profile, -p |
The Profile name of the compose file | None |
--skip-build, -s |
Skip the build step | False |
--with-services |
Deploy services before deploying pipeline modules | False |
mk p run
Execute ML pipeline or specific modules.
mk p run [OPTIONS]
Option | Description | Default |
---|---|---|
--modules, -m |
Comma-separated list of modules to run | All modules |
--profile, -p |
The Profile name of the compose file | None |
--base-path |
Path to the configuration file | Current directory |
mk p show
Display detailed information about the pipeline configuration.
mk p show [OPTIONS]
Option | Description | Default |
---|---|---|
--profile, -p |
The Profile name of the compose file | None |
--base-path |
Path to the configuration file directory | Current directory |
--detailed, -d |
Show detailed information including resolved configurations | False |
mk p status
Check real-time execution status for pipeline modules. The command aggregates Step Functions execution details and summarizes module-level status across SageMaker, Glue, and other AWS services.
mk p status [OPTIONS]
Option | Description | Default |
---|---|---|
--name |
The specific pipeline name to check status for | Current pipeline |
-n, --execution |
Show the n-th last execution (1 = latest, 2 = second-to-last, etc.) | 1 (latest) |
--profile, -p |
The Profile name of the compose file | None |
--base-path |
Path to the configuration file directory | Current directory |
# Show latest execution status (default)
mk p status
# Show status for the second-to-last execution
mk p status -n 2
# Specify pipeline by name (when outside project directory)
mk p status --name my-pipeline
# Use a specific profile
mk p status -p prod
Output includes overall execution details and a single "Module Status" table:
Pipeline: my-pipeline
📊 Latest Execution: 2025-09-02-16-25-35
🏃 Overall Status: SUCCEEDED
⏰ Started: 2025-09-02 16:25:35
🔗 Monitor: AWS Console
📋 Module Status:
+---------------------+-----------+---------------------+----------+
| Module Name | Status | Start Time | Duration |
+---------------------+-----------+---------------------+----------+
| feature-engineering | Succeeded | 2025-09-02 16:25:35 | 5m 0s |
| model-training | Failed | 2025-09-02 16:30:36 | 5m 0s |
+---------------------+-----------+---------------------+----------+
Columns:
- Module Name: The pipeline module.
- Status: Aggregated status (Running, Succeeded, Failed, etc.).
- Start Time: Module start time (local timezone where available).
- Duration: Elapsed time or completion duration.
mk p visualize / mk p viz
Generate an interactive visualization of the pipeline structure and dependencies.
mk p visualize [OPTIONS]
mk p viz [OPTIONS] # Short alias
Option | Description | Default |
---|---|---|
--profile, -p |
The Profile name of the compose file | None |
--base-path |
Path to the configuration file directory | Current directory |
--output, -o |
Output file path for the visualization | Auto-generated |
--no-open |
Don't automatically open the visualization in browser | False |
mk p delete
Delete deployed pipeline resources from AWS.
mk p delete [OPTIONS]
Option | Description | Default |
---|---|---|
--name |
The specific pipeline name to delete | Current pipeline |
--profile, -p |
The Profile name of the compose file | None |
--base-path |
Path to the configuration file directory | Current directory |
--confirm |
Skip confirmation prompt | False |
mk p version
Show version information for deployed pipelines.
mk p version [OPTIONS]
Option | Description | Default |
---|---|---|
--list |
List all deployed pipeline versions | False |
--name |
Show version info for specific pipeline name | Current pipeline |
--profile, -p |
The Profile name of the compose file | None |
--base-path |
Path to the configuration file directory | Current directory |
mk p runs
Show execution history for pipelines.
mk p runs [OPTIONS]
Option | Description | Default |
---|---|---|
--name |
Pipeline name to show execution history for | Current pipeline |
--limit |
Number of recent executions to show | 10 |
--profile, -p |
The Profile name of the compose file | None |
--base-path |
Path to the configuration file directory | Current directory |
# Show last 10 executions (default)
mk p runs
# Show last 5 executions
mk p runs --limit 5
# Show executions for a specific pipeline name
mk p runs --name my-pipeline
# With a specific profile
mk p runs -p prod --limit 20
mk p stop
Stop running pipeline executions.
mk p stop [OPTIONS]
Option | Description | Default |
---|---|---|
--module |
Stop specific module execution | All modules |
--execution-arn |
Stop specific execution by ARN | None |
--profile, -p |
The Profile name of the compose file | None |
--base-path |
Path to the configuration file directory | Current directory |
--confirm |
Skip confirmation prompt | False |
Pipeline Scheduling Commands
Configure automated pipeline execution schedules using EventBridge rules.
mk p schedule set
Create automated pipeline execution schedule.
mk p schedule set --cron "EXPRESSION" [OPTIONS]
Option | Description | Example |
---|---|---|
--cron |
Cron expression for schedule (required) | "0 9 * * 1-5" |
--timezone |
Timezone for the schedule | Europe/Zurich |
--description |
Optional description for the schedule | "Daily ML training" |
--profile, -p |
The Profile name of the compose file | prod |
--base-path |
Path to the configuration file directory | ./config |
# Weekdays 9 AM UTC
mk p schedule set --cron "0 9 * * 1-5"
# Daily 00:10 Zurich time
mk p schedule set --cron "10 0 * * *" --timezone Europe/Zurich
# Daily 2 AM Beijing time with description
mk p schedule set --cron "0 2 * * *" --timezone Asia/Shanghai --description "Daily ML training"
mk p schedule show
Show the current schedule for a pipeline.
mk p schedule show [OPTIONS]
mk p schedule remove
Remove the schedule for a pipeline.
mk p schedule remove [OPTIONS]
mk p schedule list
List all scheduled pipelines in the current AWS account.
mk p schedule list [OPTIONS]
mk p schedule disable / enable
Disable or enable the schedule for a pipeline without removing it.
mk p schedule disable [OPTIONS]
mk p schedule enable [OPTIONS]
Service Commands (mk s) 🔒
Deploy and manage AWS infrastructure services (DynamoDB, Lambda, API Gateway, etc.)
mk s deploy
Deploy AWS infrastructure services defined in the configuration.
mk s deploy [OPTIONS]
Option | Description | Default |
---|---|---|
--service, -s |
Deploy specific services (comma-separated) | All services |
--base-path |
The folder path of the configuration file | Current directory |
--profile, -p |
Configuration profile | None |
--force |
Force redeploy all services regardless of changes | False |
--verbose |
Show detailed deployment output including build steps | False |
mk s status
Show deployment and operational status of infrastructure services.
mk s status [OPTIONS]
Option | Description | Default |
---|---|---|
--service, -s |
Show status for specific services (comma-separated) | All services |
--base-path |
Path to configuration file | Current directory |
--profile, -p |
Configuration profile | None |
--details |
Show detailed outputs and resource information | False |
mk s validate
Validate service configurations without deploying.
mk s validate [OPTIONS]
mk s delete
Delete deployed infrastructure services from AWS.
mk s delete [OPTIONS]
Option | Description | Default |
---|---|---|
--service, -s |
Delete specific services (comma-separated) | All services |
--confirm |
Skip confirmation prompt | False |
mk s types
List all available service types with descriptions.
mk s types
mk s rollback
Rollback services to previous deployment state.
mk s rollback [OPTIONS]
mk s template
Generate service configuration templates.
mk s template [OPTIONS]
Option | Description | Example |
---|---|---|
--type |
Service type to generate template for | lambda_function |
--name |
Service name for the template | my_service |
--interactive, -i |
Interactive mode to customize configuration | False |
mk s cache
Manage service deployment cache.
mk s cache [OPTIONS]
Option | Description | Options |
---|---|---|
--action |
Cache action to perform | stats, clean, clear |
--max-age |
Maximum age in days for cache cleanup | 7 |
Configuration Commands (mk conf)
AWS profile configuration and system settings
mk conf show
Display current AWS profile configuration and account information.
mk conf show [OPTIONS]
Shows the current AWS profile being used by ModelKnife, account ID, region, and configuration source (file, environment variable, or default).
mk conf set
Set AWS profile for ModelKnife operations (persists across sessions).
mk conf set PROFILE_NAME
Argument | Description | Required |
---|---|---|
PROFILE_NAME |
AWS profile name to use for ModelKnife operations | Yes |
# Set production profile
mk conf set production
# Set development profile
mk conf set development
# Verify the setting
mk conf show
mk conf unset
Remove AWS profile configuration (uses environment variable or default AWS profile).
mk conf unset
After unsetting, ModelKnife will use the MLKNIFE_AWS_PROFILE
environment variable or fall back to the default AWS profile.
Configuration Priority
ModelKnife checks for AWS profile configuration in this order:
- Config file - Set via
mk conf set
- Environment variable -
MLKNIFE_AWS_PROFILE
- Default - AWS default profile or environment credentials
Team Management (mk team)
Team access management and user permissions
mk team status
Check your current access level and team configuration.
mk team status [OPTIONS]
mk team list-users
List all team members in ModelKnife groups.
mk team list-users [OPTIONS]
Option | Description | Options |
---|---|---|
--group |
List users in specific group only | mlknife-developers, mlknife-admin |
mk team check-access
Check access permissions for different operations.
mk team check-access [OPTIONS]
Option | Description | Options |
---|---|---|
--operation |
Type of operation to check access for | basic, admin |
mk team setup ⚠️
Create IAM groups and policies for team access.
mk team setup [OPTIONS]
mk team add-user ⚠️
Add a user to a ModelKnife team group.
mk team add-user [OPTIONS]
Option | Description | Required |
---|---|---|
--user |
IAM username to add to group | Yes |
--group |
Group to add user to | Yes (mlknife-developers or mlknife-admin) |
mk team remove-user ⚠️
Remove a user from a ModelKnife team group.
mk team remove-user [OPTIONS]
Option | Description | Required |
---|---|---|
--user |
IAM username to remove from group | Yes |
--group |
Group to remove user from | Yes (mlknife-developers or mlknife-admin) |
--confirm |
Skip confirmation prompt | No |
Setup Commands (mk setup)
Automated setup wizard for team onboarding
mk setup init ⚠️
One-command setup for new teams - generates IAM configuration files and creates standardized AWS resources with account ID-based naming for team collaboration.
mk setup init [OPTIONS]
This command:
- Generates IAM configuration files with standardized role naming using account ID
- Creates IAM roles, groups, and policies using configuration-based approach
- Sets up AWS resources (S3 buckets, EventBridge permissions, etc.)
- Adds the current user to the admin group
- Enables seamless team collaboration through shared role names
Option | Description | Default |
---|---|---|
--admin-user |
Username to add as admin | Auto-detected |
--skip-confirm |
Skip confirmation prompts | False |
--interactive |
Enable interactive mode | True |
--non-interactive |
Disable interactive prompts | False |
mk setup status
Check setup health and configuration status.
mk setup status [OPTIONS]
mk setup fix ⚠️
Fix common setup issues automatically.
mk setup fix [OPTIONS]
mk setup clean ⚠️
Remove all ModelKnife setup and AWS resources.
mk setup clean [OPTIONS]
Option | Description | Default |
---|---|---|
--confirm |
Skip confirmation prompts | False |
mk setup reset ⚠️
Reset user configuration to system defaults (admin only).
mk setup reset [OPTIONS]
Clears all user customizations and resets configuration to system defaults. Useful for removing custom policies and groups while keeping the base system configuration.
Option | Description | Default |
---|---|---|
--confirm |
Skip confirmation prompts | False |
Format Commands (mk fmt)
Format YAML configuration files with consistent style
mk fmt
Format YAML configuration files with consistent indentation and style.
mk fmt [OPTIONS]
Option | Description | Default |
---|---|---|
--profile, -p |
Profile name to format (e.g., dev, prod) | mlknife-compose.yaml |
--base-path |
Base path to search for configuration files | Current directory |
--indent, -i |
Number of spaces for indentation | 2 |
--check |
Check if formatting is needed without making changes | False |
--diff |
Show diff of changes that would be made | False |
--all |
Format all mlknife-compose*.yaml files | False |
--mode |
Formatting mode | auto (basic, reindent, auto) |
Show Commands (mk show)
Display pipeline and service configuration overview
mk show
Display comprehensive overview of pipeline and service configurations.
mk show [OPTIONS]
Option | Description | Default |
---|---|---|
--profile, -p |
The Profile name of the compose file | None |
--base-path |
Path to the folder containing the configuration file | Current directory |
--detailed, -d |
Show detailed information including descriptions | False |
Access Control Summary
Understanding command permissions and requirements
📖 Public Commands (No Access Control)
Anyone can run these commands:
mk fmt
- Format YAML configuration filesmk show
- Display configuration overviewmk team status
- View team statusmk team check-access
- Check permissionsmk team list-users
- List team membersmk setup status
- Check setup status
🔒 Developer Access Required
Must be in mlknife-developers
or mlknife-admin
group:
- All
mk s
commands (service management) - All
mk p
commands (pipeline management) mk conf show
- View configurationmk conf import
- Import configuration
⚠️ Admin Access Required
Must be in mlknife-admin
group only:
mk team setup
,mk team add-user
,mk team remove-user
mk setup init
,mk setup fix
,mk setup clean
,mk setup reset
Note: Configuration commands (mk conf
) are now focused on AWS profile management and are available to all users.
💡 Getting Access: Use mk team status
to check your current access level. Contact your admin to be added to the appropriate group using mk team add-user
.