• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

hinshun/kit: composable command line toolkit distributing CLIs via IPFS

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

hinshun/kit

开源软件地址:

https://github.com/hinshun/kit

开源编程语言:

Go 96.6%

开源软件介绍:

kit

A composable command line toolkit distributed commands through IPFS

Getting started

Before you begin, you'll need:

We can start our IPFS daemon, and then make will do the following:

  • Cross compile core plugins needed to get started
  • Generate ldflags to link core plugins CID to kit global variables for its core plugins
  • Cross-compile kit for darwin-amd64 and linux-amd64.
$ ipfs init
initializing IPFS node at /home/edgarl/.ipfs
// ...

$ ipfs daemon
Initializing daemon...
// ...

$ make
core/init
make[1]: Entering directory '/home/edgarl/go/src/github.com/hinshun/kit'
cross
Sending build context to Docker daemon  65.61MB

You will then have access to kit init, which is a bootstrapping case, so that if you ever end up at an empty state, you can run it to reinitialize yourself.

$ kit
Usage:
  kit - Composable command-line toolkit.
  
  kit [global options] command [options] <arguments>
    
Commands:
  init
      Initializes a kit config.

$ kit init

$ kit
Usage:
  kit - Composable command-line toolkit.
  
  kit [global options] command [options] <arguments>
    
Commands:
  plugin
      Manage kit plugins.

# Add the `plugin/add` plugin as `foobar`
$ kit plugin add /foobar QmVrAu9VUahsA89Xfyuc5A3fEHWtogfdQX4MefdSicdKtJ

$ kit
Usage:
  kit - Composable command-line toolkit.

  kit [global options] command [options] <arguments>

Commands:
  foobar [--usage <string>] [--pin] [--overwrite] [--] <command path> <manifest>
    Adds a plugin to kit.
    [--usage <string>]: Specify usage help text for the plugin.
    [--pin]: Pins the plugin's parent namespace if adding to an implicit namespace.
    [--overwrite]: Overwrites any namespace or command if conflicting at the command path.
    <command path>: The command path to add the plugin.
    <manifest>: The content address or resolvable name for a plugin's metadata.

  plugin
    Manage kit plugins.

# Add an empty plugin namespace for `/some/namespace`
$ kit plugin add /some/namespace ""
    
$ kit some namespace
Usage:
  kit some namespace - A plugin namespace.

  kit [global options] command [options] <arguments>

Commands:
  No commands in kit some namespace.    

Current issues

plugin doesn't use CGO but still require cross-compiling toolchain

When cross-compiling go plugins from linux to darwin or darwin to linux, it uses external linking, therefore you need to have cross compiling toolchain for the target platform installed. For example, to cross-compile go plugin from linux to darwin, you need the darwin cross compiling toolchain (binaries like /Users/urso/.gvm/gos/go1.8beta1/pkg/tool/darwin_amd64/link). Go could compile using internal linking if CGO isn't used but that is only a punted feature request at this moment.

plugin was built with a different version of package

Waiting for Go 1.13 to resolve reproducible builds issue (otherwise plugins need to have identical go env) in order to load properly. Without this, kit compiled with a different GOPATH cannot load plugins built by a CI server with a different GOPATH:

Note: Use '-trimpath' to have more reproducible builds:




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
dennis-tra/pcp: 发布时间:2022-06-22
下一篇:
susmit/ERC721-fullstack-Dapp-Tutorial: An ERC721 dapp tutorial to demonstrate ho ...发布时间:2022-06-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap