### Install Dependencies with Git Hooks Source: https://github.com/polyipseity/obsidian-terminal/blob/main/AGENTS.md Use this command to install project dependencies and set up Git hooks. It's the preferred method for initial setup. ```bash bun install ``` -------------------------------- ### Bourne Shell Example Source: https://github.com/polyipseity/obsidian-terminal/blob/main/README.md Example of configuring a Bourne shell profile for the terminal. ```bash sh ``` -------------------------------- ### Dash Shell Example Source: https://github.com/polyipseity/obsidian-terminal/blob/main/README.md Example of configuring a Dash shell profile for the terminal. ```bash dash ``` -------------------------------- ### Z Shell Example Source: https://github.com/polyipseity/obsidian-terminal/blob/main/README.md Example of configuring a Z shell profile for the terminal. ```bash zsh --login ``` -------------------------------- ### xterm Terminal Emulator Example Source: https://github.com/polyipseity/obsidian-terminal/blob/main/README.md Example of configuring xterm as a terminal emulator. ```bash xterm ``` -------------------------------- ### Windows Subsystem for Linux Shell Example Source: https://github.com/polyipseity/obsidian-terminal/blob/main/README.md Example of configuring a WSL shell profile, including specifying a distribution. ```bash wsl -d ``` -------------------------------- ### Command Prompt Shell Example Source: https://github.com/polyipseity/obsidian-terminal/blob/main/README.md Example of configuring the Windows Command Prompt shell profile for the terminal. ```cmd cmd ``` -------------------------------- ### Windows Terminal Emulator Example Source: https://github.com/polyipseity/obsidian-terminal/blob/main/README.md Example of configuring Windows Terminal as a terminal emulator. ```cmd wt ``` -------------------------------- ### PowerShell Core Shell Example Source: https://github.com/polyipseity/obsidian-terminal/blob/main/README.md Example of configuring a PowerShell Core shell profile for the terminal. ```powershell pwsh ``` -------------------------------- ### Force Build and Install Plugin to Vault Source: https://github.com/polyipseity/obsidian-terminal/blob/main/AGENTS.md Forcefully builds and installs the plugin, skipping format checks. Use when a standard install fails or for specific scenarios. ```bash bun run obsidian:install:force ``` -------------------------------- ### Bash Shell Example Source: https://github.com/polyipseity/obsidian-terminal/blob/main/README.md Example of configuring a Bash shell profile for the terminal. ```bash bash --login ``` -------------------------------- ### macOS Terminal Emulator Example Source: https://github.com/polyipseity/obsidian-terminal/blob/main/README.md Example of configuring the default macOS Terminal application as a terminal emulator, including passing the current working directory. ```bash /System/Applications/Utilities/Terminal.app/Contents/macOS/Terminal "$PWD" ``` -------------------------------- ### iTerm2 Terminal Emulator Example Source: https://github.com/polyipseity/obsidian-terminal/blob/main/README.md Example of configuring iTerm2 as a terminal emulator, including passing the current working directory. ```bash /Applications/iTerm.app/Contents/MacOS/iTerm2 "$PWD" ``` -------------------------------- ### Development Build Command Source: https://github.com/polyipseity/obsidian-terminal/blob/main/AGENTS.md Starts a development build with watch capabilities. Ideal for active development to see changes reflected quickly. ```bash bun run dev ``` -------------------------------- ### Git Bash Shell Example Source: https://github.com/polyipseity/obsidian-terminal/blob/main/README.md Example of configuring a Git Bash shell profile, including the path to the executable. ```bash C:\Program Files\Git\bin\bash.exe --login ``` -------------------------------- ### Localization String Example Source: https://github.com/polyipseity/obsidian-terminal/blob/main/AGENTS.md Example of a localization string used for internationalization. It includes a placeholder for dynamic content. ```json "welcome": "Welcome, {{user}}" ``` -------------------------------- ### Windows PowerShell Shell Example Source: https://github.com/polyipseity/obsidian-terminal/blob/main/README.md Example of configuring the Windows PowerShell shell profile for the terminal. ```powershell powershell ``` -------------------------------- ### Example Changeset File Source: https://github.com/polyipseity/obsidian-terminal/blob/main/README.md An example of a changeset file used for managing changelogs. It specifies the type of change and a description, including PR and author information. ```Markdown --- "example": patch --- This is an example change. ([GH#1](https://github.com/ghost/example/pull/1) by [@ghost](https://github.com/ghost)) ``` -------------------------------- ### Build and Install Plugin to Vault Source: https://github.com/polyipseity/obsidian-terminal/blob/main/AGENTS.md Builds the plugin and installs it into a specified Obsidian vault. Replace `` with the actual vault path. ```bash bun run obsidian:install ``` -------------------------------- ### Install Obsidian Plugin via Bun Source: https://github.com/polyipseity/obsidian-terminal/blob/main/AGENTS.md Use this command to install the Obsidian plugin, specifying the path to your Obsidian vault. ```sh # Preferred bun run obsidian:install D:/path/to/vault ``` -------------------------------- ### Synchronize Python Dependencies Source: https://github.com/polyipseity/obsidian-terminal/blob/main/AGENTS.md Installs development and platform event-loop extras for the Python environment using uv. Use '--locked' in CI for reproducible builds. ```bash uv sync ``` -------------------------------- ### Conventional Commit Message Example Source: https://github.com/polyipseity/obsidian-terminal/blob/main/AGENTS.md An example of a commit message that follows the Conventional Commits standard, including a concise header and a detailed body with references. ```text refactor(eslint): remove @eslint/compat, eslintrc, js; update Prettier rules - Removed @eslint/compat, @eslint/eslintrc, @eslint/js from config and lockfiles - Updated Prettier to v3 and adjusted markdownlint config for new plugin - Cleaned up ESLint overrides and Svelte linting comments Refs: lint config modernization ``` -------------------------------- ### Example of Nested Translation Key Reference Source: https://github.com/polyipseity/obsidian-terminal/blob/main/assets/locales/README.md This example demonstrates how a nested translation key like 'youtu.be./dQw4w9WgXcQ' refers to a specific string within the JSON structure. This is useful for understanding how to navigate and reference localized strings. ```JSONc { // ... "youtu": { // ... "be": { // ... "/dQw4w9WgXcQ": "I am 'youtu.be./dQw4w9WgXcQ'!", // ... }, // ... }, // ... } ``` -------------------------------- ### TypeScript Interface and Type Guard Example Source: https://github.com/polyipseity/obsidian-terminal/blob/main/AGENTS.md Demonstrates the preferred use of TypeScript interfaces for object shapes and type guards to safely check unknown values, avoiding `as` casting. ```typescript // preferred for object shapes interface Settings { openChangelogOnUpdate: boolean; noticeTimeout: number; } // prefer a type guard over `as` casting function isSettings(v: unknown): v is Settings { return ( typeof v === "object" && v !== null && "openChangelogOnUpdate" in v && typeof (v as any).openChangelogOnUpdate === "boolean" ); } // acceptable use of `type` for advanced type composition type JsonValue = string | number | boolean | null | JsonObject | JsonArray; ``` -------------------------------- ### Justified Dynamic Import in Tests Source: https://github.com/polyipseity/obsidian-terminal/blob/main/AGENTS.md Shows a justified dynamic import used in a test context, explaining its necessity for module isolation after mock setup. ```typescript // Necessary for isolation after we set up mocks const { loadDocumentations } = await import("../../src/documentations.js"); ``` -------------------------------- ### Run Full Test Suite Source: https://github.com/polyipseity/obsidian-terminal/blob/main/AGENTS.md Executes the complete test suite for the project. This is a comprehensive test run. ```bash bun test ``` -------------------------------- ### Production Build Command Source: https://github.com/polyipseity/obsidian-terminal/blob/main/AGENTS.md Executes a production build, including checks and the final build process. Use this for creating the distributable version of the plugin. ```bash bun run build ``` -------------------------------- ### Run Prettier for Formatting Source: https://github.com/polyipseity/obsidian-terminal/blob/main/README.md Use this command to format all code files according to Prettier rules. ```Shell bun run format ``` -------------------------------- ### Run markdownlint Source: https://github.com/polyipseity/obsidian-terminal/blob/main/README.md Use this command to check Markdown files for linting issues. ```Shell bun run markdownlint ``` -------------------------------- ### Development Watch Build Command Source: https://github.com/polyipseity/obsidian-terminal/blob/main/AGENTS.md Initiates a development build that watches for file changes. This is useful for rapid iteration during development. ```bash bun run build:dev ``` -------------------------------- ### Run Vitest Tests with Coverage Source: https://github.com/polyipseity/obsidian-terminal/blob/main/README.md Execute all unit tests using Vitest and generate a code coverage report. This is the default test command. ```Shell bun run test ``` -------------------------------- ### Run Unit Tests Only (Vitest CLI) Source: https://github.com/polyipseity/obsidian-terminal/blob/main/AGENTS.md Fast execution of unit tests, suitable for iterative development. Includes coverage. ```bash bun x vitest run "tests/**/*.spec.{js,ts,mjs}" --coverage ``` -------------------------------- ### TypeScript Static Imports Source: https://github.com/polyipseity/obsidian-terminal/blob/main/AGENTS.md Demonstrates the correct placement of type-only and runtime imports at the top of a TypeScript file, following any file-level documentation. ```typescript /** File header doc comment allowed here */ import type { Settings } from "../src/settings-data.js"; // type-only import at top import { loadSettings } from "../src/settings.js"; // runtime import at top // Avoid placing executable logic (e.g., side-effects) above imports. ``` -------------------------------- ### Run Integration Tests Only (Vitest CLI) Source: https://github.com/polyipseity/obsidian-terminal/blob/main/AGENTS.md Execute integration tests, which may be longer-running. Includes coverage. ```bash bun x vitest run "tests/**/*.test.{js,ts,mjs}" --coverage ``` -------------------------------- ### Run ESLint for Linting Source: https://github.com/polyipseity/obsidian-terminal/blob/main/README.md Use this command to lint all TypeScript/JavaScript code. It checks for code quality issues without auto-fixing. ```Shell bun run check ``` -------------------------------- ### Run Unit Tests (Non-Interactive) Source: https://github.com/polyipseity/obsidian-terminal/blob/main/AGENTS.md Executes unit tests using Vitest for the specified test files. This command is non-interactive. ```bash bun exec vitest run "tests/**/*.spec.{js,ts,mjs}" ``` -------------------------------- ### Check Prettier Formatting Source: https://github.com/polyipseity/obsidian-terminal/blob/main/README.md Use this command to check if all code files are formatted according to Prettier rules without making changes. ```Shell bun run format:check ``` -------------------------------- ### Run Vitest Tests Interactively Source: https://github.com/polyipseity/obsidian-terminal/blob/main/README.md Execute unit tests using Vitest in watch mode for an interactive development experience. ```Shell bun run test:watch ``` -------------------------------- ### Testing with Fake Timers Source: https://github.com/polyipseity/obsidian-terminal/blob/main/AGENTS.md Make timer-based tests deterministic by using `vi.useFakeTimers()` and controlling timer execution with `vi.runAllTimers()` or `vi.advanceTimersByTime()`. ```javascript vi.useFakeTimers() vi.runAllTimers() vi.advanceTimersByTime() ``` -------------------------------- ### Module Mocking and Resetting Source: https://github.com/polyipseity/obsidian-terminal/blob/main/AGENTS.md Isolate module-level mocks using `vi.doMock` or `vi.mock` combined with `vi.resetModules()`. Restore mocks between tests using `vi.restoreAllMocks()`. ```javascript vi.doMock vi.mock vi.resetModules() vi.restoreAllMocks() ``` -------------------------------- ### Run ESLint with Auto-Fix Source: https://github.com/polyipseity/obsidian-terminal/blob/main/README.md Use this command to automatically fix linting issues in TypeScript/JavaScript code. ```Shell bun run fix ``` -------------------------------- ### Mocking with vi.fn() Source: https://github.com/polyipseity/obsidian-terminal/blob/main/AGENTS.md Use `vi.fn()` for spies and stubs to easily inspect calls and reset behavior. For async operations, prefer `mockResolvedValue` or `mockRejectedValue`. ```javascript vi.fn().mockResolvedValue(x) vi.fn().mockRejectedValue(err) ``` -------------------------------- ### Typed Module Mocks Source: https://github.com/polyipseity/obsidian-terminal/blob/main/AGENTS.md Prefer `vi.mocked(...)` for typed module mocks to access members correctly and avoid `any` type casting. ```javascript vi.mocked(...) ``` -------------------------------- ### Add New Locale Entry Source: https://github.com/polyipseity/obsidian-terminal/blob/main/assets/locales/README.md When adding a new locale, create a new directory for its language tag and copy the English translation file. Then, add an entry to the language JSON file in the specified format, ensuring the list of languages is sorted alphabetically by language tag. ```JSONc { // ... "en": "English", "(your-language-tag)": "(Native name of your language)", "uwu": "Uwuish", // ... } ``` -------------------------------- ### Auto-fix Markdown Files Source: https://github.com/polyipseity/obsidian-terminal/blob/main/README.md Use this command to automatically fix linting issues in Markdown files. ```Shell bun run markdownlint:fix ``` -------------------------------- ### Check Commit Messages Source: https://github.com/polyipseity/obsidian-terminal/blob/main/README.md Use this command to check commit messages against conventional commit standards. ```Shell bun run commitlint ``` -------------------------------- ### Spying on Global Objects Source: https://github.com/polyipseity/obsidian-terminal/blob/main/AGENTS.md Use `vi.spyOn()` to observe calls to global objects like `console` or `process`, avoiding direct reassignment. ```javascript vi.spyOn() ``` -------------------------------- ### Sync Locale Keys Script Source: https://github.com/polyipseity/obsidian-terminal/blob/main/assets/locales/README.md Execute this Node.js script after adding or removing translation keys in the English locale file. It updates all other translation files and sorts their keys alphabetically. ```sh node scripts/sync-locale-keys.mjs ``` -------------------------------- ### Run Vitest in Non-Interactive Mode Source: https://github.com/polyipseity/obsidian-terminal/blob/main/AGENTS.md Ensures Vitest runs non-interactively, suitable for CI and automated scripts. Always use `vitest run` or the `--run` option. ```bash bun x vitest --run "tests/**/*.spec.{js,ts,mjs}" ``` -------------------------------- ### Toggle Focus on Last Terminal Shortcut Source: https://github.com/polyipseity/obsidian-terminal/blob/main/README.md Global keyboard shortcut to toggle focus on the last active terminal. Can be customized in hotkeys settings. ```text Ctrl+Shift+` ``` -------------------------------- ### Find in Terminal Shortcut Source: https://github.com/polyipseity/obsidian-terminal/blob/main/README.md Keyboard shortcut to find text within the terminal when the terminal is focused. This shortcut is also available on Apple devices. ```text Ctrl+Shift+F, Command+Shift+F (Apple) ``` -------------------------------- ### Clear Terminal Shortcut Source: https://github.com/polyipseity/obsidian-terminal/blob/main/README.md Keyboard shortcut to clear the terminal content when the terminal is focused. This shortcut is also available on Apple devices. ```text Ctrl+Shift+K, Command+Shift+K (Apple) ``` -------------------------------- ### Close Terminal Shortcut Source: https://github.com/polyipseity/obsidian-terminal/blob/main/README.md Keyboard shortcut to close the current terminal when the terminal is focused. This shortcut is also available on Apple devices. ```text Ctrl+Shift+W, Command+Shift+W (Apple) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.