SuperAPI AI Directory

mir-publish-guide

Coding & development

View repository

Updated 10-16 08:44

About this skill

publish-guide

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

  1. Check the user's situation
    • Has the snippet already been created?
  2. 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
  3. Guide the user through the publishing method

Publishing to a local registry

Local registry (default: ~/.mir/registry/) publishing method:

  1. .mir/snippets/<name>.yaml と .mir/snippets/<name>/ Confirm that the following are in place
  2. Preparation before publishing:
    # 変数定義を最新化
    npx mir sync <name>
    # 生成内容をプレビュー
    npx mir preview <name>
    
  3. Execute publishing:
    npx mir publish <name>
    
  4. If a snippet with the same name already exists, a confirmation prompt will be displayed
    • --force Can be skipped with: npx mir publish <name> --force

Publishing to a remote registry

How to publish to a remote registry (HTTP-based):

  1. First log in and obtain a publish token:

    npx mir login
    # または特定の registry を指定:
    npx mir login --registry=my-remote
    

    GitHub OAuth login opens in the browser, and the token is automatically saved to the configuration.

  2. Alternatively, you can manually set mirconfig.yaml に url と publish_token :

    registries:
      - name: my-remote
        url: https://registry.example.com
        publish_token: "your-token-here"
    
  3. Execute publishing:

    npx mir publish <name> --registry=my-remote
    
  4. POST <url>/api/snippets The snippet definition and files are sent to

  5. 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_token publish_token is required
  • A local registry does not require special authentication