Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/patrik-csak/mac-terminal. Control the macOS Terminal app with Node.js npmx.dev/package/mac-terminal
Something went wrong. Try again.
Files
Verified signature Signed by ptrkc.sk SHA256:CHPL2WkouRhWExuvdx+OMAD24mgK23GwjXdtnLeUUb0 Click to copy SHA
- JavaScript 100%
readme.md
mac-terminal #
Control the macOS Terminal app with Node.js
Install #
npm install mac-terminal
API #
getTerminalDefaultProfilegetTerminalProfilesisTerminalRunningsetTerminalDefaultProfilesetTerminalProfile
getTerminalDefaultProfile() #
Get the default Terminal profile
Signature #
function getTerminalDefaultProfile(): Promise<string>;
Example #
import {getTerminalDefaultProfile} from 'mac-terminal';
await getTerminalDefaultProfile(); // 'Clear Dark'
getTerminalProfiles() #
Get the list of installed Terminal profiles
Signature #
function getTerminalProfiles(): Promise<string[]>;
Example #
import {getTerminalProfiles} from 'mac-terminal';
await getTerminalProfiles(); // ['Basic', 'Clear Dark', 'Clear Light', ...]
isTerminalRunning() #
Determine whether Terminal is currently running
Signature #
function isTerminalRunning(): Promise<boolean>;
Example #
import {isTerminalRunning} from 'mac-terminal';
await isTerminalRunning(); // true
setTerminalDefaultProfile() #
Update the default Terminal profile
Signature #
function setTerminalDefaultProfile(profile: string): Promise<void>;
Example #
import {setTerminalDefaultProfile} from 'mac-terminal';
await setTerminalDefaultProfile('Clear Dark');
setTerminalProfile() #
Update the Terminal profile for all open tabs and windows, and optionally update the default profile at the same time
Signature #
function setTerminalProfile({
profile: string,
setDefault?: boolean = false
}): Promise<void>;
Examples #
import {setTerminalProfile} from 'mac-terminal';
await setTerminalProfile({profile: 'Clear Dark'});
await setTerminalProfile({
profile: 'Clear Dark',
setDefault: true, // Also set as the default profile
});
Related #
- auto-terminal-profile – Automatically switch Terminal profiles when macOS dark/light mode changes