Obsidian Plugin Config
unlistedby 3C0D
Development and testing environment for obsidian-plugin-config NPM exports and injection system
Obsidian Plugin Config
π― Global CLI injection tool for Obsidian plugins.
Installation
npm install -g obsidian-plugin-config
Update
npm install -g obsidian-plugin-config@latest --force
Usage (global CLI)
# Inject in current plugin directory
# Prompts for confirmation before replacing each existing file
obsidian-inject
# Inject by path
# Prompts for confirmation before replacing each existing file
obsidian-inject ../my-plugin
# Inject without confirmation
# Auto-confirms all file replacements (no prompts)
obsidian-inject ../my-plugin --no
# Inject with SASS support
# Adds esbuild-sass-plugin dependency and SCSS compilation
obsidian-inject ../my-plugin --sass
# Verification only (dry-run)
# Shows what would be injected without making any changes
obsidian-inject ../my-plugin --dry-run
# Help
obsidian-inject --help
CLI Options
--no,-n- Skip confirmation prompts (auto-confirm)--sass- Add SASS support (esbuild-sass-plugin)--dry-run- Verification only (no changes)
What is injected
- β
Standalone local scripts:
esbuild.config.ts,acp.ts,update-version.ts,release.ts,help.ts,utils.ts - β package.json: scripts, dependencies, yarn protection
- β tsconfig.json: modern optimized TypeScript configuration
- β eslint.config.mts: ESLint flat config
- β
Config files:
.editorconfig,.prettierrc,.npmrc,.env,.vscode/settings.json,.vscode/tasks.json - β GitHub Actions: release workflow
- β
Traceability:
.injection-info.json(version, date) - π¨ SASS support: optional, via
--sassflag
Commands available after injection
yarn start # Install dependencies + start dev
yarn dev # Development build (watch mode)
yarn build # Production build
yarn real # Build + install to real vault
yarn acp # Add, commit, push
yarn bacp # Build + add, commit, push
yarn v # Update version
yarn r # GitHub release
yarn lint # ESLint check
yarn lint:fix # ESLint fix
yarn prettier # Prettier check
yarn prettier:fix # Prettier format all
yarn h # Full help
Updating Dependencies
yarn upgrade # Update all dependencies to latest
SASS Support
obsidian-inject ../my-plugin --sass
What gets added:
- β
esbuild-sass-plugindependency - β
Automatic
.scssdetection (src/styles.scsspriority) - β CSS cleanup after compilation
Architecture
Target plugins become 100% standalone after injection:
- β Scripts integrated locally (no external runtime dependency)
- β Updatable via re-injection
- β Yarn protection enforced
- β Compatible with all Obsidian plugins
Development Workflow (for injected plugins)
After injection, your plugin has a complete development setup:
Environment Setup
In-place development (inside vault):
- Develop directly in
.obsidian/plugins/your-plugin - Run
yarn dev- builds automatically to current location
External development (outside vault):
- Develop anywhere on your system
- Configure
.envfile with vault paths:TEST_VAULT=/path/to/test/vault REAL_VAULT=/path/to/production/vault - Run
yarn dev- builds to TEST_VAULT - Run
yarn real- builds to REAL_VAULT
Development Commands
yarn start # Install dependencies + start dev
yarn dev # Watch mode (auto-rebuild on changes)
yarn build # Production build
yarn real # Build to production vault
VSCode Tasks (Ctrl+Shift+P β "Run Task")
After injection, VSCode tasks are available for quick access:
- Build - Production build
- Lint / Lint: Fix - ESLint check/fix
- Prettier: Check / Prettier: Fix - Format check/fix
- Obsidian Inject - Re-inject configuration (with confirmation)
- Obsidian Inject (no confirm) - Re-inject without confirmation
- Cleanup: Lint + Prettier + Build - Full cleanup sequence
π‘ Tip: Use Ctrl+Shift+B (Windows/Linux) or Cmd+Shift+B (Mac) for the default Build task.
Version & Release
yarn v # Update version (prompts for type)
yarn acp # Add, commit, push changes
yarn bacp # Build + add, commit, push
yarn r # Create GitHub release
Code Quality
yarn lint # Check for linting errors
yarn lint:fix # Auto-fix linting errors
yarn prettier # Check formatting
yarn prettier:fix # Auto-format all files
Recommended Workflow
yarn start- Install and start development- Make changes, test in Obsidian
yarn bacp- Build and commit changesyarn v- Update versionyarn r- Create release
Development (for contributors)
Setup
git clone https://github.com/3C0D/obsidian-plugin-config
cd obsidian-plugin-config
yarn install
Local injection commands
yarn inject-prompt # Interactive injection
yarn inject-path ../my-plugin # Direct injection
yarn inject ../my-plugin --sass # With SASS support
yarn check-plugin ../my-plugin # Dry-run only
Publish workflow
yarn npm-publish # All-in-one:
# 1. Version bump
# 2. Generate bin/obsidian-inject.js
# 3. Verify package
# 4. Commit + push
# 5. Publish to NPM
# 6. Update global CLI (optional)
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.