> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/pfrankov/obsidian-local-gpt/llms.txt
> Use this file to discover all available pages before exploring further.

# Community Actions

> Browse, install, and share community-contributed actions

Community Actions allow you to access a library of AI actions created by the Local GPT community. These are pre-built prompts and system configurations you can install with one click.

<img width="479" alt="Community Actions" src="https://github.com/user-attachments/assets/5337e74c-864b-45cb-82e0-2c32bbbfa3ed" />

## Accessing Community Actions

<Steps>
  <Step title="Open Local GPT Settings">
    Go to Obsidian Settings → Local GPT
  </Step>

  <Step title="Find Community Actions">
    Scroll to the "Community Actions" section
  </Step>

  <Step title="Click 'Browse Community Actions'">
    This opens the Community Actions modal
  </Step>
</Steps>

<CodeGroup>
  ```typescript src/LocalGPTSettingTab.ts theme={null}
  new Setting(containerEl)
    .setName(I18n.t("settings.communityActions"))
    .setDesc(I18n.t("settings.communityActionsOpenDesc"))
    .addButton((button) => {
      button
        .setButtonText(I18n.t("settings.communityActionsOpen"))
        .setCta()
        .onClick(() => openCommunityActionsModal());
    });
  ```
</CodeGroup>

## Browsing Actions

The Community Actions modal provides:

<CardGroup cols={2}>
  <Card title="Language Filter" icon="language">
    Filter actions by language (English, Spanish, etc.)
  </Card>

  <Card title="Search" icon="magnifying-glass">
    Fuzzy search across action names, descriptions, and prompts
  </Card>

  <Card title="Scoring" icon="star">
    Actions are ranked by community reactions (upvotes)
  </Card>

  <Card title="Status Badges" icon="tag">
    See which actions are installed, modified, or have conflicts
  </Card>
</CardGroup>

### Action Information

Each community action displays:

* **Name**: The action's title
* **Description**: What the action does (if provided)
* **Author**: Who created the action
* **Score**: Community rating based on reactions
* **Tags**: Whether the action replaces selected text
* **Status**: Installed, Modified, or Available

<CodeGroup>
  ```typescript src/CommunityActionsService.ts theme={null}
  export interface CommunityAction {
    id: string;
    name: string;
    language: string;
    description?: string;
    prompt?: string;
    system?: string;
    replace?: boolean;
    author: string;
    authorUrl?: string;
    commentUrl?: string;
    score: number;
    createdAt?: string;
    updatedAt?: string;
  }
  ```
</CodeGroup>

## Installing Actions

<Steps>
  <Step title="Find an action">
    Browse or search for the action you want
  </Step>

  <Step title="Click 'Install'">
    The action will be added to your actions list
  </Step>

  <Step title="Use the action">
    Access it via the context menu or action palette
  </Step>
</Steps>

<Tip>
  Installed actions appear in your regular actions list and can be used immediately.
</Tip>

## Automatic Updates

Community actions are **automatically updated** to the latest version when you browse the library.

### How Auto-Update Works

1. When you open Community Actions, Local GPT fetches the latest versions
2. Installed actions are compared with the community versions
3. If a newer version exists and you haven't modified the action, it updates automatically
4. A status message shows how many actions were updated

<CodeGroup>
  ```typescript src/LocalGPTSettingTab.ts theme={null}
  const syncCommunityActions = async (
    actions: CommunityAction[],
  ): Promise<{ updated: number; skipped: number }> => {
    const lookup = buildCommunityActionsLookup(
      this.plugin.settings.actions,
    );
    let updated = 0;
    let skipped = 0;

    actions.forEach((action) => {
      const localAction = findCommunityActionLink(action, lookup);
      if (!localAction) return;

      const localSignature = buildCommunityActionSignature(localAction);
      const remoteSignature = buildCommunityActionSignature(action);
      
      // Check if action was modified locally
      if (isCommunityActionModified(localAction, localSignature)) {
        skipped++;
        return;
      }
      
      // Update if signatures differ
      if (localSignature !== remoteSignature) {
        applyCommunityActionUpdate(localAction, action);
        updated++;
      }
    });

    return { updated, skipped };
  };
  ```
</CodeGroup>

### Preventing Auto-Updates

To stick with a specific version or preserve your changes:

<Warning>
  **Simply modify the Prompt or System Prompt** of the action. This will disable automatic updates for that action.
</Warning>

<Note>
  Changing **only the Name** does NOT prevent auto-updates. You must modify the prompt or system prompt.
</Note>

<CodeGroup>
  ```typescript src/LocalGPTSettingTab.ts theme={null}
  const dropCommunityLinkIfModified = (action: LocalGPTAction) => {
    if (!action.community?.hash) {
      return;
    }
    const localSignature = buildCommunityActionSignature(action);
    if (localSignature !== action.community.hash) {
      delete action.community;
    }
  };
  ```
</CodeGroup>

## Action Status Badges

<ResponseField name="Installed" type="badge">
  Action is installed and up-to-date with the community version
</ResponseField>

<ResponseField name="Modified" type="badge">
  You've modified the action locally. Auto-updates are disabled.

  You can click "Update" to overwrite your changes with the community version.
</ResponseField>

<ResponseField name="In List" type="badge">
  You have a different action with the same name. Installing will replace it.
</ResponseField>

## Sharing Your Own Actions

You can contribute your actions to the community:

<Steps>
  <Step title="Create your action">
    Build and test your action in Local GPT
  </Step>

  <Step title="Export the action">
    Click the copy button next to your action
  </Step>

  <Step title="Share on GitHub">
    Post your action in the [Community Actions Discussion](https://github.com/pfrankov/obsidian-local-gpt/discussions/89)
  </Step>
</Steps>

### Action Format

When you copy an action, it's formatted like this:

```
Name: Explain Like I'm Five ✂️
System: You are a patient teacher who explains complex topics in simple terms using analogies and examples that a 5-year-old would understand. ✂️
Prompt: Explain the following concept in simple terms: ✂️
Replace: false ✂️
Language: en
```

<Note>
  The `✂️` separator is used to delimit fields. Don't remove it when sharing.
</Note>

<CodeGroup>
  ```typescript src/LocalGPTSettingTab.ts theme={null}
  const buildSharingString = (action: LocalGPTAction) => {
    const detectedLanguage = detectDominantLanguage(
      [action.name, action.system, action.prompt]
        .filter((value): value is string => Boolean(value))
        .join("\n"),
    );
    const resolvedLanguage = normalizeLanguageCode(
      detectedLanguage === "unknown"
        ? defaultCommunityActionsLanguage
        : detectedLanguage,
    );
    const replaceValue = action.replace
      ? `${sharingFieldLabels.replace}${action.replace}`
      : "";

    return [
      action.name && `${sharingFieldLabels.name}${action.name}`,
      action.system && `${sharingFieldLabels.system}${action.system}`,
      action.prompt && `${sharingFieldLabels.prompt}${action.prompt}`,
      replaceValue,
      `${sharingFieldLabels.language}${resolvedLanguage}`,
    ]
      .filter(Boolean)
      .join(` ${SEPARATOR}\n`);
  };
  ```
</CodeGroup>

## Quick Add Actions

You can also paste community action strings directly into the **Quick Add** field:

<Steps>
  <Step title="Copy an action string">
    Get the formatted action text from GitHub or another user
  </Step>

  <Step title="Open Local GPT Settings">
    Go to the Actions section
  </Step>

  <Step title="Paste into Quick Add">
    The action will be parsed and added automatically
  </Step>
</Steps>

<CodeGroup>
  ```typescript src/LocalGPTSettingTab.ts theme={null}
  const quickAdd = new Setting(containerEl)
    .setName(I18n.t("settings.quickAdd"))
    .addText((text) => {
      text.onChange(async (value) => {
        const parts = value
          .split(SEPARATOR)
          .map((part) => part.trim())
          .filter(Boolean);
        
        const quickAddAction: LocalGPTAction = {
          name: "",
          prompt: "",
        };

        for (const part of parts) {
          const entry = sharingEntries.find(([, label]) =>
            part.startsWith(label),
          );
          const key = entry?.[0];
          const label = entry?.[1];
          const rawValue = label
            ? part.slice(label.length).trim()
            : "";
          if (!key || !rawValue) continue;
          
          const handler = quickAddHandlers[key];
          if (handler) {
            handler(rawValue, quickAddAction);
          }
        }

        if (quickAddAction.name) {
          await this.addNewAction(quickAddAction);
          text.setValue("");
          this.display();
        }
      });
    });
  ```
</CodeGroup>

## Community Action Sources

Community actions are fetched from:

* **GitHub Discussions**: [Discussion #89](https://github.com/pfrankov/obsidian-local-gpt/discussions/89)
* **Community reactions**: Actions are scored based on positive/negative reactions

<CodeGroup>
  ```typescript src/CommunityActionsService.ts theme={null}
  const DISCUSSION_COMMENTS_URL =
    "https://api.github.com/repos/pfrankov/obsidian-local-gpt/discussions/89/comments";

  static async getCommunityActions(options?: {
    forceRefresh?: boolean;
  }): Promise<CommunityAction[]> {
    if (this.cache && !forceRefresh) {
      return this.cache;
    }

    const { actions, failed } = await this.fetchCommunityActions();
    if (failed && this.cache) {
      return this.cache;
    }
    
    this.cache = actions;
    return actions;
  }
  ```
</CodeGroup>

## Scoring System

Actions are ranked by their **score**, calculated from GitHub reactions:

**Positive reactions** (+1 each):

* 👍 Thumbs up
* ❤️ Heart
* 🎉 Hooray
* 🚀 Rocket
* 👀 Eyes
* 😄 Laugh

**Negative reactions** (-1 each):

* 👎 Thumbs down
* 😕 Confused

<CodeGroup>
  ```typescript src/CommunityActionsService.ts theme={null}
  private static getReactionScore(
    reactions?: GitHubDiscussionComment["reactions"],
  ): number {
    if (!reactions) return 0;
    
    const positive = POSITIVE_REACTIONS.reduce((total, key) => {
      return total + (reactions[key] ?? 0);
    }, 0);
    const negative = NEGATIVE_REACTIONS.reduce((total, key) => {
      return total + (reactions[key] ?? 0);
    }, 0);
    
    return positive - negative;
  }
  ```
</CodeGroup>

<Tip>
  React to actions on GitHub to help others discover quality prompts!
</Tip>

## Search and Filter

### Language Filtering

Actions are tagged by language. Select your preferred language from the dropdown to see relevant actions.

### Fuzzy Search

Search matches against:

1. **Action name** (highest priority)
2. **Description**
3. **Prompt text**
4. **System prompt**

<CodeGroup>
  ```typescript src/LocalGPTSettingTab.ts theme={null}
  const getCommunityActionSearchRank = (
    action: CommunityAction,
    query: string,
  ): number | null => {
    const fields = [
      action.name,
      action.description,
      action.prompt,
      action.system,
    ];
    
    for (let i = 0; i < fields.length; i++) {
      const value = fields[i];
      if (!value) continue;
      
      const normalized = normalizeSearchValue(value);
      if (normalized && fuzzyMatch(normalized, query)) {
        return i;  // Lower index = higher priority
      }
    }
    return null;
  };
  ```
</CodeGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Actions not loading">
    * Check your internet connection
    * Click "Refresh" to retry fetching
    * Cached actions will be used if available
  </Accordion>

  <Accordion title="Action won't install">
    * You may have a naming conflict
    * Check if you already have an action with the same name
    * The status badge will indicate conflicts
  </Accordion>

  <Accordion title="Auto-update not working">
    * Ensure you haven't modified the action's prompts
    * Check that the action has the community badge
    * Try refreshing the community actions list
  </Accordion>

  <Accordion title="Can't prevent updates">
    * Make sure you modify the **Prompt** or **System Prompt**
    * Changing only the name doesn't disable updates
    * The "Modified" badge should appear after editing
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Creating Custom Actions" icon="wand-magic-sparkles" href="/customization/custom-actions">
    Learn how to create your own actions from scratch
  </Card>

  <Card title="Contributing" icon="code-pull-request" href="/contributing">
    Contribute your actions to help the community
  </Card>
</CardGroup>
