shikiphp

Languages

shikiphp bundles the full Shiki language set — every grammar from tm-grammars (200+ languages). These are the same TextMate grammars VS Code and Shiki tokenize with, so language coverage, aliases, and scope names match.

You reference a language by its Shiki id or one of its aliases — for example ts or typescript, js or javascript, php, rust, python, html, yaml, json, and so on.

The special id 'ansi' is not a grammar; it highlights terminal output. See ANSI.

Listing the bundled languages

From PHP, ask the highlighter:

use Shikiphp\Shikiphp;

$highlighter = Shikiphp::highlighter();

$highlighter->bundledLanguages(); // list<string> — ids shipped in the box
$highlighter->loadedLanguages();  // list<string> — bundled plus any you registered

Or from the command line:

vendor/bin/shikiphp langs

Adding your own

Need a language that is not bundled, or a private grammar? Register it with loadGrammar. See Custom languages and themes.

On this page