Vicinae

Environment

Runtime information about the current extension, command, and Vicinae instance.

Usage

import { environment } from "@vicinae/api";

console.log(environment.extensionName);
console.log(environment.commandName);
console.log(environment.isDevelopment);

Key Properties

PropertyDescription
extensionNameName of the extension from package.json
commandNameName of the currently running command
commandMode"view", "no-view", or "menu-bar"
appearance"light" or "dark"
isDevelopmentWhether this is a development build
assetsPathAbsolute path to the extension's assets/ directory
supportPathWritable directory for extension data and files
import { environment } from "@vicinae/api";
import { readFileSync } from "fs";

const data = readFileSync(`${environment.supportPath}/data.json`, "utf-8");

LaunchProps

Commands receive LaunchProps with the launch type, arguments, draft values, and launch context.

import { LaunchProps, Detail } from "@vicinae/api";

export default function Command(props: LaunchProps<{ arguments: { query: string } }>) {
  return <Detail markdown={`You searched: ${props.arguments.query}`} />;
}