Running Ad-hoc Commands

Sometimes you need to run something once without cluttering your command library. Ad-hoc commands give you that flexibility.

Edition limits: The personal edition includes 10 ad-hoc commands in history. The full edition has unlimited ad-hoc command history.

What Are Ad-hoc Commands?

Ad-hoc commands let you run quick, one-off terminal commands without saving them to your command library. Perfect for:

  • Quick tests or experiments
  • One-time tasks
  • Commands you don't need to repeat

Running an Ad-hoc Command

  1. Press ⌘K to open the Command Palette
  2. Type your command directly in the search field
  3. Select Run Command to execute immediately

The command runs immediately and appears in the sidebar like any other process.

Example: Open the palette, type ls ., and select "Run Command".

Command History

Command Book remembers your ad-hoc command history:

  • Recent commands appear in the ad-hoc dialog
  • Click a previous command to reuse it
  • History persists across app restarts

Converting to Saved Commands

If you find yourself running the same ad-hoc command frequently, you can promote it to a full saved command:

  1. Run the ad-hoc command
  2. Right-click on the running process in the sidebar
  3. Select Promote to Saved Command
  4. Edit the name, working directory, and settings as needed
  5. Click Save

This lets you add a proper name, working directory, environment variables, and auto-restart settings.

Differences from Saved Commands

Feature Saved Commands Ad-hoc Commands
Persistent Yes No
Auto-restart Available Not available
Environment vars Configurable Uses shell defaults
Custom icons Available Not available
Run in Terminal Available Not available
History Always available Recent commands only
Personal edition 5 commands 10 in history
Full edition Unlimited Unlimited

Use Cases

Quick file operations:

tail -f /var/log/system.log

Testing a new tool:

npx create-react-app test-project

Debugging PATH issues:

echo $PATH
which brew

Tip: Command Book excels at streaming output -- logs, servers, builds, and watchers. For commands that need interactive input or a real TTY, save them as a full command and use "Run in Terminal" to launch them in your preferred terminal emulator while keeping them organized in Command Book.