Beeker CLI
Usage
Here is an example of usage in a react application.
You can download the source code of the example on this link: beeker-tech/sample-app (opens in a new tab)
Example file
In the react project of your choice, create an example file named page.tsx:
touch page.tsx
Paste the following content:
import React from "react";
import { Text } from "@tremor/react";
export default function Page() {
return (
<main className="p-4 md:p-10 mx-auto max-w-7xl">
<h1 className="text-left font-medium text-3xl">Page title</h1>
<Text>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut ornare, sem
id pellentesque blandit, ex nisl laoreet sapien, nec vestibulum urna
ligula pretium sem.
</Text>
</main>
);
}
In the next sections, we will aim to use Beeker to update the title of this page.
Define your first rule
Create a template file named update-page-title.beek like the following:
The language is typescript and the framework is react.js.
Update h1 tag with text content "{{title}}".
Configure your first action
Create a configuration file named update-page-title.action.yml like the following:
name: update-page-title
label: Example - Update page title
description: Allow to update example page title
group: Example
variables:
- name: title
label: Title
rules:
- name: update-title
target: ./page.tsx
Preview your action
When your action is configured, you can preview it with beeker cli:
Note: Your target file will not be updated.
Execute your action
When your action is configured, you can launch it with beeker cli:
Note: Unlike preview, executing an action will apply modifications on the target file.