Overview
Obsidian Portable supports various command-line arguments that control application behavior, data locations, and advanced features. These arguments are passed through the PortableApps.com launcher.Obsidian Command-Line Arguments
—user-data-dir
The primary argument used by Obsidian Portable to ensure portability. Syntax:App/AppInfo/Launcher/ObsidianPortable.ini:
- Specifies where Obsidian stores its user data (cache, settings, vault configurations)
- Ensures all data is contained within the portable directory structure
- Automatically updated by the launcher when the portable app is moved
The
--user-data-dir argument is critical for portability. Without it, Obsidian would store data in the system’s AppData directory, defeating the purpose of a portable installation.—disable-gpu
Disables GPU hardware acceleration. Syntax:- Running on systems with incompatible or outdated graphics drivers
- Experiencing rendering issues or crashes related to GPU
- Using Obsidian via Remote Desktop or VNC
- Running in virtual machines with limited graphics support
ObsidianPortable.ini:
—no-sandbox
Disables the Chromium sandbox. Syntax:- Running in certain restricted environments
- Compatibility with older systems
- Troubleshooting launch issues
—enable-features / —disable-features
Enable or disable specific Chromium features. Syntax:—force-device-scale-factor
Override the display scaling factor. Syntax:- High-DPI displays with scaling issues
- Force specific zoom levels for better readability
- Testing UI at different scale factors
1.0- 100% scale (default)1.25- 125% scale1.5- 150% scale2.0- 200% scale
—allow-file-access-from-files
Allows file:// URLs to access other file:// URLs. Syntax:- Enabling certain local file operations in custom plugins
- Development and testing scenarios
PortableApps.com Launcher Arguments
The PortableApps.com launcher (ObsidianPortable.exe) accepts its own arguments.
Standard Launch
Passing Arguments Through the Launcher
Arguments after the launcher are passed to Obsidian:--user-data-dir with the additional --disable-gpu argument.
Advanced Configuration Examples
Example 1: Disable GPU for Compatibility
Scenario: Running on older hardware or via Remote Desktop Configuration (ObsidianPortable.ini):
Example 2: High-DPI Display Optimization
Scenario: 4K display with scaling issues Configuration:Example 3: Multiple Arguments for Troubleshooting
Scenario: Debugging issues in a restricted environment Configuration:Example 4: Custom User Data Location
Scenario: Store app data in a different location (e.g., encrypted volume) Configuration:Using absolute paths defeats portability. This is only useful for specialized setups where the drive letter is guaranteed to remain constant.
Environment Variables
The PortableApps.com launcher supports environment variables in the configuration:Available Variables
| Variable | Description | Example Value |
|---|---|---|
%PAL:DataDir% | Data directory | E:\ObsidianPortable\Data |
%PAL:Drive% | Current drive | E: |
%PAL:AppDir% | App directory | E:\ObsidianPortable\App |
%PAL:PackageDir% | Package root | E:\ObsidianPortable |
Using Environment Variables
Command-Line Vault Opening
Obsidian supports opening specific vaults from the command line.Open Specific Vault
Open Specific File
URI Scheme
Obsidian uses theobsidian:// URI scheme for deep linking:
open- Open vault or filesearch- Open search with querynew- Create new note
Batch File Automation
Create batch files for common launch configurations.Basic Launch Script
launch-obsidian.bat
Launch with GPU Disabled
launch-safe-mode.bat
Launch Specific Vault
launch-work-vault.bat
Advanced Launch with Logging
launch-debug.bat
Troubleshooting with Arguments
Issue: Rendering Problems
Try:Issue: Slow Performance
Try:Issue: Launch Failures
Try:Issue: High-DPI Scaling
Try:Best Practices
Test Before Committing
Test command-line arguments by running them manually before modifying
ObsidianPortable.ini. This allows easy reversal if something goes wrong.Document Custom Configurations
Keep a text file documenting any custom arguments you’ve added and why. This helps when troubleshooting or upgrading.
Preserve Portability
Avoid using absolute paths in arguments unless absolutely necessary. Use environment variables like
%PAL:DataDir% instead.Security First
Only use security-reducing arguments (like
--no-sandbox) in controlled environments where you understand the risks.Related Resources
- Launcher Configuration - Detailed launcher configuration reference
- Obsidian URI Documentation - Official URI scheme documentation
- Chromium Command-Line Switches - Full list of Chromium flags
- File Structure - Understanding the portable directory structure
