如何使用ASK CLI克隆并部署已有技能的生产与开发版本?
Great question! You absolutely don't need bash scripts to manage your dev and production skill versions with ASK CLI—let's walk through exactly how to clone and deploy both environments directly using built-in CLI features.
1. Clone Existing Dev and Production Skills Locally
ASK CLI lets you pull code for either environment with a simple parameter:
- Clone the development version: By default, the
clonecommand targets the development stage. Just run:
Follow the on-screen prompts to select your skill, and you’ll get the full dev environment code and config files locally.ask clone - Clone the production version: To pull the live, published version of your skill, add the
--stageparameter set toproduction:
This will grab the exact code and configuration that’s currently live for your skill. I recommend cloning each version into separate local folders (e.g.,ask clone --stage productionmy-skill-devandmy-skill-prod) to avoid mixing up environments.
2. Deploy to Dev or Production Environments
Once you’ve made changes locally, deploying to either stage is straightforward:
Deploy to Development Environment
Push your updates to the dev stage with the default deploy command—no extra parameters needed:
ask deploy
This updates your skill’s development environment, where you can test changes before moving to production.
Deploy to Production Environment
To push changes directly to the production stage (note: ensure your code is fully tested first!), use the --stage parameter with deploy:
ask deploy --stage production
If you need to submit the updated production version for Amazon’s review to make it live, use the submit command with the same --stage flag you referenced:
ask submit --stage production
This triggers the official review process for your production skill.
The key here is that ASK CLI’s --stage parameter works consistently across clone, deploy, and submit commands to target either development or production environments natively—no scripting required.
内容的提问来源于stack exchange,提问作者Rinav

