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

About the developer

mattt
210 Stars 14 Forks MIT License 33 Commits 0 Opened issues

Description

Command Line & Ruby Interface to Mac OS X Sharing Services

Services available

!
?

Need anything else?

Contributors list

# 293
Objecti...
Swift
Xcode
codable
25 commits
# 3,262
Ruby
Homebre...
pinboar...
Lua
1 commit
# 294,578
Shell
collabo...
TeX
Erlang
1 commit

This library is no longer being maintained.

terminal-share

macOS Sharing Services... as a Service

Mac OS X 10.8 Mountain Lion introduced built-in sharing as a system-level feature with programmatic access provided via the

NSSharingService
APIs.

terminal-share
extends access to these APIs by proxying through a simple command-line application.

Installation

Install

terminal-share
by running the following command from Terminal:
$ gem install terminal-share

This will also install the

terminal-share
executable.
require 'terminal-share'

TerminalShare.share(:twitter, text: "This was shared from the command-line, courtesy of terminal-share, by @mattt", url: "https://github.com/mattt/terminal-share")

Screenshot

Command Line

$ terminal-share -service NAME              \
                [-text text]                \
                [-image /path/to/image]     \
                [-video /path/to/video]     \
                [-url "http://example.com"]

Arguments

  • service
    : (Required) A short string corresponding to the name of a particular
    NSSharingService
    to be used. Available values:
    • twitter
      -
      NSSharingServiceNamePostOnTwitter
    • sinaweibo
      -
      NSSharingServiceNamePostOnSinaWeibo
    • email
      -
      NSSharingServiceNameComposeEmail
    • message
      -
      NSSharingServiceNameComposeMessage
    • airdrop
      -
      NSSharingServiceNameSendViaAirDrop
    • readinglist
      -
      NSSharingServiceNameAddToSafariReadingList
    • iphoto
      -
      NSSharingServiceNameAddToIPhoto
    • aperture
      -
      NSSharingServiceNameAddToAperture
    • facebook
      -
      NSSharingServiceNamePostOnFacebook
    • flickr
      -
      NSSharingServiceNamePostImageOnFlickr
    • vimeo
      -
      NSSharingServiceNamePostVideoOnVimeo
    • youku
      -
      NSSharingServiceNamePostVideoOnYouku
    • tudou
      -
      NSSharingServiceNamePostVideoOnTudou
  • text
    : (optional) Text to be shared.
  • image
    : (optional) File path to an image to be shared.
  • video
    : (optional) File path to a video to be shared.
  • url
    : (optional) URL to be shared.

Not all services support sharing of all types of content. See the NSSharingService Documentation for additional guidelines.

Example

$ terminal-share -service twitter \
                 -text "This was shared from the command-line,  \
                        courtesy of terminal-share, by @mattt"  \
                 -url "https://github.com/mattt/terminal-share"

Creator

Mattt (@mattt)

Credit

Thanks to Eloy Durán for his work on

terminal-notifier
, which provides a great example of how to use the Script Bridge APIs.

License

terminal-share is available under the MIT license. See the LICENSE file for more info.

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.