mimiry-softlaunch
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMimiry Softlaunch — GPU Compute (Early Beta)
Mimiry 软发布 — GPU 计算(早期测试版)
Softlaunch notice: This skill targets the Mimiry softlaunch environment (). It is an early beta — APIs, pricing, and features may change without notice. Report issues to the Mimiry team.softlaunch.mimiry.com
软发布说明: 本技能适配Mimiry软发布环境 ()。这是早期测试版本,API、定价和功能可能会在未通知的情况下发生变动。如有问题请反馈给Mimiry团队。softlaunch.mimiry.com
Locating Skill Scripts
查找技能脚本
This skill bundles helper scripts in its subdirectory. Before
running any commands, locate the skill installation directory by checking
these paths (in order):
scripts/- (npx skills standard location)
~/.agents/skills/mimiry-softlaunch/ - (Claude Code symlink)
~/.claude/skills/mimiry-softlaunch/
Use whichever exists. In all command examples below, is a
placeholder for this resolved path — substitute the actual path when
executing commands.
SKILL_DIRThis skill covers two concerns:
- API operations (always available) — auth, list sessions, get status, logs, terminate, check balance/quota
- Job building (when creating something new) — choose an image strategy, pick an implementation language, generate the job script, and launch it
本技能的辅助脚本打包在子目录下。运行任何命令前,请按以下顺序检查路径,找到技能的安装目录:
scripts/- (npx技能标准安装位置)
~/.agents/skills/mimiry-softlaunch/ - (Claude Code符号链接)
~/.claude/skills/mimiry-softlaunch/
使用存在的路径即可。在下文所有命令示例中,****是该解析路径的占位符,执行命令时请替换为实际路径。
SKILL_DIR本技能覆盖两类功能:
- API操作(始终可用)—— 身份验证、列出会话、获取状态、查看日志、终止会话、查询余额/配额
- 任务构建(创建新资源时使用)—— 选择镜像策略、选择实现语言、生成任务脚本并启动
Prerequisites
前置要求
Before any API operation, verify the user has a registered SSH key. Ask:
Do you have an SSH key registered on your Mimiry account?
If yes — ask for the path to the key (there is no default). The auth
script accepts either the private key path or the path — it
normalizes automatically.
.pubIf no — walk them through setup:
- Generate a key (if they don't have one):
bash
ssh-keygen -t ed25519 -f ~/.ssh/mimiry -C "mimiry-softlaunch" - Register it on Mimiry — the user must add the public key
() through the Mimiry portal. There is currently no API for key registration. Direct them to:
~/.ssh/mimiry.pub→ Profile → SSH Keys → Add Keyhttps://softlaunch.mimiry.com - Once the key is registered, proceed with the key path they chose.
The same SSH key serves two purposes: authenticating with the API (signature
exchange) and SSH access into running sessions.
Other requirements: , , , and must be
available on the user's system.
curljqssh-keygenopenssl执行任何API操作前,请确认用户已注册SSH密钥。询问用户:
你是否已在Mimiry账户上注册了SSH密钥?
如果是——询问密钥的路径(无默认路径)。身份验证脚本同时支持私钥路径和公钥路径,会自动做标准化处理。
.pub如果否——引导用户完成设置:
- 生成密钥(如果用户还没有密钥):
bash
ssh-keygen -t ed25519 -f ~/.ssh/mimiry -C "mimiry-softlaunch" - 在Mimiry上注册密钥——用户需要通过Mimiry门户添加公钥()。目前没有密钥注册的API,引导用户访问:
~/.ssh/mimiry.pub→ 个人资料 → SSH密钥 → 添加密钥https://softlaunch.mimiry.com - 密钥注册完成后,使用用户选择的密钥路径继续操作。
同一个SSH密钥有两个用途:API身份验证(签名交换)和运行中会话的SSH访问。
其他要求: 用户系统上必须安装、、和。
curljqssh-keygenopensslPart 1: API Operations (Always Available)
第一部分:API操作(始终可用)
These are the building blocks used by everything else.
这些是所有功能的基础组件。
Authentication
身份验证
The auth algorithm uses SSH signature exchange (not a simple API key). Always
use the bundled auth script — do not re-implement the signing logic inline.
The algorithm has several non-obvious details (message format, namespace,
file-based signing) that are easy to get wrong.
bash
source SKILL_DIR/scripts/mimiry-auth.sh <ssh_key_path>身份验证算法使用SSH签名交换(不是简单的API密钥)。请始终使用打包的验证脚本,不要自行实现签名逻辑。该算法有多个容易出错的非显式细节(消息格式、命名空间、基于文件的签名)。
bash
source SKILL_DIR/scripts/mimiry-auth.sh <ssh_key_path>Exports: MIMIRY_TOKEN, MIMIRY_API
Exports: MIMIRY_TOKEN, MIMIRY_API
Tokens expire after 1 hour — re-authenticate if you get 401s.
**API base:** `https://softlaunch.mimiry.com`
**Compute prefix:** `/api/compute/v1`
> **CRITICAL — All commands MUST be wrapped in `bash -c`.**
> The Bash tool loads the user's shell profile, which can interfere with
> command execution. Always wrap the entire command in `bash -c '...'` to
> run in a clean, non-interactive shell.
>
> Shell state does not persist between Bash tool calls. Each call spawns a
> **new shell**. You MUST include `source` in every `bash -c` invocation.
> Never run `source` in one Bash call and use `$MIMIRY_API` / `$MIMIRY_TOKEN`
> in a separate one.
令牌有效期为1小时,如果返回401错误请重新验证。
**API根地址:** `https://softlaunch.mimiry.com`
**计算服务前缀:** `/api/compute/v1`
> **重要提示:所有命令必须包裹在`bash -c`中。**
> Bash工具会加载用户的shell配置文件,可能会干扰命令执行。请始终将完整命令包裹在`bash -c '...'`中,在干净的非交互式shell中运行。
>
> 不同Bash工具调用之间的shell状态不会持久化,每次调用都会生成一个**新的shell**。你必须在每次`bash -c`调用中都包含`source`命令,不要在一次Bash调用中运行`source`,然后在另一次调用中使用`$MIMIRY_API` / `$MIMIRY_TOKEN`。Common Operations
常用操作
These commands are for the agent's own shell. Always include theline. Never copy these verbatim into user-facing output — the variables won't exist in the user's terminal. When printing commands for the user, follow the "After Session Creation" section.source
Every API call must be wrapped in with included.
bash -csourceCheck GPU availability (public — no auth required):
bash
bash -c 'curl -s "https://softlaunch.mimiry.com/api/compute/v1/availability?gpu_types=T4,V100,A100" | jq .'The parameter is required (comma-separated). Returns per-type
availability with provider/zone details. Use this as a pre-flight check
before creating sessions.
gpu_typesCheck balance (do this before creating sessions):
bash
bash -c 'source SKILL_DIR/scripts/mimiry-auth.sh <ssh_key_path> && curl -s "${MIMIRY_API}/balance" -H "Authorization: Bearer $MIMIRY_TOKEN" | jq .'List sessions:
bash
bash -c 'source SKILL_DIR/scripts/mimiry-auth.sh <ssh_key_path> && curl -s "${MIMIRY_API}/sessions" -H "Authorization: Bearer $MIMIRY_TOKEN" | jq .'Get session details:
bash
bash -c 'source SKILL_DIR/scripts/mimiry-auth.sh <ssh_key_path> && curl -s "${MIMIRY_API}/sessions/$SESSION_ID" -H "Authorization: Bearer $MIMIRY_TOKEN" | jq .'Get logs (session must be ):
runningbash
bash -c 'source SKILL_DIR/scripts/mimiry-auth.sh <ssh_key_path> && curl -s "${MIMIRY_API}/sessions/$SESSION_ID/logs?tail=50" -H "Authorization: Bearer $MIMIRY_TOKEN" | jq -r .logs'- HTTP 503 → VM still setting up, retry after
retry_after_seconds - HTTP 409 → session not running, check status first
Terminate session:
bash
bash -c 'source SKILL_DIR/scripts/mimiry-auth.sh <ssh_key_path> && curl -s -X DELETE "${MIMIRY_API}/sessions/$SESSION_ID" -H "Authorization: Bearer $MIMIRY_TOKEN" | jq .'Check quota:
bash
bash -c 'source SKILL_DIR/scripts/mimiry-auth.sh <ssh_key_path> && curl -s "${MIMIRY_API}/quota" -H "Authorization: Bearer $MIMIRY_TOKEN" | jq .'Transaction history:
bash
bash -c 'source SKILL_DIR/scripts/mimiry-auth.sh <ssh_key_path> && curl -s "${MIMIRY_API}/transactions" -H "Authorization: Bearer $MIMIRY_TOKEN" | jq .'这些命令是供Agent内部shell使用的,始终需要包含行。请不要直接复制这些命令到面向用户的输出中,这些变量在用户的终端中不存在。为用户打印命令时,请参考「会话创建完成后」部分的说明。source
每个API调用都必须用包裹,且包含命令。
bash -csource查询GPU可用性(公开接口,无需验证):
bash
bash -c 'curl -s "https://softlaunch.mimiry.com/api/compute/v1/availability?gpu_types=T4,V100,A100" | jq .'gpu_types查询余额(创建会话前执行):
bash
bash -c 'source SKILL_DIR/scripts/mimiry-auth.sh <ssh_key_path> && curl -s "${MIMIRY_API}/balance" -H "Authorization: Bearer $MIMIRY_TOKEN" | jq .'列出会话:
bash
bash -c 'source SKILL_DIR/scripts/mimiry-auth.sh <ssh_key_path> && curl -s "${MIMIRY_API}/sessions" -H "Authorization: Bearer $MIMIRY_TOKEN" | jq .'获取会话详情:
bash
bash -c 'source SKILL_DIR/scripts/mimiry-auth.sh <ssh_key_path> && curl -s "${MIMIRY_API}/sessions/$SESSION_ID" -H "Authorization: Bearer $MIMIRY_TOKEN" | jq .'获取日志(会话必须处于状态):
runningbash
bash -c 'source SKILL_DIR/scripts/mimiry-auth.sh <ssh_key_path> && curl -s "${MIMIRY_API}/sessions/$SESSION_ID/logs?tail=50" -H "Authorization: Bearer $MIMIRY_TOKEN" | jq -r .logs'- HTTP 503 → 虚拟机仍在设置中,请等待后重试
retry_after_seconds - HTTP 409 → 会话未运行,请先检查会话状态
终止会话:
bash
bash -c 'source SKILL_DIR/scripts/mimiry-auth.sh <ssh_key_path> && curl -s -X DELETE "${MIMIRY_API}/sessions/$SESSION_ID" -H "Authorization: Bearer $MIMIRY_TOKEN" | jq .'查询配额:
bash
bash -c 'source SKILL_DIR/scripts/mimiry-auth.sh <ssh_key_path> && curl -s "${MIMIRY_API}/quota" -H "Authorization: Bearer $MIMIRY_TOKEN" | jq .'交易历史:
bash
bash -c 'source SKILL_DIR/scripts/mimiry-auth.sh <ssh_key_path> && curl -s "${MIMIRY_API}/transactions" -H "Authorization: Bearer $MIMIRY_TOKEN" | jq .'Part 2: Job Building (When Creating Something New)
第二部分:任务构建(创建新资源时使用)
When the user wants to create a new compute job, gather the required
information through natural conversation. Do not use
with fixed option lists — instead, ask plain questions and let the user
respond in their own words. This produces a better experience because
users often provide multiple answers at once, clarify context, or ask
follow-up questions that rigid option menus can't accommodate.
AskUserQuestion当用户想要创建新的计算任务时,通过自然对话收集所需信息。不要使用带固定选项列表的,而是提出直白的问题,让用户用自己的话回答。这样体验更好,因为用户通常会一次性提供多个答案、补充上下文,或者提出固定选项菜单无法容纳的后续问题。
AskUserQuestionWhat to gather
需要收集的信息
Work through these in conversation, adapting to what the user has already
told you (they may have answered several in their initial request):
- SSH key path — needed for auth and session SSH access
- Image — what container to run. Suggest common options if they're
unsure:
- PyTorch:
nvcr.io/nvidia/pytorch:24.01-py3 - TensorFlow:
nvcr.io/nvidia/tensorflow:24.01-tf2-py3 - Plain CUDA:
nvcr.io/nvidia/cuda:12.3.1-devel-ubuntu22.04 - Or any public image URI / custom Dockerfile
- PyTorch:
- GPU type — available types are ,
T4, andV100. Default to T4 (cheapest) unless the user needs more power. Check theA100endpoint to confirm the requested type is available before creating a session/availability - What to run — a command/script, or interactive SSH access?
- Session name — suggest a sensible default based on the image/task
Optional (only ask if relevant to what the user described):
- Environment variables
- Auto-terminate behavior (default: if command,
trueif interactive)false - Billing account (only for org billing)
Once you have enough information, authenticate, create the session, poll
until running, and print management commands per "After Session Creation".
在对话中逐步收集以下信息,可以根据用户已经提供的内容灵活调整(用户可能在初始请求中已经回答了多个问题):
- SSH密钥路径——用于身份验证和会话SSH访问
- 镜像——要运行的容器。如果用户不确定可以推荐常用选项:
- PyTorch:
nvcr.io/nvidia/pytorch:24.01-py3 - TensorFlow:
nvcr.io/nvidia/tensorflow:24.01-tf2-py3 - 基础CUDA:
nvcr.io/nvidia/cuda:12.3.1-devel-ubuntu22.04 - 或者任意公共镜像URI / 自定义Dockerfile
- PyTorch:
- GPU类型——可用类型为、
T4和V100。默认使用T4(最便宜),除非用户需要更高算力。创建会话前请调用A100接口确认请求的类型有可用资源/availability - 运行内容——是命令/脚本,还是交互式SSH访问?
- 会话名称——根据镜像/任务推荐一个合理的默认名称
可选字段(仅当和用户描述的内容相关时询问):
- 环境变量
- 自动终止行为(默认:运行命令则为,交互式访问则为
true)false - 计费账户(仅组织计费需要)
收集到足够信息后,完成身份验证、创建会话、轮询直到会话运行,然后按照「会话创建完成后」部分的说明打印管理命令。
Creating the Session
创建会话
Agent-internal code — do not print this block to the user. All commands MUST be wrapped in.bash -c '...'
Regardless of how decisions were made, the session creation call looks like:
bash
bash -c 'source SKILL_DIR/scripts/mimiry-auth.sh <ssh_key_path> && PUB_KEY=$(cat "<ssh_key_path>.pub") && curl -s -X POST "${MIMIRY_API}/sessions" -H "Authorization: Bearer $MIMIRY_TOKEN" -H "Content-Type: application/json" -d '"'"'{"name": "<session_name>", "image": {"uri": "<image_uri>"}, "gpu": {"types": ["<gpu_type>"], "count": 1}, "ssh_enabled": true, "ssh_public_key": "'"'"'"'"'"'"'"'"'$PUB_KEY'"'"'"'"'"'"'"'"'", "command": "<command_or_null>", "auto_terminate": <true|false>}'"'"' | jq .'Tip: The JSON body quoting is complex. A cleaner approach is to build
the JSON with jq:
bash
bash -c 'source SKILL_DIR/scripts/mimiry-auth.sh <ssh_key_path> && PUB_KEY=$(cat "<ssh_key_path>.pub") && JSON=$(jq -n --arg name "<session_name>" --arg image "<image_uri>" --arg gpu "<gpu_type>" --arg key "$PUB_KEY" --arg cmd "<command>" '"'"'{name: $name, image: {uri: $image}, gpu: {types: [$gpu], count: 1}, ssh_enabled: true, ssh_public_key: $key, command: $cmd, auto_terminate: false}'"'"') && curl -s -X POST "${MIMIRY_API}/sessions" -H "Authorization: Bearer $MIMIRY_TOKEN" -H "Content-Type: application/json" -d "$JSON" | jq .'Field guide:
| Field | When | Value |
|---|---|---|
| User has a script to run | The command string |
| Interactive access | Omit entirely |
| Has a command | |
| Interactive / long-running | |
| Only terminate on success | |
| Always required | Contents of |
| User doesn't specify | |
| User needs env config | |
| Org billing | |
Agent内部代码——不要把这段代码打印给用户。所有命令必须包裹在中。bash -c '...'
无论决策过程如何,会话创建调用的格式如下:
bash
bash -c 'source SKILL_DIR/scripts/mimiry-auth.sh <ssh_key_path> && PUB_KEY=$(cat "<ssh_key_path>.pub") && curl -s -X POST "${MIMIRY_API}/sessions" -H "Authorization: Bearer $MIMIRY_TOKEN" -H "Content-Type: application/json" -d '"'"'{"name": "<session_name>", "image": {"uri": "<image_uri>"}, "gpu": {"types": ["<gpu_type>"], "count": 1}, "ssh_enabled": true, "ssh_public_key": "'"'"'"'"'"'"'"'"'$PUB_KEY'"'"'"'"'"'"'"'"'", "command": "<command_or_null>", "auto_terminate": <true|false>}'"'"' | jq .'提示: JSON体的引号处理比较复杂,更简洁的方式是用jq构建JSON:
bash
bash -c 'source SKILL_DIR/scripts/mimiry-auth.sh <ssh_key_path> && PUB_KEY=$(cat "<ssh_key_path>.pub") && JSON=$(jq -n --arg name "<session_name>" --arg image "<image_uri>" --arg gpu "<gpu_type>" --arg key "$PUB_KEY" --arg cmd "<command>" '"'"'{name: $name, image: {uri: $image}, gpu: {types: [$gpu], count: 1}, ssh_enabled: true, ssh_public_key: $key, command: $cmd, auto_terminate: false}'"'"') && curl -s -X POST "${MIMIRY_API}/sessions" -H "Authorization: Bearer $MIMIRY_TOKEN" -H "Content-Type: application/json" -d "$JSON" | jq .'字段说明:
| 字段 | 场景 | 值 |
|---|---|---|
| 用户有要运行的脚本 | 命令字符串 |
| 交互式访问 | 完全省略该字段 |
| 有运行命令 | |
| 交互式/长期运行 | |
| 仅成功时终止 | |
| 始终必填 | |
| 用户未指定 | |
| 用户需要环境配置 | |
| 组织计费 | |
Session Lifecycle
会话生命周期
Two dimensions:
- (durable milestone):
statesubmitted → provisioned → started → completed/failed/stopped → terminated - (transient):
status,provisioning,pulling_image,starting_container,running,stopping_containerterminating
POST /sessions → state:submitted → state:provisioned → state:started → state:completed
status:provisioning status:pulling_image status:starting_container status:running ↓
state:terminated
DELETE /sessions/{id}
↓
state:stopped → state:terminated
On error at any stage → state:failed or state:provision_failedPoll every 5 seconds until (agent-internal, not user-facing).
The entire loop MUST be in a single call:
startedbash -cbash
bash -c 'source SKILL_DIR/scripts/mimiry-auth.sh <ssh_key_path> && while true; do RESP=$(curl -s "${MIMIRY_API}/sessions/$SESSION_ID" -H "Authorization: Bearer $MIMIRY_TOKEN"); STATE=$(echo "$RESP" | jq -r .state); STATUS=$(echo "$RESP" | jq -r .status); echo "State: $STATE | Status: $STATUS"; case "$STATE" in started) break ;; failed|provision_failed) echo "FAILED: $(echo $RESP | jq -r .error)"; break ;; completed|terminated|stopped) echo "Session ended unexpectedly"; break ;; esac; sleep 5; done'Once running, extract SSH details from (still in the same shell)
and then print user-facing management commands per the "After Session
Creation" section below. Include the SSH command with resolved values:
$RESPbash
undefined包含两个维度:
- (持久化里程碑):
statesubmitted → provisioned → started → completed/failed/stopped → terminated - (临时状态):
status,provisioning,pulling_image,starting_container,running,stopping_containerterminating
POST /sessions → state:submitted → state:provisioned → state:started → state:completed
status:provisioning status:pulling_image status:starting_container status:running ↓
state:terminated
DELETE /sessions/{id}
↓
state:stopped → state:terminated
任何阶段出错 → state:failed 或 state:provision_failed每5秒轮询一次直到状态变为(Agent内部操作,不对用户展示)。整个轮询循环必须放在单个调用中:
startedbash -cbash
bash -c 'source SKILL_DIR/scripts/mimiry-auth.sh <ssh_key_path> && while true; do RESP=$(curl -s "${MIMIRY_API}/sessions/$SESSION_ID" -H "Authorization: Bearer $MIMIRY_TOKEN"); STATE=$(echo "$RESP" | jq -r .state); STATUS=$(echo "$RESP" | jq -r .status); echo "State: $STATE | Status: $STATUS"; case "$STATE" in started) break ;; failed|provision_failed) echo "FAILED: $(echo $RESP | jq -r .error)"; break ;; completed|terminated|stopped) echo "Session ended unexpectedly"; break ;; esac; sleep 5; done'会话运行后,从中提取SSH详情(仍在同一个shell中),然后按照下文「会话创建完成后」部分的说明打印面向用户的管理命令。包含替换了实际值的SSH命令:
$RESPbash
undefinedExtract from $RESP (in the same bash -c call as the polling loop above):
从$RESP中提取(在和上述轮询循环同一个bash -c调用中):
SSH_HOST=$(echo "$RESP" | jq -r '.ssh.host')
SSH_HOST=$(echo "$RESP" | jq -r '.ssh.host')
Then print for the user (with actual values substituted):
然后打印给用户(替换为实际值):
ssh -i <key_path> -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null <host>
ssh -i <key_path> -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null <host>
Plus the mirc helper commands — see "After Session Creation"
加上mirc辅助命令——参考「会话创建完成后」部分
> **Note:** SSH sessions connect through the ssh-proxy on port 22 (the
> default SSH port), which lands users directly inside their container.
> No special port or username is needed — just `ssh -i <key> <host>`.
---
> **注意:** SSH会话通过22端口的ssh-proxy连接(默认SSH端口),用户会直接进入自己的容器。不需要特殊端口或用户名,只需执行`ssh -i <key> <host>`即可。
---After Session Creation
会话创建完成后
Once a session is running, print management commands the user can copy-paste
into their terminal. There is a critical rule: never print commands that
contain unresolved shell variables like or —
those only exist inside the agent's shell, not in the user's terminal. Either
use the helper (which handles auth internally) or print fully
resolved URLs with the auth source command included.
${MIMIRY_API}$MIMIRY_TOKENmirc会话运行后,打印用户可以复制粘贴到终端的管理命令。有一条核心规则:永远不要打印包含未解析shell变量(如或)的命令,这些变量仅存在于Agent的shell中,用户终端里没有。可以使用辅助工具(内部处理身份验证),或者打印完全解析的URL,包含身份验证的source命令。
${MIMIRY_API}$MIMIRY_TOKENmircDefault: Quick Commands (mirc helper)
默认:快速命令(mirc辅助工具)
Print these by default. Replace and with the
actual values from the session that was just created:
<session_id><key_path>undefined默认打印这些命令,将和替换为刚创建会话的实际值:
<session_id><key_path>undefinedManage your session (run in any terminal):
管理你的会话(可在任意终端运行):
mirc status <session_id> --key <key_path>
mirc logs <session_id>
mirc ssh <session_id>
mirc terminate <session_id>
The `--key` flag is only needed on the first command — the path is cached
for subsequent calls. If the user has already run a `mirc` command in this
terminal session, `--key` can be omitted entirely.
The helper script lives at:
`SKILL_DIR/scripts/mirc.sh`
If the user hasn't added it to their PATH, print the full path on first use.
For convenience, suggest:
```bash
alias mirc='SKILL_DIR/scripts/mirc.sh'mirc status <session_id> --key <key_path>
mirc logs <session_id>
mirc ssh <session_id>
mirc terminate <session_id>
`--key`参数仅在第一个命令中需要,后续调用会缓存路径。如果用户已经在当前终端会话中运行过`mirc`命令,可以完全省略`--key`。
辅助脚本的路径为:`SKILL_DIR/scripts/mirc.sh`
如果用户没有将它添加到PATH中,第一次使用时打印完整路径。为了方便,可以建议:
```bash
alias mirc='SKILL_DIR/scripts/mirc.sh'Alternative: Raw API Commands
替代方案:原生API命令
Print these when the user asks about automation, pipelines, CI/CD, or wants
to understand what's happening under the hood. Always include the auth source
command so the variables are defined:
bash
undefined当用户询问自动化、流水线、CI/CD,或者想了解底层实现时打印这些命令。始终包含身份验证的source命令,这样变量会被定义:
bash
undefinedAuthenticate (sets $MIMIRY_TOKEN for 1 hour, re-run to refresh):
身份验证(设置$MIMIRY_TOKEN,有效期1小时,重新运行即可刷新):
source SKILL_DIR/scripts/mimiry-auth.sh <key_path>
source SKILL_DIR/scripts/mimiry-auth.sh <key_path>
Check status:
查看状态:
curl -s "https://softlaunch.mimiry.com/api/compute/v1/sessions/<session_id>"
-H "Authorization: Bearer $MIMIRY_TOKEN" | jq .
-H "Authorization: Bearer $MIMIRY_TOKEN" | jq .
curl -s "https://softlaunch.mimiry.com/api/compute/v1/sessions/<session_id>"
-H "Authorization: Bearer $MIMIRY_TOKEN" | jq .
-H "Authorization: Bearer $MIMIRY_TOKEN" | jq .
Get logs:
获取日志:
curl -s "https://softlaunch.mimiry.com/api/compute/v1/sessions/<session_id>/logs?tail=50"
-H "Authorization: Bearer $MIMIRY_TOKEN" | jq -r '.logs'
-H "Authorization: Bearer $MIMIRY_TOKEN" | jq -r '.logs'
curl -s "https://softlaunch.mimiry.com/api/compute/v1/sessions/<session_id>/logs?tail=50"
-H "Authorization: Bearer $MIMIRY_TOKEN" | jq -r '.logs'
-H "Authorization: Bearer $MIMIRY_TOKEN" | jq -r '.logs'
Terminate:
终止会话:
curl -s -X DELETE "https://softlaunch.mimiry.com/api/compute/v1/sessions/<session_id>"
-H "Authorization: Bearer $MIMIRY_TOKEN" | jq .
-H "Authorization: Bearer $MIMIRY_TOKEN" | jq .
Note: in raw commands, always use the fully resolved URL
(`https://softlaunch.mimiry.com/api/compute/v1/...`), never `${MIMIRY_API}`.
The only variable that's acceptable is `$MIMIRY_TOKEN` because the `source`
command on the line above defines it.curl -s -X DELETE "https://softlaunch.mimiry.com/api/compute/v1/sessions/<session_id>"
-H "Authorization: Bearer $MIMIRY_TOKEN" | jq .
-H "Authorization: Bearer $MIMIRY_TOKEN" | jq .
注意:在原生命令中,始终使用完全解析的URL(`https://softlaunch.mimiry.com/api/compute/v1/...`),不要使用`${MIMIRY_API}`。唯一可以接受的变量是`$MIMIRY_TOKEN`,因为上一行的`source`命令已经定义了它。Token Expiry Guidance
令牌过期指引
Tokens last 1 hour. When printing post-session commands, mention:
- The helper auto-refreshes tokens (no action needed)
mirc - For raw API commands, re-run the command to get a fresh token
source - If a command returns HTTP 401, the token has expired
令牌有效期为1小时。打印会话后命令时,说明:
- 辅助工具会自动刷新令牌(无需用户操作)
mirc - 对于原生API命令,重新运行命令获取新令牌
source - 如果命令返回HTTP 401,说明令牌已过期
Error Reference
错误参考
| Error | Meaning | Fix |
|---|---|---|
| Auth algorithm wrong | Ensure the bundled auth script is being used |
| Clock drift > 5 min | Sync system clock |
| Key not on account | Register key in Mimiry portal |
| No credits | Ask admin to add credits |
| No billing account | Ask admin to create one |
| VM booting | Retry after |
| Wrong session state for operation | Check session status |
| 错误 | 含义 | 解决方案 |
|---|---|---|
| 身份验证算法错误 | 确保使用了打包的身份验证脚本 |
| 时钟偏差超过5分钟 | 同步系统时钟 |
| 密钥未在账户中注册 | 在Mimiry门户注册密钥 |
| 额度不足 | 请管理员添加额度 |
| 没有计费账户 | 请管理员创建计费账户 |
| 虚拟机正在启动 | 等待 |
| 会话状态不支持当前操作 | 检查会话状态 |
Tips
提示
- ALWAYS wrap commands in — the Bash tool's default shell loads user profile scripts that can interfere with command execution.
bash -c '...'runs in a clean non-interactive shell, avoiding these issues.bash -c - The same SSH key authenticates with the API and provides session SSH access
- Billing runs from provisioning to termination — remind users to terminate idle sessions
- Available GPUs: (cheapest),
T4,V100. Only suggest these three — no other GPU types are enabled on the softlaunch platformA100 - When generating scripts for the user, include error handling for common failure modes (402 insufficient balance, 429 quota exceeded)
- Exploration vs. automation: Default to helper commands for interactive use. Switch to raw curl commands when the user mentions pipelines, CI/CD, scripting, or automation — and always include the full auth
mirccommand so the commands are self-containedsource - Never print unresolved variables in user-facing commands. and
${MIMIRY_API}only exist inside the agent's shell session. See the "After Session Creation" section for the correct patterns$MIMIRY_TOKEN
- 始终将命令包裹在中——Bash工具的默认shell会加载用户配置脚本,可能干扰命令执行。
bash -c '...'在干净的非交互式shell中运行,可以避免这些问题。bash -c - 同一个SSH密钥同时用于API身份验证和会话SSH访问
- 计费从资源分配开始到会话终止结束——提醒用户终止空闲会话
- 可用GPU:(最便宜)、
T4、V100。仅推荐这三种,软发布平台没有启用其他GPU类型A100 - 为用户生成脚本时,包含常见故障模式的错误处理(402余额不足、429配额超出)
- 探索使用 vs 自动化使用:交互式使用默认推荐辅助命令。当用户提及流水线、CI/CD、脚本或自动化时,切换到原生curl命令,并且始终包含完整的身份验证
mirc命令,保证命令可以独立运行source - 永远不要在面向用户的命令中打印未解析的变量。和
${MIMIRY_API}仅存在于Agent的shell会话中,正确的写法参考「会话创建完成后」部分$MIMIRY_TOKEN