CLI Commands Reference
Reference for ModelKnife CLI commands, grouped by workflow and operational scope.
Command conventions: mk p is the short form of mk pipeline, and mk s is the short form of mk service. Most project commands accept -p/--profile for compose profiles and -w/--workspace for deployment isolation. Run mk COMMAND --help for exact option defaults in your installed version.
Start Here
| Goal | Command | Notes |
|---|---|---|
| Preview changes | mk plan -p prod -w prod --refresh | Shows stack changes before deployment. |
| Deploy services | mk s deploy -p prod -w prod | Deploys provider infrastructure services. |
| Deploy pipeline | mk p deploy -p prod -w prod | Deploys module artifacts and orchestration. |
| Run with parameters | mk p run -w gwliu --param start_date=2026-06-01 | Applies a pipeline-level run override for one execution. |
| Run selected modules | mk p run -w gwliu --modules user_feature_job,post_feature_job | Runs a selected module subgraph. |
| Check status | mk p status -w prod | Shows latest pipeline execution and module status. |
| Refresh inventory | mk stacks sync --refresh | Syncs current project state and provider metadata into the stack registry. |
Command Groups
ML Workflow Management
Infrastructure Management
State & Registry
Configuration
Team & Access Control
Pipeline Commands
mk p manages pipeline modules, orchestration, runs, status, and schedules.
mk p deploy
Deploys pipeline module artifacts and provider orchestration.
mk p deploy [--profile PROFILE] [--workspace WORKSPACE] [--with-services] [--refresh] [--force] [--json]
--with-services | Deploy services before pipeline modules. |
--no-cache | Ignore build cache and rebuild artifacts. |
--verbose | Show detailed build and deployment output. |
--force | Proceed even when the plan reports blocking or no-op conditions. |
mk p run
Starts a full pipeline execution or a selected module run. Full pipeline runs reuse the deployed pipeline. Selected module runs execute only the requested module subgraph.
mk p run [--modules MODULES] [--param KEY=VALUE] [--module-param MODULE.KEY=VALUE] [--profile PROFILE] [--workspace WORKSPACE]
-m, --modules | Comma-separated module names to run. |
--param KEY=VALUE | Pipeline-level run override. ModelKnife resolves affected module job parameters from compose references. |
--module-param MODULE.KEY=VALUE | Module-specific run override. This is the most specific run override. |
--json | Emit execution start metadata as JSON. |
mk p run -w gwliu --param start_date=2026-06-01
mk p run -w gwliu --modules user_feature_job --module-param user_feature_job.output-mode=overwrite
mk p status
Shows execution status, schedule information, monitor link, and module-level progress.
mk p status [--name PIPELINE] [-n EXECUTION_INDEX] [--profile PROFILE] [--workspace WORKSPACE] [--json]
mk p show
Displays pipeline state or local module configuration with dependency and console-link information.
mk p show [--profile PROFILE] [--workspace WORKSPACE] [--detailed]
mk p runs
Lists recent pipeline executions.
mk p runs [--name PIPELINE] [--limit 10] [--profile PROFILE] [--workspace WORKSPACE] [--json]
mk p stop
Stops running executions by ARN, by module, or for the whole pipeline.
mk p stop [--execution-arn ARN | --module MODULE | --all] [--profile PROFILE]
mk p delete
Deletes pipeline orchestration and associated provider resources.
mk p delete [--name PIPELINE] [--profile PROFILE] [--workspace WORKSPACE] [--confirm]
mk p visualize / mk p viz
Generates an interactive pipeline dependency visualization.
mk p visualize [--profile PROFILE] [--output pipeline_dag.html] [--no-open]
mk p viz [--profile PROFILE] [--output pipeline_dag.html] [--no-open]
Pipeline Schedule Commands
mk p schedule manages provider schedules for automated pipeline runs.
| Command | Purpose | Key Options |
|---|---|---|
mk p schedule set | Create or update a schedule. | --cron, --timezone, --description, -p, -w |
mk p schedule show | Show current schedule. | -p, -w, --base-path |
mk p schedule list | List scheduled pipelines in the provider account. | -p |
mk p schedule enable | Enable an existing schedule. | -p, -w, --confirm |
mk p schedule disable | Disable an existing schedule. | -p, -w, --confirm |
mk p schedule remove | Remove a schedule. | -p, -w, --confirm |
mk p schedule set --cron "0 2 * * *" --timezone Europe/Zurich -p prod -w prod
Service Commands
mk s deploys and manages provider infrastructure services.
| Command | Purpose | Key Options |
|---|---|---|
mk s deploy | Deploy services with dependency resolution. | -s/--service, -p, -w, --force, --no-cache, --refresh, --json |
mk s status | Show service deployment status. | -s/--service, -p, -w, --details, --json |
mk s show | Display service state or local config. | -p, -w, --detailed |
mk s validate | Validate service configuration without deployment. | --service, -p |
mk s delete | Delete deployed services. | -s/--service, -p, -w, --confirm |
Service Tooling
| Command | Purpose | Key Options |
|---|---|---|
mk s rollback | Rollback services to previous state. | --service, -p, --confirm |
mk s template | Generate service configuration templates. | --type, --name, --interactive, --backend |
mk s types | List service types available for a backend. | --backend |
mk s cache | Inspect or clean service build cache. | --action stats|clean|clear, --max-age, --backend |
State Commands
Inspect, refresh, migrate, and repair ModelKnife deployment state.
| Command | Purpose | Key Options |
|---|---|---|
mk plan | Show deployment plan for the current stack. | -p, -w, --detail, --refresh, --json |
mk state show | Show state snapshots. | -p, -w, --all, --detail, --json |
mk state refresh | Refresh remote provider state and show drift. | -p, -w, --detail, --json |
mk state doctor | Diagnose state identity, coverage, schema, and backend health. | -p, -w, --detail, --json |
mk state adopt | Adopt existing deployments into state. | --from-legacy, --remote, --refresh, --force |
mk state migrate | Migrate state snapshots between backends. | --from, --to, --force, --overwrite |
mk state prune | Prune old deployment attempts. | --all, --keep-attempts, --force |
mk state export | Export state snapshots as JSON. | --all, --redact/--no-redact |
mk state import EXPORT_FILE | Import a non-redacted state export. | --force |
mk state schema migrate | Rewrite state payloads using the current schema version. | --force |
mk state lock-status | Show state backend lock status. | --base_path |
mk state unlock | Release a stale lock. | --force |
mk state backend show | Show state backend config. | --json |
mk state backend init | Initialize project state backend. | --type, --set, --yes, --skip-validate, --reconfigure |
Stack Registry Commands
mk stacks works across projects and state snapshots to find deployed ModelKnife stacks.
| Command | Purpose | Key Options |
|---|---|---|
mk stacks list | List registered stacks. | --registry, --workspace, --json |
mk stacks show SELECTOR | Show one stack by id or name. | --registry, -p, -w, --region, --provider-profile, --json |
mk stacks sync | Sync current project state into the global registry. | --base-path, --registry, --refresh, --json |
mk stacks doctor | Diagnose the resolved stack registry. | --registry, --json |
mk stacks registry show | Show resolved registry configuration. | --base-path, --registry, --json |
mk stacks registry init | Initialize local or S3 stack registry configuration. | --type, --name, --path, S3 options, --project, --yes, --json |
mk stacks registry migrate | Migrate registry metadata between local and remote registries. | --from, --to, S3 options, --force, --overwrite, --json |
Setup Commands
Initialize and validate ModelKnife team/provider setup.
| Command | Purpose | Access |
|---|---|---|
mk setup init | Create or update shared provider resources and team administrator access. | Admin. |
mk setup status | Check setup health. | User. |
mk setup validate | Validate access configuration files. | User. |
mk setup config | Generate local access configuration files. | User. |
mk setup fix | Fix common setup issues. | Admin. |
mk setup clean | Remove setup groups and resources. | Admin, destructive. |
mk setup reset | Reset user configuration to defaults. | Admin, destructive. |
Team Commands
| Command | Purpose | Key Options |
|---|---|---|
mk team status | Show current user's access level. | None. |
mk team check-access | Check access for an operation type. | --operation basic|admin |
mk team list-users | List team members. | --group |
mk team setup | Initialize team access groups. | Admin. |
mk team add-user | Grant team access. | --user, --group |
mk team remove-user | Remove team access. | --user, --group, --confirm |
Utility Commands
Authentication, provider profile, formatting, and visualization helpers.
| Command | Purpose | Key Options |
|---|---|---|
mk login | Authenticate or check readiness for a cloud provider. | --provider aws|gcp, -p/--profile, --region, --project, --check |
mk conf show | Show provider profile configuration. | None. |
mk conf set PROFILE_NAME | Set provider profile for ModelKnife operations. | Profile argument. |
mk conf unset | Remove provider profile configuration. | None. |
mk fmt | Format compose YAML files. | -p, --base-path, --check, --diff, --all, --mode |
mk show | Display pipeline and service configuration overview. | -p, --base-path, --detailed |
mk viz | Generate unified system architecture visualization. | -p, --output, --no-open, --view |
mk list-profiles | List compose profiles in the current project. | --base-path |
Verification Tip
This page is a developer reference, not a substitute for command help. For exact option descriptions in your installed version, run mk COMMAND --help or mk GROUP COMMAND --help.