Code Monkey home page Code Monkey logo

nami's Introduction

Nami

A clean and tidy decentralized package manager.

❤️ A project by txthinking.com

Install

bash <(curl https://bash.ooo/nami.sh)

⚠️ Windows user should run in Git Bash, Video

Example

nami install brook
nami list
nami remove brook

You can also upgrade nami by nami

nami install nami
Keep PATH with sudo
sudo visudo
Defaults        !env_reset
# Defaults       secure_path=...

All officially maintained packages

Package Description Website
7z 7-Zip is a file archiver with a high compression ratio. Website
agg asciinema gif generator Website
brook-manager A Web UI for fully automatic management of Brook Website
brook A cross-platform network tool designed for developers. Website
brookscript Brook One-click script Website
bun Incredibly fast JavaScript runtime, bundler, transpiler and package manager – all in one. Website
caddy Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS Website
cidr-merger A simple command line tool to merge ip/ip cidr/ip range, supports IPv4/IPv6 Website
cloudflare cloudflare cli Website
cloudupload Upload files to multiple Cloud Storage in parallel. Automatically apply for ssl certificate with your domain. Website
cmake CMake, the cross-platform, open-source build system. Website
cowsay cowsay is reborn. Neo Cowsay has written in Go. Website
curl curl with http3 support Website
d2 D2 is a modern diagram scripting language that turns text to diagrams. Website
deno A modern runtime for JavaScript and TypeScript. Website
denobundle Bundle assets into the binary with deno compile Website
etcd Distributed reliable key-value store for the most critical data of a distributed system Website
fd A simple, fast and user-friendly alternative to 'find' Website
ffmpeg A complete, cross-platform solution to record, convert and stream audio and video. Website
fzf A command-line fuzzy finder Website
go An open-source programming language supported by Google Website
hancock Manage multiple remote servers and execute commands remotely Website
hey HTTP load generator, ApacheBench (ab) replacement Website
httpserver This is a very simple http static server, sometimes we need it for testing Website
icnsify Easily create .icns files (Mac Icons) Website
ipatool Command-line tool that allows searching and downloading app packages (known as ipa files) from the iOS App Store Website
ix command line pastebin. Website
jinbe Jinbe can add auto start command at boot. Zero-Configuration Website
joker Joker can turn process into daemon. Zero-Configuration Website
jb jb = javascript + bash Website
jq Command-line JSON processor Website
mad Generate root CA and derivative certificate for any domains and any IPs Website
markdown markdown converter Website
marp A CLI interface for Marp and Marpit based converters Website
minify Go minifiers for web formats Website
nami The easy way to download anything from anywhere Website
nico A HTTP3 web server for reverse proxy and single page application, automatically apply for ssl certificate, Zero-Configuration. Website
ninja a small build system with a focus on speed Website
node Node.js is an open-source, cross-platform JavaScript runtime environment. Website
protoc Protocol Buffers - Google's data interchange format Website
protoc-gen-js protoc-gen-js executable Website
rsrc Tool for embedding .ico & manifest resources in Go programs for Windows. Website
shadowsocks A Rust port of shadowsocks Website
sshexec A command-line tool to execute remote command through ssh Website
stuntman NAT type detection Website
tengo A fast script language for Go Website
tun2brook Proxy all traffic just one line command. tun2socks, tun2brook. IPv4 and IPv6, TCP and UDP. Website
yt-dlp Command-line program to download videos from YouTube.com and other video sites Website
zig Zig is a general-purpose programming language and toolchain for maintaining robust, optimal and reusable software. Website
zigup Download and manage zig compilers. Website
zoro zoro can help you expose local server to external network. Support both TCP/UDP, of course support HTTP. Zero-Configuration Website

Directory

  • $HOME/.nami: All files of nami
  • $HOME/.nami/bin: When installing nami, this path is already added to your $PATH
  • $HOME/.nami/cache: This directory will be emptied before installing package
    • If the package can be standalone executable files:

      After the installation process is finished, nami will copy these files to the $HOME/.nami/bin directory

    • If the package is a directory:
      • The script should save the directory into here. Such as go.tengo
      • And write the relative paths of executable files to links file, one path per line. Such as go.tengo

      After the installation process is finished, nami will copy the directory to the $HOME/.nami/dir/ directory and will create symbolic links to the $HOME/.nami/bin based on links

    • Write version to version file
  • $HOME/.nami/copied: This is usually used if the command to be installed is running, such as brook.tengo, you may:
    1. get the processes
    2. stop the processes
    3. copy(not move) the commands from $HOME/.nami/cache to $HOME/.nami/bin
    4. copy the commands from $HOME/.nami/cache to $HOME/.nami/copied, this prompts nami not to perform duplicate operations
    5. run the previously stopped processes again

Script

tengo

Nami supports tengo script, there is a built-in module import("nami") for convenience:

  • nami.os: linux/darwin/windows/...
  • nami.arch: amd64/arm64/...
  • nami.home_dir: $HOME
  • nami.bin_dir: $HOME/.nami/bin
  • nami.cache_dir: $HOME/.nami/cache
  • nami.copied_dir: $HOME/.nami/copied
  • append_file(file string, text string) => error
  • write_file(file string, text string) => error
  • sh(name string, args...) => error: run command
  • sh1(name string, args...) => bytes/error: run command and return stdout
  • cp(url string, dst string) => bytes/error: download file to dst
  • cp(url string, { from: dst, from1: dst1 }) => bytes/error: download compressed file, and copy one or more files
  • cp_dir(url string, { from: dst, from1: dst1 }, [link, link1]) => bytes/error: download compressed file, and copy one or more directories, and create symbolic links

Run local script

nami install ./exmaple.tengo

PR

Fork nami project, put exmaple.tengo to package directory, create PR, then you can

nami install example

Run remote script

nami install https://yourserver.com/exmaple.tengo

License

Licensed under The GPLv3 License

nami's People

Contributors

dependabot[bot] avatar itchyny avatar mostend avatar txthinking avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nami's Issues

How do you put binary files in the github releases?

Very interesting idea and nova approach, just that, how do you put binary files in the github releases?

Manually doing that would be a big hurdle for people to overcome and for nami to gain popularity. thx.

`nami install nami` fails of MinGW-w64

I just installed it and run following:

saukrs@DESKTOP-O7JE7JE MINGW64 ~
$ nami install nami
Download https://raw.githubusercontent.com/txthinking/nami/master/package/nami.js
Download https://raw.githubusercontent.com/txthinking/nami/master/nami.js
Download https://raw.githubusercontent.com/denoland/deno_std/0.118.0/fmt/colors.ts
Download https://raw.githubusercontent.com/txthinking/progress/nami1.2.3/mod.ts
Download https://raw.githubusercontent.com/txthinking/progress/nami1.2.3/multi.ts
Download https://raw.githubusercontent.com/denoland/deno_std/0.79.0/fmt/colors.ts
Check https://raw.githubusercontent.com/txthinking/nami/master/package/nami.js
nami has been open sourced on https://github.com/txthinking/nami
Fetching https://api.github.com/repos/txthinking/nami/releases/latest
error: Uncaught (in promise) NotFound: The system cannot find the path specified. (os error 3), open 'C:\msys64\home\saukrs/.nami/cache/version'
            await Deno.writeFile(`${Deno.env.get("HOME")}/.nami/cache/version`, new TextEncoder().encode(version));
            ^
    at async open (deno:runtime/js/40_files.js:51:17)
    at async Object.writeFile (deno:runtime/js/40_write_file.js:62:18)
    at async Object.version (https://raw.githubusercontent.com/txthinking/nami/master/nami.js:29:13)
    at async https://raw.githubusercontent.com/txthinking/nami/master/package/nami.js:8:1
exit status 1

This is my system:

saukrs@DESKTOP-O7JE7JE MINGW64 ~
$ uname -a
MINGW64_NT-10.0-19042 DESKTOP-O7JE7JE 3.3.3-341.x86_64 2022-01-18 13:00 UTC x86_64 Msys

versioning

https://github.com/aquaproj/aqua is golang and has a markup language but also has versioning.

there is also a registry, so you can declare the mapping the name to where the binary is stored. the registry is just a github repo.

Its pretty good. takes a while to get used to its cli.

macos x 10.14 无法使用nami安装joker brook

错误命令:

nami install brook joker

并且我发现它无法使用~/.zshrc 中的代理:

source ~/.zshrc 
proxy

其中~/.zshrc 代理部分是这样写的:

alias proxy='export all_proxy=socks5://127.0.0.1:socksport'

安装包时的错误信息:

$ nami install joker
2022/12/03 *:*:* Check nami version type assertion to string failed
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   280  100   280    0     0   1039      0 --:--:-- --:--:-- --:--:--  1040
2022/12/03 *:*:* Runtime Error: invalid type for argument 'second' in call to 'user-function:': expected string(compatible), found undefined

I love this, could we colaborate? I maintain https://github.com/xplshn/bigdl, currently, there are 1550 (statically linked) binaries in the repos of my package manager

BigDL is a "package" manager (not really, it manager binaries), its quite simple and small, I'd love us to collaborate (making universal, single file binaries, statically linked, against Musl if possible). I think both projects would benefit a lot from this!

Check out BigDL here: https://github.com/xplshn/bigdl

This is the help page of bigdl:

]@ bigdl -h
Usage:
 [-v|-h] [list|install|remove|update|run|info|search|tldr] <-args->

Options:
 -h, --help       Show this help message
 -v, --version    Show the version number

Commands:
 list             List all available binaries
 install, add     Install a binary
 remove, del      Remove a binary
 update           Update binaries, by checking their SHA against the repo's SHA
 run              Run a specified binary from cache
 info             Show information about a specific binary OR display installed binaries
 search           Search for a binary - (not all binaries have metadata. Use list to see all binaries)
 tldr             Equivalent to "run --transparent --verbose tlrc" as argument

Variables:
 BIGDL_PRBAR      If present, and set to ZERO (0), the download progressbar will be disabled
 BIGDL_TRUNCATION If present, and set to ZERO (0), string truncation will be disabled
 BIGDL_CACHEDIR   If present, it must contain a valid directory
 INSTALL_DIR      If present, it must contain a valid directory

Examples:
 bigdl search editor
 bigdl install micro
 bigdl install lux kakoune aretext shfmt
 bigdl install --silent bed && echo "[bed] was installed to $INSTALL_DIR/bed"
 bigdl del bed
 bigdl del orbiton tgpt lux
 bigdl info
 bigdl info jq
 bigdl list --described
 bigdl tldr gum
 bigdl run --verbose curl -qsfSL "https://raw.githubusercontent.com/xplshn/bigdl/master/stubdl" | sh -
 bigdl run --silent elinks -no-home "https://fatbuffalo.neocities.org/def"
 bigdl run --transparent --silent micro ~/.profile
 bigdl run btop

Version: 1.6.9p

unable to install in Termux.

Thank you! this works great on my PC, I tried adding it to Termux for when im out on the go, but I got an error:

2021/01/22 13:37:33 Get "https://api.github.com/repos/txthinking/nami/releases/latest": dial tcp: lookup api.github.com on [::1]:53: read udp [::1]:38965->[::1]:53: read: connection refused

Thank you once again!

建议优化安装脚本

机器位于国内,安装nami遇到点儿麻烦:

  • nami似乎不支持socks5代理?给系统设置了了all_proxy=socks5://,下载可以用了,但是nami还是提示连不到
  • 安装脚本里面似乎是先下载了个nami到tmp,再用nami安装nami,这个过程又下载了一遍安装包150+mb。。。

树莓派下用nami安装mr2能使用,但有些错误提示

开发者,您好,我在树莓派下(使用的shell是zsh)安装了nami,安装过程出现了一些错误提示,我看了wiki和issue,并没有找到解决方法,所以决定向您求助。

首先,我按照按文档给出的安装方法安装,我自己把命令中bash改成了zsh,因为我用的zsh作为shell,不知道对不对

$ curl https://raw.githubusercontent.com/txthinking/nami/master/install.sh | zsh && sleep 6 && exec -l $SHELL                                
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1403  100  1403    0     0   2181      0 --:--:-- --:--:-- --:--:--  2178
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   629  100   629    0     0    734      0 --:--:-- --:--:-- --:--:--   734
100 11.7M  100 11.7M    0     0   797k      0  0:00:15  0:00:15 --:--:--  973k
+-------------------+----------------------------+
| Package           | github.com/txthinking/nami |
|                   |                            |
| Installed Version | v20200516                  |
| Installed Files   | nami                       |
+-------------------+----------------------------+
/home/pi/.bashrc:16: command not found: shopt
/home/pi/.bashrc:24: command not found: shopt
/home/pi/.bashrc:107: command not found: shopt
/usr/share/bash-completion/bash_completion:45: command not found: shopt
/usr/share/bash-completion/bash_completion:53: command not found: complete
/usr/share/bash-completion/bash_completion:56: command not found: complete
/usr/share/bash-completion/bash_completion:59: command not found: complete
/usr/share/bash-completion/bash_completion:62: command not found: complete
/usr/share/bash-completion/bash_completion:65: command not found: complete
/usr/share/bash-completion/bash_completion:68: command not found: complete
/usr/share/bash-completion/bash_completion:71: command not found: complete
/usr/share/bash-completion/bash_completion:74: command not found: complete
/usr/share/bash-completion/bash_completion:77: command not found: complete
/usr/share/bash-completion/bash_completion:80: command not found: complete
/usr/share/bash-completion/bash_completion:1454: parse error near `|'

然后,我继续用nami安装了brook,brook可以正常使用。
接着,我又用nami安装了mr2,安装的过程也没报错,并用mr2给设置树莓派设置内网穿透,服务端设置如下:

joker mr2 server -l :9000 -p mr2.pw

树莓派设置如下:

mr2 client -s server_address:9000 -p mr2.pw -P 1234 -c 127.0.0.1:22

最后,在另一台主机上试图ssh连接树莓派,输入密码后,就出现错误提示了:

$ ssh pi@server_address -p 1234
The authenticity of host 'server_address:1234 (server_address:1234)' can't be established.
ECDSA key fingerprint is SHA256:xxxxxxxxxxxxxxxxxxxxxxx.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'server_address:1234,server_address:1234' (ECDSA) to the list of known hosts.
pi@server_address's password:
Linux ChanRaspberryPi 4.19.118-v8+ #1311 SMP PREEMPT Mon Apr 27 14:32:38 BST 2020 aarch64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Jun 16 09:38:57 2020 from 127.0.0.1
/home/pi/.bashrc:16: command not found: shopt
/home/pi/.bashrc:24: command not found: shopt
/home/pi/.bashrc:107: command not found: shopt
/usr/share/bash-completion/bash_completion:45: command not found: shopt
/usr/share/bash-completion/bash_completion:53: command not found: complete
/usr/share/bash-completion/bash_completion:56: command not found: complete
/usr/share/bash-completion/bash_completion:59: command not found: complete
/usr/share/bash-completion/bash_completion:62: command not found: complete
/usr/share/bash-completion/bash_completion:65: command not found: complete
/usr/share/bash-completion/bash_completion:68: command not found: complete
/usr/share/bash-completion/bash_completion:71: command not found: complete
/usr/share/bash-completion/bash_completion:74: command not found: complete
/usr/share/bash-completion/bash_completion:77: command not found: complete
/usr/share/bash-completion/bash_completion:80: command not found: complete
/usr/share/bash-completion/bash_completion:1454: parse error near `|'

Why use deno?

你好, 去年曾经关注过这个项目,之前使用时是nami加上远程文件夹中的json配置文件,想请教为什么现在要改用内置一个deno,同时需要编写deno的js脚本去进行下载操作呢?内嵌deno不仅导致nami的可执行文件体积暴增,deno的js编写也没有似乎也简化创建软件包的过程

Installation fails on a machine with less memory

Downloading 100.00% 2.2s 152903680/152903680 error: Uncaught (in promise) RangeError: Array buffer allocation failed var b = new Uint8Array(l); ^ at new ArrayBuffer (<anonymous>) at new Uint8Array (<anonymous>) at download (https://raw.githubusercontent.com/txthinking/nami/master/nami.js:20:13) at async Object.download_command_from_url (https://raw.githubusercontent.com/txthinking/nami/master/nami.js:42:13) at async https://raw.githubusercontent.com/txthinking/nami/master/package/nami.js:19:5 exit status 1

Can you optimize it, or told me how much memory is more suitable for a machine

Installation Failure: curl Package via nami on Debian 6.1

Environment

  • Operating System: Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux
  • Nami Version: 20240408

Issue Description

I encountered an error while trying to install the curl package using nami. The installation process fails during the extraction and setup steps, leading to an incomplete installation.

Steps to Reproduce

  1. Run nami install curl on the terminal.
  2. Observe the error output.

Expected Behavior

The curl package should be installed successfully without any errors.

Actual Behavior

The installation process fails with the following error messages:

root@jp:/tmp/_# nami install curl
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 87661    0 87661    0     0   243k      0 --:--:-- --:--:-- --:--:--  244k
######################################################################## 100.0%
xz: (stdin): File format not recognized
tar: Child returned status 1
tar: Error is not recoverable: exiting now
mv: cannot stat '/tmp/_/curl': No such file or directory
+-------------------+-------+
| Package           | curl  |
|                   |       |
| Installed Version | 8.8.0 |
| Installed Files   |       |
+-------------------+-------+
root@jp:/tmp/_# nami --version
nami version 20240408
root@jp:/tmp/_# uname -a
Linux jp 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux

项目引用了gopkg.in/yaml.v2等45个开源组件,存在2个漏洞,建议升级

大佬,我IDE运行您这个项目的时候,提醒我有几个漏洞,项目调用了gopkg.in/yaml.v2等45个开源组件,存在2个安全漏洞,建议你升级下。

漏洞标题:Google Kubernetes API Server 资源管理错误漏洞
漏洞编号:CVE-2019-11254
漏洞描述:
Google Kubernetes是美国谷歌(Google)公司的一套开源的Docker容器集群管理系统。该系统为容器化的应用提供资源调度、部署运行、服务发现和扩容缩容等功能。API server是其中的一个API(应用编程接口)服务器。
Google Kubernetes 1.15.10之前版本、1.16.7之前版本和1.17.3之前版本中的API Server组件存在资源管理错误漏洞。远程攻击者可借助特制请求利用该漏洞造成拒绝服务。
国家漏洞库信息:https://www.cnvd.org.cn/flaw/show/CNVD-2020-35519
影响范围:(∞, 2.2.8)
最小修复版本:2.2.8
引入路径:
github.com/txthinking/nami@->github.com/urfave/cli/[email protected]>gopkg.in/[email protected]

另外1个漏洞 ,信息有点多我就不贴了,你自己看下完整报告:https://www.mfsec.cn/jr?p=a49664

你对这个issues有任何疑问可以回复我哈,系统会提醒我的,谢谢了。

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.