Giter Club home page Giter Club logo

qiniu-cli's Introduction

qiniu-cli

如果你选择了七牛云作为图床

而又不想在浏览器中上传图片或者文件等

那么你可以选择这个工具

qiniu-cli一个基于命令行的文件上传工具

仅仅需要使用qn put filename即可

下载

平台 下载地址
linux https://picture.nj-jay.com/qn_linux
win https://picture.nj-jay.com/qn_win.exe
mac https://picture.nj-jay.com/qn_mac

配置

首先在七牛云上找到账号ak sk 链接

并选择你要将文件存储在哪个空间(bucket)中 链接

linux

# 假设qn_linux文件所在的路径为 /path/to/qn_linux
mv /path/to/qn_linux  /path/to/qn
chmod +x /path/to/qn
# 在~/.bashrc或者~/.zshrc中添加一行
export PATH="/path/to:$PATH"

win

# 修改qn_win.exe为qn.exe
#把qn.exe所在的目录添加为环境变量即可

mac

# 假设qn_mac文件所在的路径为 /path/to/qn_mac
mv /path/to/qn_mac /path/to/qn
chmod +x /path/to/qn
# 在~/.bashrc或者~/.zshrc中添加一行
export PATH="/path/to:$PATH"

使用

第一次使用时需要配置你的ak sk 以及bucket

qn account -w ak sk bucket(把sk sk bucket换成你的ak sk以及你选择存储的空间)

注意事项

填写文件路径的时候请使用/而不是\

并保证文件名中没有空格

正确的路径为

  • ../filename(相对路径)
  • filename(同一目录)
  • /home/jay/filename(绝对路径)

示例

# 假设test.png的位置是/path/to/test.png
qn put /home/jay/images/test.png
qn put ../images/test.png
qn put test.png
# 结果为:
upload successfully
外链为:http://picture.nj-jay.com/test.png

# 你也可以上传多个文件
qn put ~/.pic/maven-compile.png ~/.pic/maven-package.png
# 结果为:
upload successfully
外链为:
http://picture.nj-jay.com/maven-compile.png

upload successfully
外链为:
http://picture.nj-jay.com/maven-package.png

## 如果你要覆盖上传 请使用-w选项
qn put -w test.png
qn put -w test1.png test2.png

使用qn -h查看支持的命令

与typora天然集成

如果你使用的是typora这款软件编写markdown

那么这个工具将是你的不二之选

能够极大的提高你的效率

点击这个地方查看详细配置

目前支持的命令

  • put

qn put filepath 如果七牛上已经有该文件,默认不会覆盖上传.当你使用-w选项时可以进行覆盖上传

TODO

  • 支持通配符(批量传入)

  • 改进路径问题(假设传入的路径中使用了\或者有空格,在传输之前首先处理这些问题(把路径中的\改为/并去除空格)

qiniu-cli's People

Contributors

nj-jay avatar

Stargazers

 avatar DearJohn0118 avatar  avatar hs-vae avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.