Terminal Output

Styled command-line output with automatic prompt and status detection


Terminal Output

Terminal renders command-line sessions with automatic detection of prompts, success messages, errors, warnings, and URLs.

Basic Usage

$ npm install
added 142 packages in 3.2s

$ npm run dev
Server started on http://localhost:3000

Syntax:

:::terminal
$ command here
output here
:::
Markdown

Prompt Styles

Different prompt characters are recognized:

$ echo "Standard user prompt"
Standard user prompt
# echo "Root prompt"
Root prompt
> Write-Output "PowerShell prompt"
PowerShell prompt

Status Detection

The terminal automatically color-codes output:

$ npm test
Running 42 tests...
✓ All tests passed
✗ 2 snapshots failed
WARNING: deprecated API usage detected
ERROR: connection refused on port 5432
  • $, #, > --- Command prompts
  • , SUCCESS:, successfully --- Success (green)
  • , ERROR:, failed --- Error (red)
  • , WARNING: --- Warning (yellow)
  • URLs (http://, https://) --- Highlighted links

Multi-Command Sessions

$ git add .
$ git commit -m "feat: add search"
[main abc1234] feat: add search
 3 files changed, 142 insertions(+)
$ git push origin main
Enumerating objects: 8, done.
remote: Resolving deltas: 100% (3/3)
To github.com:user/repo.git
   def5678..abc1234  main -> main

Best Practices

  • Use $ for standard user commands, # for root commands
  • Show realistic output so readers know what to expect
  • Include error output when documenting troubleshooting steps