I Built a Command Manager for the Terminal (And You Might Need It Too)

Published: (March 16, 2026 at 02:36 AM EDT)
3 min read
Source: Dev.to

Source: Dev.to

Cover image for I Built a Command Manager for the Terminal (And You Might Need It Too)

GitHub:

The Problem

As developers we use the terminal constantly, but our command workflows are messy:

  • Shell history is hard to navigate and doesn’t persist well.
  • Aliases are session‑specific and don’t handle complex scripts.
  • Documentation gets outdated or lost in random files.
  • Scripts are scattered across different directories.

We need a better way to manage our command toolkit.

Introducing Pock

Pock is a command manager that works like bookmarks for your terminal. Save any command with a simple name, run it instantly, and keep a full history of executions.

Quick Start

# Install (macOS)
brew install pock  # (coming soon)
# Or download from releases

# Save a command
pock add deploy "git push origin main"

# Run it
pock run deploy

# View all saved commands
pock list

Core Features

1. Save Commands and Scripts

# Save inline commands
pock add sync-db "pg_dump production | psql development"

# Save script files (content is stored)
pock add release ./scripts/release.sh -d "Production release"

2. Execution History

Every command run is logged with:

  • Timestamp
  • Exit code
  • Full stdout/stderr output
  • Execution duration
pock history deploy --output

3. Import / Export

Share command libraries with your team:

# Export your commands
pock export my-commands.json

# Team members import them
pock import my-commands.json

Why Go?

  • Single binary distribution (no dependencies)
  • Great CLI tooling (Cobra, Viper)
  • Cross‑platform compilation
  • Fast startup time
  • Easy to install

Technical Architecture

pock/
├── cmd/           # Cobra commands
├── internal/
│   ├── storage/   # SQLite database layer
│   └── helpers/    # Config and utilities
└── pkg/           # Public packages
  • Storage: SQLite (via bbolt/bolt) for local data
  • CLI Framework: Cobra + Viper
  • Output Capture: Custom exec wrapper

Real‑World Usage

# Development workflow
pock add dev "docker-compose up -d && npm run dev"
pock add test "npm run lint && npm test && npm build"

# Database tasks
pock add db-backup "./scripts/backup-db.sh"
pock add db-reset "dropdb myapp && createdb myapp && npm run migrate"

# Deployment
pock add deploy-staging "./deploy.sh staging"
pock add deploy-prod "./deploy.sh production"

What’s Next?

  • Community marketplace for sharing commands
  • Command scheduling / cron integration
  • Team collaboration features
  • VS Code extension
  • Web UI for command management

Try It Out!

Installation

# macOS
curl -L https://github.com/ddev94/pock/releases/download/v1.0.1/pock-1.0.1.pkg -o pock-1.0.1.pkg
open pock-1.0.1.pkg

# Linux
wget https://github.com/ddev94/pock/releases/download/v1.0.1/pock-1.0.1-1.x86_64.tar.gz
tar -xzf pock-1.0.1-1.x86_64.tar.gz
sudo cp pock-1.0.1/usr/local/bin/pock /usr/local/bin/

GitHub:

Feedback Welcome!

I’d love to hear:

  • What commands would you save first?
  • What features are missing?
  • Any bugs or issues you encounter

Drop a comment or open an issue on GitHub! ⭐

Built with Go. Open source (ISC License). Privacy‑focused.

0 views
Back to Blog

Related posts

Read more »

Getting Started with tmux

Introduction An introduction to tmux, a terminal multiplexer. Session Management - Start tmux bash tmux or tmux new-session - Create a new session within a ses...

Terminal Tip 🤩 fcopy, fcut, fpaste

Introduction If you are like me and love the terminal, start using fcopy, fcut, fpaste. Instead of copying through a file explorer, you can do: bash fcopy some...