Skip to content

cnblogs/cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cnblogs' command line tool

Build / Release Build / Development

Access cnblogs form CLI.

Usage

To use cnb directly, add it to your environment variables is required.

Login

You need to get your PAT from https://account.cnblogs.com/settings/tokens to use this tool.

Then run cnb user --login 'YOUR_PAT_HERE'. This will save your PAT to ~/.cnbrc.

If you want to logout, run cnb user --logout or just remove ~/.cnbrc.

Examples

It's time to enjoy cnblogs.

Here are some simple examples:

# Check your post list
cnb post --list
# Check your post 
cnb --id 114514 post --show
# Create and publish post 
cnb post create --title 'Hello' --body 'world!' --publish
# Change your post body
cnb --id 114514 post update --body 'niconiconiconi'

# Show ing list
cnb ing list
# Publish ing 
cnb ing --publish 'Hello world!'
# Comment to ing 
cnb --id 114514 ing --comment 'Awesome!'

# Check your user infomation
cnb user --info

For more information, try cnb --help.

Installation

From releases

Releases

Build locally

This tool requires nightly toolchains(1.74.0+) to build.

git clone --depth 1 https://github.com/cnblogs/cli.git
cd cli
cargo build -r

Or get binaries from CI artifacts.

License

MIT

Feedback

We’d love to hear your thoughts on this project. Feel free to drop us a note!

Issues