Skip to main content

Terminal-only cross-platform text expander with global shortcut expansion.

Project description

Terminal Text Expander

A terminal-only, local-first text expander for macOS, Windows, and Linux.

Define shortcuts from your terminal, run the background daemon, and type triggers anywhere on your system: browsers, forms, editors, chat apps, terminals, job boards, and desktop apps.

When a trigger is followed by Space, Enter, or Tab, it expands into the saved text.

Website: https://text-expander-ms.lovable.app/
PyPI: https://pypi.org/project/text-expander/
GitHub: https://github.com/MadhuSaini22/text-expander

In examples, <space> means: press the Space bar on your keyboard.
Example: ;l<space> means type ;l, then press Space.

Why Use It?

Text Expander is useful when you repeatedly type the same links, messages, form answers, templates, or commands.

For Developers

If you work on a few repositories every day, you probably open the same pages again and again:

text-expander add ';repo' 'https://github.com/yourname/your-repo'
text-expander add ';issues' 'https://github.com/yourname/your-repo/issues'
text-expander add ';prs' 'https://github.com/yourname/your-repo/pulls'
text-expander add ';local' 'http://localhost:3000'

Then type:

;issues<space>

and it expands to your issues page.

You can also save repeated snippets:

text-expander add ';bug' 'Steps to reproduce:\nExpected:\nActual:'
text-expander add ';api' 'http://localhost:3000/api'
text-expander add ';review' 'Thanks for the PR. I left a few comments.'

For Job Seekers

If you apply on job boards regularly, save your common application details:

text-expander add ';l' 'https://www.linkedin.com/in/yourprofile/'
text-expander add ';g' 'https://github.com/yourname'
text-expander add ';w' 'https://yourportfolio.com'
text-expander add ';em' 'you@example.com'
text-expander add ';intro' 'Hi, I am a software engineer interested in this role.'

Use them on LinkedIn, Wellfound, Greenhouse, Lever, Workday, Google Forms, and other forms.

For Email and Support Templates

If you type the same emails or replies often:

text-expander add ';hello' 'Hi, thanks for reaching out. I am happy to help.'
text-expander add ';follow' 'Thanks for your time today. Here are the next steps:'
text-expander add ';sig' 'Best,\nYour Name'

Then type:

;hello<space>

For Everyday Forms

Save things like:

text-expander add ';addr' '123 Main Street, City, Country'
text-expander add ';phone' '+1 555 123 4567'
text-expander add ';cal' 'https://cal.com/yourname'
text-expander add ';bio' 'Short bio you use often.'

Install

Recommended:

pipx install text-expander
text-expander install

With pip:

python -m pip install text-expander
text-expander install

pip install only installs the CLI. Run text-expander install to register and start the background daemon.

Quick Test

Add a shortcut:

text-expander add ';t' 'hello from text expander'

Start the daemon:

text-expander start

Open any text input and type:

;t<space>

Expected result:

hello from text expander

If the browser captures Tab, test with Space first.

Commands

Add a Shortcut

Interactive:

text-expander add

Direct:

text-expander add ';l' 'https://linkedin.com/in/yourprofile'

Adds a trigger and replacement.

List Shortcuts

text-expander list

Shows all saved shortcuts.

Edit a Shortcut

text-expander edit ';l'

Opens your terminal editor so you can update the replacement text.

Delete a Shortcut

text-expander delete ';l'

Removes a saved shortcut.

Search Shortcuts

text-expander search linkedin

Searches triggers, replacements, and tags.

Start the Daemon

text-expander start

Starts the global keyboard listener in the background.

Stop the Daemon

text-expander stop

Stops the background listener.

Check Status

text-expander status

Shows whether the daemon is running and where data/log files are stored.

Diagnose Problems

text-expander doctor

Checks dependencies, snippets, daemon status, and macOS Accessibility permission.

Install Auto-Start

text-expander install

Registers Text Expander to run after login/restart and starts it immediately.

Uses:

  • macOS: LaunchAgent
  • Windows: Startup folder
  • Linux: systemd user service

Uninstall Auto-Start

text-expander uninstall

Stops the daemon and removes login/startup registration.

Import, Export, and Backup

text-expander export snippets.json
text-expander import snippets.json
text-expander backup

Use these to move shortcuts between machines or create a backup.

All Commands

text-expander add
text-expander list
text-expander edit ';l'
text-expander delete ';l'
text-expander search linkedin
text-expander install
text-expander uninstall
text-expander start
text-expander stop
text-expander status
text-expander doctor
text-expander run
text-expander startup install
text-expander startup uninstall
text-expander export snippets.json
text-expander import snippets.json
text-expander backup

OS Permissions

macOS

macOS requires Accessibility permission for global keyboard monitoring.

Open:

System Settings → Privacy & Security → Accessibility

Enable the terminal app that starts Text Expander, such as Terminal, iTerm, or VS Code.

You may also need:

System Settings → Privacy & Security → Input Monitoring

Then restart:

text-expander stop
text-expander start

Windows

If text-expander is not found after install, your Python Scripts folder may not be on PATH.

You can still run:

python -m text_expander --version
python -m text_expander install

For detailed PATH fixes, see USER_GUIDE.md.

Linux

Global keyboard capture depends on your desktop session.

X11 is more likely to work. Wayland may block global keyboard listeners by design.

Storage

Snippets and runtime files are stored locally:

  • macOS: ~/Library/Application Support/text-expander
  • Windows: %APPDATA%\text-expander
  • Linux: ~/.config/text-expander

Set a custom data directory:

TEXT_EXPANDER_HOME=/path/to/dir text-expander list

No cloud services are used.

Privacy

  • All snippets are stored locally.
  • No account is required.
  • No cloud sync is used.
  • No telemetry is sent.

Troubleshooting

Read the full guide:

USER_GUIDE.md

It covers:

  • pip not found
  • pipx not found
  • text-expander command not found
  • Windows PATH issues
  • macOS permissions
  • Linux Wayland notes
  • install/uninstall
  • testing shortcuts
  • duplicate expansion issues

Development

Install from this repository:

python3 -m venv .venv
. .venv/bin/activate
python -m pip install --upgrade pip setuptools wheel
pip install -e .

Run tests:

PYTHONPATH=src python -m unittest discover -s tests -v

Build package:

python -m pip install build twine
python -m build
python -m twine check dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

text_expander-0.1.1.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

text_expander-0.1.1-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file text_expander-0.1.1.tar.gz.

File metadata

  • Download URL: text_expander-0.1.1.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for text_expander-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4db4114f0865b8fb8ce6b8db3501918484260b15f97c3dd4e4b986c4baef49f3
MD5 545392e3fd4112fe574455e35a8f55e8
BLAKE2b-256 a94b07b7090bb1c710c3e5857760e527b9b0f84fdf85b8656be5142f77adeaa3

See more details on using hashes here.

Provenance

The following attestation bundles were made for text_expander-0.1.1.tar.gz:

Publisher: publish.yml on MadhuSaini22/text-expander

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file text_expander-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: text_expander-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for text_expander-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a2fa66954d6c7945fccb35fa9394b4f5034d18d33f9ec8d59a8028f45fa471c9
MD5 8d423bfafb2dfa64432806179583c9a4
BLAKE2b-256 9434989096417070353ec016a1831109e7b5c8d3a4259577b77d344c8fa9d68c

See more details on using hashes here.

Provenance

The following attestation bundles were made for text_expander-0.1.1-py3-none-any.whl:

Publisher: publish.yml on MadhuSaini22/text-expander

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page