A skill that teaches the user how to publish a snippet.
Trigger
Use this when the user says "I want to know how to publish a snippet", "What are the publish steps?", or "How do I register it in a registry?".
Procedure
- Check the user's situation
- Has the snippet already been created?
- Always confirm the publish destination with the user. Present the following options:
- Local registry (
~/.mir/registry/): Stored only on your own PC - ⚠️🌍 official-registry ⚠️🌍: It will become viewable and installable by anyone in the world! Please carefully confirm that it is okay to publish
- Local registry (
- Guide the user through the publishing method
Publishing to a local registry
Local registry (default: ~/.mir/registry/) publishing method:
.mir/snippets/<name>.yamlと.mir/snippets/<name>/Confirm that the following are in place- Preparation before publishing:
# 変数定義を最新化 npx mir sync <name> # 生成内容をプレビュー npx mir preview <name> - Execute publishing:
npx mir publish <name> - If a snippet with the same name already exists, a confirmation prompt will be displayed
--forceCan be skipped with:npx mir publish <name> --force
Publishing to a remote registry
How to publish to a remote registry (HTTP-based):
-
First log in and obtain a publish token:
npx mir login # または特定の registry を指定: npx mir login --registry=my-remoteGitHub OAuth login opens in the browser, and the token is automatically saved to the configuration.
-
Alternatively, you can manually set
mirconfig.yamlにurlとpublish_token:registries: - name: my-remote url: https://registry.example.com publish_token: "your-token-here" -
Execute publishing:
npx mir publish <name> --registry=my-remote -
POST
<url>/api/snippetsThe snippet definition and files are sent to -
To log out:
npx mir logout
Checks before publishing
mir sync <name>Whether the variable definitions are up to date with- Whether the name, description, version, and tags in snippet.yaml are set appropriately
mir preview <name>Whether there are any issues with the generated content with
Notes
- The remote registry is basically read-only. Publishing requires
publish_tokenpublish_token is required - A local registry does not require special authentication