Skip to content

rlaksana/title-generator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

123 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Title Generator v3.0.10

Latest Update: Auto version bump enabled - every commit/push increments version automatically. Added Debug Mode toggle for troubleshooting logs.

A completely rewritten Obsidian plugin to generate note titles using multiple AI providers. This new version is built for stability, efficiency, and intelligence, with guaranteed compatibility on both Desktop and Mobile (Android/iOS).

Key Features

  • Dynamic Model Loading with Search: Automatically detects and loads available models from your configured AI providers with a searchable dropdown - no more hardcoded model lists!
  • Intelligent Title Refinement: If an AI-generated title is too long, the plugin asks the AI to shorten it, preserving the core meaning instead of just cutting it off.
  • Cost-Efficient Analysis: Limit the amount of text sent to the AI (e.g., the first 2000 characters) to significantly reduce token usage and cost on long notes.
  • Multi-Provider AI: Choose from OpenAI, Anthropic, or Google Gemini.
  • Smart Model Caching: Models are cached with TTL (1 hour) and automatically refreshed when API keys change.
  • Mobile-First Design: All API calls use Obsidian's native fetch API, ensuring 100% compatibility on mobile devices and removing heavy dependencies.
  • Fully Customizable Prompts: Tailor the initial prompt and the refinement prompt to fit your exact needs.
  • Smart Filename Sanitization: Automatically removes OS-forbidden characters and normalizes whitespace to create safe, clean filenames.
  • Debug Mode: Enable detailed console logging for troubleshooting.

Installation

Via BRAT (Recommended)

  1. Install the BRAT plugin in Obsidian
  2. Open BRAT settings and click "Add Beta Plugin"
  3. Enter repository: rlaksana/title-generator
  4. Click "Add Plugin" and enable it

Having BRAT installation issues? Check our CDN Troubleshooting Guide for quick fixes.

Via Community Plugins (When Available)

  1. Ensure you have the latest version of Obsidian
  2. Install the plugin via the Community Plugins browser in Obsidian
  3. Enable the plugin in your settings

Manual Installation

  1. Download the main.js and manifest.json files from the latest GitHub Release
  2. Place these files in your vault's .obsidian/plugins/title-generator/ directory
  3. Reload Obsidian and enable the plugin

Installation Troubleshooting

  • CDN Issues: Run npm run check-cdn to verify release accessibility
  • Force Fix: Run npm run force-release to recreate the latest release
  • Status Check: Visit GitHub Status for CDN issues
  • Get Help: Run npm run release-help for available commands

Usage

  • Command Palette: Open the command palette (Ctrl/Cmd + P) and search for "Generate title for current note".
  • File Menu: Right-click a note in the file explorer and select "Generate title". You can also select multiple notes to process them in a batch.

Settings

Open Settings → Title Generator to configure the plugin.

Setting Description Default
AI Provider Select your preferred AI service (OpenAI, Anthropic, Google Gemini). OpenAI
API Key Your API key for the selected cloud service. Save/Cancel buttons are enabled only when changes are made. (empty)
Model The specific AI model to use for generation. Models are loaded dynamically from your provider with a searchable dropdown. Auto-detected from provider
Initial Prompt The prompt template for the first request. Use {max_length} as a placeholder. Generate a concise, descriptive title for the following text. The title must be a maximum of {max_length} characters.
Refinement Prompt The prompt used if the first title is too long. Use {max_length} and {title}. The following title is too long. Please shorten it to be under {max_length} characters, while preserving its core meaning: "{title}"
Temperature Controls AI creativity (0.0 = deterministic, 1.0 = highly creative). 0.7
Max Title Length The maximum number of characters for the final title. 200
Max Content Length for AI The maximum number of characters from the note to send to the AI to save on costs. 2000
Lower-case titles If enabled, converts all titles to lower case. false
Remove forbidden chars If enabled, strips characters that are invalid in filenames. true
Debug mode Enable detailed console logging for troubleshooting. false

Dynamic Model Loading

The plugin now automatically detects and loads available models from your configured AI providers:

How It Works

  1. Auto-Detection: When you set an API key or server URL, the plugin automatically queries for available models
  2. Searchable Interface: Type to filter through available models in a user-friendly dropdown
  3. Smart Caching: Models are cached for 1 hour to reduce API calls and improve performance
  4. Reload Button: Click the refresh button next to the model dropdown to manually reload models
  5. Error Handling: Clear error messages help troubleshoot connection issues
  6. Fallback Models: If model loading fails, the plugin falls back to a curated list of popular models

Model Loading Triggers

  • Setting or changing an API key for cloud providers
  • Changing API keys for cloud providers
  • Switching between AI providers
  • Clicking the reload models button
  • Opening settings (if models are older than 1 hour)

Example Models (Auto-detected)

  • OpenAI: gpt-4o, gpt-4o-mini, gpt-4-turbo, gpt-4, etc.
  • Anthropic: claude-sonnet-4-5, claude-3-5-sonnet-latest, claude-3-opus-20240229, etc.
  • Google Gemini: gemini-3-flash-preview, gemini-1.5-pro-latest, gemini-1.5-flash-latest, etc.

Thinking Mode (Google Gemini 3)

For Gemini 3 models, you can enable reasoning/thinking capabilities via the Thinking Level setting. This allows the model to process more complex information before generating a title.

Level Description
Off Standard generation.
Low Minimal reasoning.
Medium Balanced reasoning.
High Maximum reasoning depth.

Troubleshooting

General Issues

  • Invalid API Key: Double-check your API key in your provider's dashboard.
  • Network Errors: For cloud providers, ensure you have an internet connection.
  • No Title Generated: Check the Obsidian developer console (Ctrl/Cmd + Shift + I) for any error messages from the plugin.

Model Loading Issues

  • Models Not Loading: Click the reload button (🔄) next to the model dropdown to manually refresh the model list.
  • "Loading models..." Stuck: Check your internet connection and API key. The plugin has a 10-second timeout for model queries.
  • Error Messages in Settings: Hover over the model dropdown description to see detailed error messages and timestamps.
  • Fallback Models: If model loading fails, the plugin will show a curated list of popular models as fallback.

Provider-Specific Issues

  • OpenAI: Ensure your API key has the correct permissions and billing is set up.
  • Anthropic: API key must be from the Anthropic Console, not Claude.ai.
  • Google Gemini: Use API key from Google AI Studio, not Google Cloud Console.

License

MIT © Richard Laksana

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • TypeScript 56.4%
  • PowerShell 22.2%
  • JavaScript 21.4%