A secure CLI tool for storing and executing commonly used commands with parameter templating and secrets management.
Shed is a command-line interface (CLI) tool designed to help developers and system administrators store, organize, and execute frequently used commands. It features parameter templating, integrated secrets management, and encrypted storage using SQLCipher.
- Command Storage: Save commonly used commands with descriptive names
- Parameter Templating: Define parameters in commands using
{{name|description}}syntax - Secrets Management: Store sensitive information securely and reference with
{{!key}}syntax - Encrypted Database: All data is stored in an encrypted SQLite database using SQLCipher
- Command Operations: Add, list, edit, copy, describe, and remove commands
- Cross-Platform: Supports Linux, macOS, and Windows
Download the latest release for your platform from the Releases page:
shed-linux-amd64- Linux (x86_64)shed-darwin-amd64- macOS (Intel)shed-darwin-arm64- macOS (Apple Silicon)shed-windows-amd64.exe- Windows (x86_64)
Make the binary executable (Linux/macOS):
chmod +x shed-*
sudo mv shed-* /usr/local/bin/shedRequirements:
- Go 1.25.1 or later
- GCC (for CGO/SQLCipher support)
- SQLCipher development libraries
# Clone the repository
git clone https://github.com/H3JFC/shed.git
cd shed
# Build
go build -tags="sqlcipher,linux" -o shed main.go
# Install (optional)
sudo mv shed /usr/local/bin/Platform-specific build tags:
- Linux:
-tags="sqlcipher,linux" - macOS:
-tags="sqlcipher,darwin" - Windows:
-tags="sqlcipher,windows"
# Initialize shed (creates configuration and database)
shed init
# Add a simple command
shed add hello "echo 'Hello, World!'"
# Add a command with parameters
shed add greet "echo 'Hello, {{name|person's name}}!'" -d "Greet someone"
# List all commands
shed list
# Run a command (will prompt for parameters)
shed run greet
# Add a secret
shed secret add api_key
# Add a command using a secret
shed add deploy "curl -H 'Authorization: Bearer {{!api_key}}' https://api.example.com/deploy"Initialize shed configuration and database.
shed initAdd a new command to shed.
# Basic command
shed add list_files "ls -la"
# Command with parameters
shed add list_dir "ls -la {{path|directory path}}" -d "List directory contents"
# Command with multiple parameters
shed add git_commit "git add . && git commit -m '{{message|commit message}}' && git push {{branch|branch name}}"
# Command with secrets
shed add deploy "kubectl apply -f {{file|manifest file}} --token={{!k8s_token}}"Parameter Syntax: {{name|description}}
name: Parameter identifier (used internally)description: Optional human-readable description shown in prompts
Secret Syntax: {{!key}}
key: The secret key stored in shed
Options:
-d, --description: Description of the command
List all stored commands.
shed listOutput includes:
- Command name
- Command string
- Description
- Parameters (with descriptions)
- Created/Updated timestamps
Execute a stored command.
shed run greet '{"name":"John"}'
# Executes: echo 'Hello, John!'Show detailed information about a command.
shed describe git_commitEdit an existing command.
shed edit greet
# Opens editor to modify command and descriptionCopy a command to a new name.
shed cp greet welcomeRemove a command.
shed rm old_commandSecrets are stored encrypted in the database and can be referenced in commands.
Add a new secret.
shed secret add github_token -d "GitHub Personal Access Token"
# Prompts for secret value (input hidden)Options:
-d, --description: Description of the secret
List all secrets (values are hidden).
shed secret listUpdate a secret's value or description.
shed secret edit github_tokenRemove a secret.
shed secret rm old_api_keyShed looks for configuration in the following locations (in order):
$SHED_DIRenvironment variable~/.config/shed/(Linux/macOS)~/Library/Application Support/shed/(macOS)%APPDATA%\shed\(Windows)
The configuration file is config.toml:
[shed-db]
location = "/path/to/shed.db"
password = "encryption-key"SHED_DIR: Override default configuration directorySHED_SHED_DB_LOCATION: Override database locationSHED_SHED_DB_PASSWORD: Override database encryption key
Global flags:
--shed-dir: Path to shed configuration directory-v, --verbose: Enable verbose logging
Shed uses SQLCipher (encrypted SQLite) with the following schema:
- commands: Stores command definitions
- id, name, command, description, created_at, updated_at
- parameters: Stores command parameters
- id, command_id, name, description, position
- secrets: Stores encrypted secrets
- id, key, value (encrypted), description, created_at, updated_at
- Encryption: All data is encrypted at rest using SQLCipher
- Secret Storage: Secrets are double-encrypted within the database
- Password Protection: Database requires an encryption key
- No Plaintext: Secrets are never stored or logged in plaintext
- Go 1.25.1+
- GCC/Clang (for CGO)
- SQLCipher development libraries
- Make (optional, for using Makefile)
# Clone repository
git clone https://github.com/H3JFC/shed.git
cd shed
# Install dependencies
go mod download
# Run tests
make test
# Run tests with coverage
make test-coverage
# Build
make build
# Run linter
make lintshed/
├── cmd/ # Command definitions
│ ├── command/ # Command management commands
│ ├── secret/ # Secret management commands
│ ├── init.go # Initialization command
│ └── root.go # Root command and CLI setup
├── internal/ # Internal packages
│ ├── commands/ # Command execution logic
│ ├── config/ # Configuration management
│ ├── execute/ # Command execution engine
│ ├── logger/ # Logging utilities
│ └── store/ # Database operations
├── migrations/ # Database migrations
├── main.go # Application entry point
└── go.mod # Go module definition
# Run all tests
go test ./...
# Run tests with coverage
go test -cover ./...
# Run specific test
go test -v ./internal/store/...- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
If you get SQLCipher errors during build:
Linux:
sudo apt-get install libsqlcipher-devmacOS:
brew install sqlcipherWindows: Use MSYS2:
pacman -S mingw-w64-x86_64-sqlcipherEnsure shed is initialized:
shed initOr set the SHED_DIR environment variable:
export SHED_DIR="/path/to/config"This project is dual-licensed:
- AGPL-3.0: For open-source use (see LICENSE.md)
- Commercial License: For proprietary use (see COMMERCIAL-LICENSE.md)
- Cobra - CLI framework
- Viper - Configuration management
- SQLCipher - Encrypted SQLite
- golang-migrate - Database migrations
- GitHub: @H3JFC
- Issues: GitHub Issues
