Your first action

Your first action

  1. Open Actions in the Glimpse sidebar and click Open Folder.
  2. Save this file there as Ask.sh:
    Ask.sh
    #!/bin/bash
    # @glimpse.description Answers a question with the writing model on this computer.
    # @glimpse.shortcut Control+Alt+Space
    glimpse llm "Answer in at most three sentences." --local
    On Windows, save it as Ask.cmd:
    Ask.cmd
    :: @glimpse.description Answers a question with the writing model on this computer.
    :: @glimpse.shortcut Control+Alt+Space
    glimpse llm "Answer in at most three sentences." --local
  3. It appears on the Actions screen, switched off. Turn it on.
  4. Hold Control+Alt+Space, ask a question, and let go. The answer shows as a notice.
  5. To change the key, open Settings, General. The action's shortcut is listed under its name. Change it there and Glimpse rewrites the line in the file.
  6. To test without speaking, run it from Terminal:
    glimpse actions run Ask "what is the capital of Australia" --headless
    It prints what you would have seen:
    Ask  run, 383 ms, exit 0, headless
    toast  Ask: The capital of Australia is Canberra.

Good to know

  • New files start switched off. The switch turns on the action's shortcut, phrase and events. Running it by name with glimpse actions run works either way.
  • Click an action on the Actions screen to show its file in Finder (File Explorer on Windows). Right-click it, or Shift-click, to move it to the Trash.
  • Problems with a file, like a typo in a header line, a phrase another action uses, or a program that isn't installed, show on its card in amber, and in glimpse actions list.
  • Scripts Glimpse runs can always use glimpse. To use it from your own Terminal, install it in Settings, About, Command line.
  • The folder is ~/Library/Application Support/com.glimpse.data/actions on Mac and %APPDATA%\com.glimpse.data\actions on Windows.

Start your own

Pick a language, how it runs and where the answer goes. Copy the file into the Actions folder, then change the instruction or replace the script. Shell runs on Mac and PowerShell on Windows. Every header line is in the reference.

Shorter.py
#!/usr/bin/env python3
# @glimpse.description Rewrites what you said, shorter.
# @glimpse.shortcut Control+Alt+J
# @glimpse.show insert
import subprocess, sys

text = sys.stdin.read().strip()
reply = subprocess.run(
    ["glimpse", "llm", "Rewrite this shorter. Reply with only the text.", "--local"],
    input=text, capture_output=True, text=True,
)
if reply.returncode:
    sys.exit(reply.stderr.strip() or "glimpse llm failed")
print(reply.stdout.strip())