<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          Articli多平臺文章管理工具

          聯(lián)合創(chuàng)作 · 2023-09-30 16:04

          Articli 是一個可以管理多個平臺內(nèi)容的命令行工具, 通過解析 Markdown 文件內(nèi)容以及調(diào)用平臺接口,實現(xiàn)內(nèi)容管理。

          最終目標(biāo)是基于 本地文件 + Git 代碼倉 管理所有的文章, 并且可以通過命令行操作以及 CI/CD,實現(xiàn)文章在各個平臺的發(fā)布、更新等功能。 這樣做的好處有:

          • 數(shù)據(jù)安全,既發(fā)布到了第三方平臺,又可以通過 Git 代碼倉管理,避免因平臺問題導(dǎo)致數(shù)據(jù)丟失
          • 可以實現(xiàn)自動化,比如文章推送到自動在多個平臺發(fā)布、更新
          • 面向程序員的 CLI 工具,可以實現(xiàn)更多個性化的操作

          為本項目點贊將鼓勵作者繼續(xù)完善下去,歡迎提出建議、Bug、PR。

          支持的平臺

          安裝

          NPM

          npm install -g @k8scat/articli

          Homebrew

          # 添加 tap
          brew tap k8scat/tap
          # 安裝
          brew install acli
          
          # 一條命令直接安裝
          brew install k8scat/tap/acli
          
          # 后續(xù)升級
          brew update
          brew upgrade k8scat/tap/acli

          Docker

          # 將配置文件的目錄掛載到容器內(nèi)
          docker run \\
            -it \\
            --rm \\
            -v $HOME/.config/articli:/root/.config/articli \\
            k8scat/articli:latest \\
            juejin auth login
          
          # 升級
          docker pull k8scat/articli:latest

          二進(jìn)制

          Please download from the releases page.

          源碼編譯

          git clone https://github.com/k8scat/articli.git
          cd articli
          make

          文章模板

          我們將使用文件內(nèi)容開頭 --- 之間的數(shù)據(jù)作為文章的配置信息(元數(shù)據(jù)), 根據(jù)配置信息在不同平臺上創(chuàng)建或更新文章,參考 文章模板

          ---
          # 通用配置,其他平臺可以繼承該配置
          title: 標(biāo)題1
          brief_content: 內(nèi)容概要
          cover_image: https://img.alicdn.com/tfs/TB1.jpg
          prefix_content: "這是我參與xx活動..." # 前綴內(nèi)容,主要用于掘金的活動
          suffix_content: |
            ## Powered by
          
            本文由 [Articli](https://github.com/k8scat/Articli.git) 工具自動發(fā)布。
          
          juejin:
            title: 標(biāo)題2 # 如果不填寫,則使用通用配置中的 title
            tags:
            - Go
            - 程序員
            category: 后端
            cover_image: https://img.alicdn.com/tfs/TB1.jpg
            brief_content: 內(nèi)容概要
            prefix_content: "這是我參與xx活動..." # 前綴內(nèi)容,主要用于掘金的活動
            suffix_content: |
              ## Powered by
          
              本文由 [Articli](https://github.com/k8scat/Articli.git) 工具自動發(fā)布。
            sync_to_org: false # 是否同步到組織,個人賬號不支持
          
            # 自動生成部分
            draft_id: "7xxx"
            draft_create_time: "2022-01-23 11:48:02"
            draft_update_time: "2022-01-24 11:48:02"
            article_id: "8xxx"
            article_create_time: "2022-01-25 11:48:02"
            article_update_time: "2022-01-26 11:48:02"
          
          oschina:
            title: 標(biāo)題3
            # 文章專輯
            category: 日常記錄
            # 推廣專區(qū)
            technical_field: 大前端
            # 僅自己可見
            privacy: false
            # 如果是轉(zhuǎn)載文章,請?zhí)顚懺逆溄?/span>
            original_url: ""
            # 禁止評論
            deny_comment: false
            # 下載外站圖片到本地
            download_image: false
            # 置頂
            top: false
            prefix_content: "這是我參與xx活動..." # 前綴內(nèi)容,主要用于掘金的活動
            suffix_content: |
              ## Powered by
          
              本文由 [Articli](https://github.com/k8scat/Articli.git) 工具自動發(fā)布。
          
            # 自動生成部分
            draft_id: "7xxx"
            draft_create_time: "2022-01-23 11:48:02"
            draft_update_time: "2022-01-24 11:48:02"
            article_id: "8xxx"
            article_create_time: "2022-01-25 11:48:02"
            article_update_time: "2022-01-26 11:48:02"
          
          csdn:
            title: 標(biāo)題3
            brief_content: 內(nèi)容概要
            categories:
            - Golang
            - 后端
            tags:
            - cli
            - csdn
            # 可選值: public, private, read_need_vip, read_need_fans
            read_type: public
            # 可選值: 發(fā)布 publish, 草稿 draft
            publish_status: publish
            # 可選值: 原創(chuàng) original, 轉(zhuǎn)載 repost, 翻譯 translated
            article_type: original
            # 轉(zhuǎn)載時必須填寫
            original_url: ""
            # 原文允許轉(zhuǎn)載或者本次轉(zhuǎn)載已經(jīng)獲得原文作者授權(quán)
            authorized_status: false
            # 支持單圖、三圖、無圖
            cover_images:
            - https://img.alicdn.com/tfs/TB1.jpg
            - https://img.alicdn.com/tfs/TB2.jpg
            - https://img.alicdn.com/tfs/TB3.jpg
            prefix_content: "這是我參與xx活動..." # 前綴內(nèi)容,主要用于掘金的活動
            suffix_content: |
              ## Powered by
          
              本文由 [Articli](https://github.com/k8scat/Articli.git) 工具自動發(fā)布。
          
            # 自動生成部分
            article_id: "8xxx"
            article_create_time: "2022-01-25 11:48:02"
            article_update_time: "2022-01-26 11:48:02"
          ---
          
          內(nèi)容概要
          
          
          
          正文內(nèi)容

          使用說明

          所有的命令都可以通過 -h --help 參數(shù)查看幫助信息。

          $ acli --help
          Manage content in multi platforms.
          
          Usage:
            acli [command]
          
          Available Commands:
            completion  Generate the autocompletion script for the specified shell
            csdn        Manage content in csdn.net
            github      Manage content in github.com
            help        Help about any command
            juejin      Manage content in juejin.cn
            oschina     Manage content in oschina.net
            version     Show version information
          
          Flags:
            -c, --config string   An alternative config file
            -h, --help            help for acli
          
          Use "acli [command] --help" for more information about a command.

          查看版本

          acli version

          掘金

          登錄

          使用瀏覽器 Cookie 進(jìn)行登錄

          # 交互式登錄
          acli juejin auth login
          
          # 從標(biāo)準(zhǔn)輸入獲取 Cookie
          acli juejin auth login --with-cookie < cookie.txt

          創(chuàng)建/更新文章

          # create 命令可以通過識別文章的配置信息,自動選擇創(chuàng)建或者更新文章,同時發(fā)布到掘金
          acli juejin article create /path/to/article.md

          查看文章列表

          通過 -k --keyword 關(guān)鍵字參數(shù)過濾文章列表

          acli juejin article list -k Docker

          打開文章

          使用默認(rèn)瀏覽器打開文章

          acli juejin article view 7055689358657093646

          查看分類

          acli juejin category list

          查看標(biāo)簽

          # 過濾關(guān)鍵字
          acli juejin tag list -k Go

          緩存標(biāo)簽

          由于標(biāo)簽的數(shù)量比較多,可以通過設(shè)置緩存加快讀取速度

          # 設(shè)置緩存
          acli juejin tag cache
          
          # 使用緩存
          acli jujin tag list --use-cache

          上傳圖片

          支持上傳本地圖片和網(wǎng)絡(luò)圖片

          # 本地圖片
          acli juejin image upload leetcode-go.png
          
          # 網(wǎng)絡(luò)圖片
          acli juejin image upload https://launchtoast.com/wp-content/uploads/2021/11/learn-rust-programming-language.png

          開源中國

          登錄

          # 交互式登錄
          acli oschina auth login
          
          # 從標(biāo)準(zhǔn)輸入中讀取 cookie
          acli oschina auth login --with-cookie < cookie.txt

          創(chuàng)建/更新文章

          acli oschina article create /path/to/article.md

          CSDN

          登錄

          # 交互式登錄
          acli csdn auth login
          
          # 從標(biāo)準(zhǔn)輸入中讀取 cookie
          acli csdn auth login --with-cookie < cookie.txt

          創(chuàng)建/更新文章

          acli csdn article create /path/to/article.md

          GitHub

          登錄

          使用 GitHub Token 進(jìn)行登錄

          # 交互式登錄
          acli github auth login
          
          # 從標(biāo)準(zhǔn)輸入獲取 Token
          acli github auth login --with-token < token.txt

          上傳文件

          # 上傳 README.md 文件到 testrepo 倉庫
          acli github file upload --repo testrepo README.md
          
          # 使用網(wǎng)絡(luò)資源
          # 使用 -p 指定在倉庫中存儲的路徑
          acli github file upload --repo testrepo \\
            -p testdir/homebrew-social-card.png \\
            https://brew.sh/assets/img/homebrew-social-card.png

          列取文件

          # 獲取代碼倉 testrepo 根目錄的文件列表,包括文件和目錄
          acli github file get --repo testrepo
          
          # 如果 testpath 是目錄,則獲取代碼倉 testrepo 中 testpath 目錄下的文件;
          # 如果 testpath 是文件,則只獲取該文件
          acli github file get --repo testrepo --path testpath

          刪除文件

          # 使用 -o 或 --owner 可以指定倉庫的 owner
          acli github file delete --owner testowner --repo testrepo --path testdir/filename.txt

          簡化命令

          使用 alias 別名進(jìn)行簡化命令

          # 將 acli juejin 簡化成 jcli
          cat >> ~/.bashrc << EOF
          alias jcli="acli juejin"
          alias ocli="acli oschina"
          alias gcli="acli github"
          EOF
          
          # 生效
          source ~/.bashrc
          
          # 使用簡化后的命令查看掘金的登錄狀態(tài)
          jcli auth status
          瀏覽 22
          點贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  亚洲精品粉嫩小泬18p | 五月情色天 | 夫妻操B视频 | 久久婷婷五月天人人综合 | 亚洲13p |