Need help with sman?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

228 Stars 17 Forks GNU General Public License v3.0 70 Commits 3 Opened issues


:bug: Command-line snippet manager

Services available


Need anything else?

Contributors list


Build Status

A command-line snippet manager in Go



bash -c "$(curl"


  • Build with Go

    go get -v
  • Add to your rc:

    [ -f $GOPATH/src/  ] && source $GOPATH/src/
  • Optionally copy demo snippets dir or create yours:

    cp -r $GOPATH/src/ ~/

Snippets Examples


smtp:server: # snippet name do: exec # copy or exec desc: smtp server in python. Prints mails to stdout command: python -m smtpd -n -c DebuggingServer localhost:1025


Sman will ask input for placeholder <>

tcpdump:port: do: copy desc: listen traffic on port command: tcpdump -nqt -s 0 -A -i eth0 port <>


To execute multiline commands, separate lines by semi-colon

curl:upload: do: exec command: > gpg -c <>; curl --upload-file <>.gpg<>.gpg

  • You can export command to a separate file located at:


  • Include placeholder anywhere within snippet command
  • Name is the only mandatory field
  • You can have multiple placeholders with the same name. After input all of them will be replaced
  • Use
    to escape comma in options

Usage Examples

Run snippet

s run [-f ]  [-t ]  [placeholder values...] [-cxyp]
~|⇒ s run -f shell curl:upload test.tar.gz -x
gpg -c test.tar.gz; curl --upload-file test.tar.gz.gpg
Execute Snippet? [Y/n]:
~|⇒ s run curl:ip
Execute Snippet? [Y/n]:

Show snippet

s show [-f ] [-t ] 

List and search snippets

s ls [-f ] [-t ] []
  • Pattern is matched against snippet name, command and description

List and search snippets for scripts

  • Use the
    flag to produce machine-readable output for scripting.
$ s ls service:disable --porcelain
shell   service:disable ubuntu  disable service on ubuntu

$ s ls add --porcelain | cut -f 2 | xargs echo vhost:add user:add alias:add sshconfig:add user:group

  • The output is
    -separated. The colums are:
    1. Snippet file
    2. Snippet name
    3. Tags (
    4. Description

Fuzzy search file and snippet name:

# `r` is alias for `run`
# matches file `mysql` and snippet `database:dump`

~|⇒ s r -f sql dmp

mysqldump -uuser --lock-tables=[lock] -p[pass] -h [host] [database] > [database].sql


# Append history can be useful to avoid re-entering all placeholders when you need to change single parameter.
# Snippet directory
export SMAN_SNIPPET_DIR="~/snippets"
# Ask confirmation before executing
# Set shell color of groups in ls, see
export SMAN_LS_COLOR_FILES=1,4,35


Install vim plugin for better snippets colors:

  • Pathogen
    • git clone ~/.vim/bundle/vim-sman
  • vim-plug
    • Plug 'tokozedg/vim-sman'
  • NeoBundle
    • NeoBundle 'tokozedg/vim-sman'
  • Vundle
    • Plugin 'tokozedg/vim-sman'


If you'd like to contribute, please fork the repository and make changes as you'd like. Pull requests are warmly welcome, especially if you make a good snippet file.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.