项目作者: brookisme

项目描述 :
Sublime-Remote: CLI for managing multiple SublimeSFTP config files
高级语言: Python
项目地址: git://github.com/brookisme/sublr.git
创建时间: 2018-04-11T04:55:33Z
项目社区:https://github.com/brookisme/sublr

开源协议:

下载


SUBLIME REMOTE: A companion to SublimeSFTP

CLI for managing multiple SublimeSFTP config files

SUBLIME-SFTP makes it easy to sync your local Sublime with a remote instance. However, when using multiple remote instances, such as a CPU for development and GPU for training, it can get be bit cumbersome. Sublime-Remote is a CLI to make that easy.


INSTALL
  1. git clone https://github.com/brookisme/sublr.git
  2. cd sublr
  3. pip install -e .

USAGE
  1. # create configurations for a cpu and gpu
  2. sublr create cpu 12.345.678.910 path/to/code/base
  3. sublr create gpu 10.987.654.321 path/to/code/base
  4. # turn on syncing with the cpu
  5. sublr init cpu
  6. # turn off syncing
  7. sublr off
  8. # remove config for the gpu
  9. sublr remove gpu
  10. # open a port for the current remote in web-browser
  11. sublr open

DOCS
  1. $ sublr --help
  2. Usage: sublr [OPTIONS] COMMAND [ARGS]...
  3. Options:
  4. --noisy BOOLEAN print info and warning messages
  5. --help Show this message and exit.
  6. Commands:
  7. config generate config file
  8. create create and initialize new remote config
  9. current print current remote ident
  10. init initialize a new sftp-config
  11. list list available remote configs
  12. off turn off sublr
  13. open open current port for the current remote
  14. remove remove sftp-config for ident
  1. create: creates a new config file for a remote instance
  2. init: initialize sublime-sftp for a a remote instance
  3. off: turn off sublime-remote
  4. open: open port for remote instance in a web-browser
  5. current: print currently enabled remote instance
  6. list: list remote instances with sftp-configs
  7. remove: remove sftp-config for remote instance
  8. config: generate sublr config file

CREATE

Create and Initialize new sftp-config for remote instance.

  • IDENT: id for instance
  • IP: ip-address for remote instance. must be valid ip-address or include the string ‘dev’
  • REMOTE_PATH: path for the code on remote instance (defaults to ‘’)
  • AUTO_INIT: if true initialize sftp-config after creation (defaults to true)
  1. # Usage: sublr create [OPTIONS] IDENT IP [REMOTE_PATH] [AUTO_INIT]
  2. $ sublr create cpu 12.345.678.910 path/to/code/base
  3. [INFO] SUBLIME-REMOTE: < cpu > on
  4. $ sublr create gpu 10.987.654.321 path/to/code/base
  5. [INFO] SUBLIME-REMOTE: < gpu > on

INIT
  • IDENT: initialize sftp-config for ident
  1. # Usage: sublr init [OPTIONS] IDENT
  2. $ sublr init cpu
  3. [INFO] SUBLIME-REMOTE: < cpu > on

OFF
  1. # Usage: sublr off [OPTIONS]
  2. $ sublr off
  3. [INIT] SUBLIME-REMOTE: off

OPEN

Open port in web-browser. Defaults to 8888 or to port in sublr.config.yaml

  1. # Usage: sublr open [OPTIONS] [PORT]
  2. $ sublr open
  3. [INFO] SUBLIME-REMOTE: opened http://12.345.678.910:8888

CURRENT
  1. # Usage: sublr current [OPTIONS]
  2. $ sublr current
  3. [INFO] SUBLIME-REMOTE: < cpu >

LIST
  1. # Usage: sublr list [OPTIONS]
  2. $ sublr list
  3. [INFO] SUBLIME-REMOTE: AVAILABLE REMOTES:
  4. [INFO] SUBLIME-REMOTE: * cpu
  5. [INFO] SUBLIME-REMOTE: * gpu

REMOVE
  1. # Usage: sublr remove [OPTIONS] IDENT
  2. $ sublr remove gpu
  3. [INFO] SUBLIME-REMOTE: < gpu > removed
  4. $ sublr list
  5. [INFO] SUBLIME-REMOTE: AVAILABLE REMOTES:
  6. [INFO] SUBLIME-REMOTE: * cpu

CONFIG

Create custom default sublr config-values. Values can be updated directly through CLI, or you can edit the generated config file sublr.config.yaml directly.

  • PORT: default sublr port (defaults to 8888)
  • NOISY: default noisy option (defaults to True)
  • REMOTE_PATH: defalut remote_path value (defaults to ‘’)
  • AUTO_INIT: default auto-init (defaults to true)
  1. # Usage: sublr config [OPTIONS] [PORT] [REMOTE_PATH] [NOISY] [AUTO_INIT]
  2. $ sublr config 8999
  3. [INFO] SUBLIME-REMOTE: sublr.config.yaml created. edit file to change configuration
  4. $ cat sublr.config.yaml
  5. # sublr: config
  6. auto_init: true
  7. noisy: true
  8. port: 8999
  9. remote_path: ''
  10. $ sublr open
  11. [INFO] SUBLIME-REMOTE: opened http://12.345.678.910:8999