10-of-my-most-popular-text-to-image-series-prompts-78b0897e
generate a bunch of images, then you curate the results to handpick the best ones
Define commands once, deploy to CLI, API, and MCP automatically. Use when building new commands/tools for Supernal — ensures consistent interfaces across all surfaces. DO NOT rebuild this pattern — use this package.
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
SkillHub CLI
skillhub install ianderrington/universal-command打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。
将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。
Define once, deploy everywhere. Single source of truth for CLI, API, and MCP interfaces.
If you're building commands for Supernal, use this package. Don't create separate CLI/API/MCP implementations.
npm install @supernal/universal-command
import { UniversalCommand } from '@supernal/universal-command';
export const userCreate = new UniversalCommand({
name: 'user create',
description: 'Create a new user',
input: {
parameters: [
{ name: 'name', type: 'string', required: true },
{ name: 'email', type: 'string', required: true },
{ name: 'role', type: 'string', default: 'user', enum: ['user', 'admin'] },
],
},
output: { type: 'json' },
handler: async (args, context) => {
return await createUser(args);
},
});
// CLI
program.addCommand(userCreate.toCLI());
// → mycli user create --name "Alice" --email "alice@example.com"
// Next.js API
export const POST = userCreate.toNextAPI();
// → POST /api/users/create
// MCP Tool
const mcpTool = userCreate.toMCP();
// → user_create tool for AI agents
Write your logic once. The handler receives validated args and returns the result:
handler: async (args, context) => {
// This same code runs for CLI, API, and MCP
return await doThing(args);
}
Define parameters once — validation, CLI options, API params, and MCP schema are auto-generated:
input: {
parameters: [
{ name: 'id', type: 'string', required: true },
{ name: 'status', type: 'string', enum: ['draft', 'active', 'done'] },
{ name: 'limit', type: 'number', min: 1, max: 100, default: 10 },
],
}
Override behavior per interface when needed:
cli: {
format: (data)...
这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。
# @supernal/universal-command
**Define once, deploy everywhere.** Single source of truth for CLI, API, and MCP interfaces.
## ⚠️ CRITICAL: Use This, Don't Rebuild
If you're building commands for Supernal, **use this package**. Don't create separate CLI/API/MCP implementations.
## Installation
```bash
npm install @supernal/universal-command
```
## Quick Start
### Define a Command
```typescript
import { UniversalCommand } from '@supernal/universal-command';
export const userCreate = new UniversalCommand({
name: 'user create',
description: 'Create a new user',
input: {
parameters: [
{ name: 'name', type: 'string', required: true },
{ name: 'email', type: 'string', required: true },
{ name: 'role', type: 'string', default: 'user', enum: ['user', 'admin'] },
],
},
output: { type: 'json' },
handler: async (args, context) => {
return await createUser(args);
},
});
```
### Deploy Everywhere
```typescript
// CLI
program.addCommand(userCreate.toCLI());
// → mycli user create --name "Alice" --email "alice@example.com"
// Next.js API
export const POST = userCreate.toNextAPI();
// → POST /api/users/create
// MCP Tool
const mcpTool = userCreate.toMCP();
// → user_create tool for AI agents
```
## Core Concepts
### Single Handler
Write your logic once. The handler receives validated args and returns the result:
```typescript
handler: async (args, context) => {
// This same code runs for CLI, API, and MCP
return await doThing(args);
}
```
### Input Schema
Define parameters once — validation, CLI options, API params, and MCP schema are auto-generated:
```typescript
input: {
parameters: [
{ name: 'id', type: 'string', required: true },
{ name: 'status', type: 'string', enum: ['draft', 'active', 'done'] },
{ name: 'limit', type: 'number', min: 1, max: 100, default: 10 },
],
}
```
### Interface-Specific Options
Override behavior per interface when needed:
```typescript
cli: {
format: (data)...generate a bunch of images, then you curate the results to handpick the best ones
generate a bunch of images, then you curate the results to handpick the best ones
Productivity system based on Maya calendar with 13 natural tones for project management and personal development
Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.