{
"name": "arguments",
"title": "API Arguments",
"description": "Example of Arguments usage in the API",
"icon": "command-icon.png",
"author": "mattisssa",
"license": "MIT",
"commands": [
{
"name": "my-command",
"title": "Arguments",
"subtitle": "API Examples",
"description": "Demonstrates usage of arguments",
"mode": "view",
"arguments": [
{
"name": "title",
"placeholder": "Title",
"type": "text",
"required": true
},
{
"name": "subtitle",
"placeholder": "Subtitle",
"type": "text"
}
]
}
],
"dependencies": {
"@raycast/api": "1.38.0"
},
"scripts": {
"dev": "ray develop",
"build": "ray build -e dist",
"lint": "ray lint"
}
}
import { Form, LaunchProps } from "@raycast/api";
export default function Todoist(props: LaunchProps<{ arguments: Arguments.MyCommand }>) {
const { title, subtitle } = props.arguments;
console.log(`title: ${title}, subtitle: ${subtitle}`);
return (
<Form>
<Form.TextField id="title" title="Title" defaultValue={title} />
<Form.TextField id="subtitle" title="Subtitle" defaultValue={subtitle} />
</Form>
);
}