Script Viewer

by Viggo Meesters
5
4
3
2
1
New Plugin

Description

This plugin has not been manually reviewed by Obsidian staff. Open shell, batch, PowerShell, and AutoHotkey files as read-only source with outline, search, and safety hints.

Reviews

No reviews yet.

Stats

stars
downloads
0
forks
0
days
NaN
days
NaN
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
0
commits

Latest Version

Invalid date

Changelog

README file from

Github

Script Viewer

Script Viewer is a read-only Obsidian plugin for inspecting script files and safe dotfiles without turning them into runnable actions. It opens .sh, .bash, .zsh, .bat, .cmd, .ps1, .ahk, .command, .bats, .env*, .gitignore, .dockerignore, .gitattributes, .gitmodules, .npmrc, .nvmrc, and .yarnrc files with line-numbered source, lightweight syntax hints, outline extraction, search, filtering, and safety-focused summaries.

Script Viewer preview

Features

  • Opens the supported script extensions and known dotfiles listed above.
  • Routes .env*, .gitignore, and other supported dotfiles by file name so they do not fall through to external viewers.
  • Shows stable line numbers with a soft-wrap toggle.
  • Detects shebangs and likely interpreters.
  • Builds a lightweight outline for shell functions, labels, trap/alias/export/set statements, PowerShell functions, AutoHotkey hotkeys, dotenv keys, and ignore/config patterns.
  • Highlights comments, strings, variables, command substitutions, paths, URLs, flags, keywords, and risky command patterns.
  • Searches source lines and filters outline items.
  • Keeps source visible even when syntax is unfamiliar.
  • Applies a 10,000 line render cap to keep large scripts responsive.
  • Stays read-only by design: it never executes scripts, starts terminals, mutates files, reads the clipboard, or makes network requests.

Positioning

Existing community options cover broader code workflows:

  • Code View provides broad read-only syntax highlighting for many languages.
  • Code Files is editor-first and Monaco-based.
  • Code Space is a broader code workspace.

Script Viewer is intentionally narrower. It focuses on risky automation artifacts and makes interpreter, environment-variable, executable-looking command, and safety hints visible without providing editing or execution affordances.

Why never-execute?

Script files can delete data, alter system settings, call remote endpoints, or launch other programs. This plugin is for inspection only. It does not execute code, start subprocesses, open terminals, change permissions, lint, format, save, or call external applications.

Parser strategy

Script Viewer uses local heuristics instead of full language parsers. It detects common shell, batch, PowerShell, AutoHotkey, dotenv, ignore-file, and small config-file structures while avoiding hard failures. If a line is unknown, it remains visible as source.

Development

npm install
npm run build
npx tsc --noEmit
npm test

Release files

The runtime files are:

  • main.js
  • manifest.json
  • styles.css

Manual installation

  1. Download main.js, manifest.json, and styles.css from the latest release.
  2. Create this folder in your vault: .obsidian/plugins/script-viewer/.
  3. Put the downloaded files in that folder.
  4. Reload Obsidian.
  5. Enable Script Viewer in Settings -> Community plugins.

License

MIT