trans-cli-go

CLI tool for Trans

MIT License

Stars
1

trans-cli

Command Line Interface for Trans Server

branch Travis status
master Build Status
develop Build Status

Installation

brew install nwtgck/homebrew-trans/trans

Send/Get File

Commands bellow are examples of sending/getting.

Send

trans send ./my_video.mp4

Get

trans get jht

(File ID, jht is saved as jht file in $PWD)

Other Usages

Change Server

Command bellow sets Trans Server URL to https://trans-akka.herokuapp.com.

trans use https://trans-akka.herokuapp.com

Use trans config server to print server URL.

Delete a file

trans delete jht

Parallel Download

Use -p or --parallel for parallel download.

trans get -p jht

Safe Sending with Long ID

Use -l or --id-length to specify File ID length.

$ trans send -l 32 my_video.mp4
mn6pbf8jtxfvesct8zcpzwbxe4e5i85v

Safe Sending with Limit

Use -t or --get-times to specify download-limit.

$ trans send -t 1 my_video.mp4
ab2

Safe Sending with Store Duration

Use --duration to specify store duration.

$ trans send --duration=30s my_video.mp4
ab2

Other Flags

Use trans send -h to know more information.

$ trans send -h
Send a file

Usage:
  trans send [flags]

Flags:
      --deletable           whether file is deletable or not (default true)
      --delete-key string   key for deletion
      --duration string     store duration (e.g. 10s, 5m, 12h, 3d) (default "1h")
  -t, --get-times int       download limit (e.g. 1, 10) (default 100)
  -h, --help                help for send
  -l, --id-length int       length of ID (e.g. 3, 10) (default 3)
  -q, --quiet               disable progress bar or not

Global Flags:
  -s, --server string   Trans Server URL

Configuration

Server alias

Here is examples to set aliases

trans config alias heroku https://trans-akka.herokuapp.com
trans config alias ibm https://trans-akka.mybluemix.net

Then, you can set server like trans use heroku or trans use ibm.