mastodon.world is one of the many independent Mastodon servers you can use to participate in the fediverse.
Generic Mastodon server for anyone to use.

Server stats:

8.1K
active users

#CLITools

1 post1 participant0 posts today

🚀 划时代的 Rust 日志体验来了(fake) —— CCB Logger 正式发布!✨

最近写了个 CLI 工具,顺手打磨了个日志库:
CCB Logger

它不复杂,就是想让 Rust 的日志输出 —— 更清晰、更结构化、开箱即用

比如这样:

info!("User login", "user_id", "12345", "ip", "192.168.1.100");

终端里就长这样:
2024-01-15 14:30:25.123 INFO User login user_id=12345 ip=192.168.1.100

对齐整齐、颜色舒服、时间精确,字段一目了然。没有图标,不花哨,但在终端里看得就是顺眼。

🔧 特性很务实:

- 五种日志等级(Trace 到 Error),统一四字符对齐
- 自动判断终端,决定是否上色
- 支持全局 logger 和上下文注入(比如 service=api)
- 宏简洁,
info!, error! 直接用
- 零配置启动,也能按需定制

名字叫 CCB?是个朋友随口起的,没特别意思,但挺好记(真的
😄

如果你也在写 CLI 工具或小服务,想找个轻量、好看、结构化的日志方案,不妨试试看。

-
📦 cargo add ccb Docs
-
🐱 GitHub: ccb⭐
- 作案动机
charmbracelet/log 这样的项目在 Rust 里没有,那就自己改。

欢迎试用,也欢迎提建议~
#Rust #logging #clitools #opensource #rustlang #shit #aigenerated

My golang knowledge is pretty basic. I had to do some updates to a product at work, and it was pretty easy and straight forward. Actually quite fun. Just to learn more golang, I started working on a cli-tool for my Niri setup, and it's actually pretty usable already.
I just want to polish it and clean up the code a bit more before publishing it. Also, since I'm not that good at the language yet, I'm totally not sure if I even do things correctly or the 'golang' way.

Any tips on which pre-commit hooks people usually use? I found one repo that has pretty much everything, but I always welcome alternatives.
I was also thinking about go-semantic-release to handle the package releases.

I know, this is probably quite overkill for a simple project, but hey, I like to learn and do things correctly!

#golang#go#niri

getopts: как писать CLI-утилиты с флагами без внешних библиотек

Привет, Хабр! getopts — это встроенный в любой POSIX-совместимый Linux/Unix-shell мини-парсер аргументов. Один shebang — и у вас CLI-утилита без единой внешней зависимости. В статье рассмотрим, как выжать из getopts максимум, где он спотыкается и когда пора переехать на getopt или Argbash.

habr.com/ru/companies/otus/art

Хабрgetopts: как писать CLI-утилиты с флагами без внешних библиотекПривет, Хабр! getopts — это встроенный в любой POSIX-совместимый Linux/Unix-shell мини-парсер аргументов. Один shebang — и у вас CLI-утилита без единой внешней зависимости. В статье рассмотрим, как...
#linux#shell#bash

Saw people talking about opening RAR files using tools like Keka, TheArchiver, and what not, on macOS, and I was like, "Oh, right, there are GUI tools that deal with archiving and extracting files!"

I've always been using command-line tools like ``
zip/unzip, tar, rar/unrar``, etc., for over 20 years, and that's second nature now.

#Tech #CLITools

One of my absolute favorite #Linux commands is `units`, not only does it do conversions, but you can also do math on quantities and it has a bunch of constants built in!

Want to know the wavelength of a 50MHz radio wave in feet? It's just `units c/50MHz ft`!

Want to know how much 2L of water weighs? `units waterdensity*2L lbs`!

Fastfetch is the Perfect Neofetch Replacement

When development on system info tool Neofetch was discontinued1 earlier this year a slew of forks, alternatives, and upstart projects sprung up to fill the void. Yet the Neofetch alternative that’s gained the most traction —anecdotally, at least; I’ve not be creeping around Linux conferences to verify first-hand—is FastFetch (or Fastfetch; not sure on the capitalisation). Fastfetch is similar to Neofetch in that it ‘pretty prints’ information about your OS, pertinent underlying technologies, and system’s hardware specs in a terminal window. But it’s a lot more capable, faster, more featured, supports Wayland (which Neofetch technically didn’t), and (perhaps most importantly) :sys_more_orange:
#News #CliTools #SystemTools

:sys_omgubuntu: omgubuntu.co.uk/2024/09/fastfe

#TIL blesh / blesh.sh - I have been playing with it only for a few minutes

It gives bash a fish feeling, (not the animal, but the alternative shell :-)) with visual autocompletion and a super nice vimlike INSERT appearing for vim management of the bash command line (which is the default in my bashrc, because I am not that fond of emacs shortcuts in bash)

there is the probably addictive possibility of defining VIMMACRO while typing in the commandline...

I have not yet succeeded with multi-line edition of bash commands, not tried enough

there are probably other blesh features which I not tried yet

if anyone is already using it in their linux toolbox, I'd gladly steal some of your user-tips

#blesh #bash #clitools #linux

I never adopted fish because of the syntax which is too different from #bash and #zsh. Maybe it is a bad excuse, but that is my excuse for now: until I spend more time in fish syntax, which I remember was pretty nice