搜索

PythonReactSEOPDF
GitHub Skill

vicinae

Develop and manage Vicinae launcher extensions using TypeScript and React. Use when building extensions for the Vicinae launcher.

knoopx☆ 2 仓库 Stars0 仓库 Forks

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

查看来源 ↗使用指南

技能说明

Vicinae Extensions

Build extensions for Vicinae launcher using TypeScript and React.

Contents

Core Concepts

Concept Description
Extension Package adding commands to the launcher
View Command Displays React UI (mode: "view")
No-View Command Executes action without UI (mode: "no-view")
Manifest package.json with extension metadata

Quick Start

Recommended: Use Vicinae's built-in "Create Extension" command.

Manual:

mkdir my-extension && cd my-extension
npm init -y
npm install @vicinae/api typescript @types/react @types/node
mkdir src && touch src/command.tsx

Project Structure

my-extension/
├── package.json          # Manifest with commands
├── tsconfig.json
├── src/
│   ├── command.tsx       # View commands
│   └── action.ts         # No-view commands
└── assets/               # Icons

Manifest (package.json)

{
  "name": "my-extension",
  "title": "My Extension",
  "version": "1.0.0",
  "commands": [
    {
      "name": "my-command",
      "title": "My Command",
      "description": "What this command does",
      "mode": "view"
    }
  ],
  "dependencies": {
    "@vicinae/api": "^0.8.2"
  }
}

Command Types

View Command (src/command.tsx)
import { List, ActionPanel, Action, Icon } from "@vicinae/api";

export default function MyCommand() {
  return (
    <List>
      <List.Item
        title="Item"
        icon={Icon.Document}
        actions={
          <ActionPanel>
            <Action title="Select" onAction={() => console.log("selected")} />
          </ActionPanel>
        }
      />
    </List>
  );
}
No-View Command (src/action.ts)
import { showToast } from "@vicinae/api";

export default async function QuickAction() {
  await showToast({ title: "Done!" });
}

Development Workflow

npm run build         # Production build
npx tsc --noEmit      # Type check

# Dev mode with watch (use tmux for background)
tmux new -d -s vicinae-dev 'npm run dev'

Common APIs

import {
  // UI Components
  List, Detail, Form, Grid,
  ActionPanel, Action, Icon, Color,
  // Utilities
  showToast, Toast,
  Clipboard, open, closeMainWindow,
  getPreferenceValues, useNavigation,
} from "@vicinae/api";

Navigation

function ListView() {
  const { push, pop } = useNavigation();
  
  return (
    <List.Item
      title="Go to Detail"
      actions={
        <ActionPanel>
          <Action title="View" onAction={() => push(<DetailView />)} />
        </ActionPanel>
      }
    />
  );
}

Preferences

Define in manifest:

{
  "preferences": [
    { "name": "apiKey", "title": "API Key", "type": "password", "required": true }
  ]
}

Access in code:

const { apiKey } = getPreferenceValues();

Raycast Compatibility

Vicinae runs most Raycast extensions. To test:

cd raycast-extension
npm install --save-dev @vicinae/api
npx vici develop

Related Skills

  • typescript: Type safety for extensions

使用示例

查看来源仓库中的使用示例与配置说明。

查看来源 ↗

来源历史

收录时间
2026-01-20
索引更新时间
2026-01-26
Branch
main

收录与同步日期属于本站记录。源码修改历史请查看来源仓库。

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!