#CLI

Fedify: ActivityPub server framework's avatar
Fedify: ActivityPub server framework

@fedify@hollo.social

Exciting news for developers! We've just landed a major milestone for Fedify 2.0—the now runs natively on .js and , not just (#456). If you install @fedify/cli@2.0.0-dev.1761 from npm, you'll get actual JavaScript that executes directly in your runtime, no more pre-compiled binaries from deno compile. This is part of our broader transition to Optique, a new cross-runtime CLI framework we've developed specifically for Fedify's needs (#374).

This change means a more natural development experience regardless of your runtime preference. Node.js developers can now run the CLI tools directly through their familiar ecosystem, and the same goes for Bun users. While Fedify 2.0 isn't released yet, we're excited to share this progress with the community—feel free to try out the dev version and let us know how it works for you!

Fedify: ActivityPub server framework's avatar
Fedify: ActivityPub server framework

@fedify@hollo.social

Exciting news for developers! We've just landed a major milestone for Fedify 2.0—the now runs natively on .js and , not just (#456). If you install @fedify/cli@2.0.0-dev.1761 from npm, you'll get actual JavaScript that executes directly in your runtime, no more pre-compiled binaries from deno compile. This is part of our broader transition to Optique, a new cross-runtime CLI framework we've developed specifically for Fedify's needs (#374).

This change means a more natural development experience regardless of your runtime preference. Node.js developers can now run the CLI tools directly through their familiar ecosystem, and the same goes for Bun users. While Fedify 2.0 isn't released yet, we're excited to share this progress with the community—feel free to try out the dev version and let us know how it works for you!

Fedify: ActivityPub server framework's avatar
Fedify: ActivityPub server framework

@fedify@hollo.social

Exciting news for developers! We've just landed a major milestone for Fedify 2.0—the now runs natively on .js and , not just (#456). If you install @fedify/cli@2.0.0-dev.1761 from npm, you'll get actual JavaScript that executes directly in your runtime, no more pre-compiled binaries from deno compile. This is part of our broader transition to Optique, a new cross-runtime CLI framework we've developed specifically for Fedify's needs (#374).

This change means a more natural development experience regardless of your runtime preference. Node.js developers can now run the CLI tools directly through their familiar ecosystem, and the same goes for Bun users. While Fedify 2.0 isn't released yet, we're excited to share this progress with the community—feel free to try out the dev version and let us know how it works for you!

Fedify: ActivityPub server framework's avatar
Fedify: ActivityPub server framework

@fedify@hollo.social

Exciting news for developers! We've just landed a major milestone for Fedify 2.0—the now runs natively on .js and , not just (#456). If you install @fedify/cli@2.0.0-dev.1761 from npm, you'll get actual JavaScript that executes directly in your runtime, no more pre-compiled binaries from deno compile. This is part of our broader transition to Optique, a new cross-runtime CLI framework we've developed specifically for Fedify's needs (#374).

This change means a more natural development experience regardless of your runtime preference. Node.js developers can now run the CLI tools directly through their familiar ecosystem, and the same goes for Bun users. While Fedify 2.0 isn't released yet, we're excited to share this progress with the community—feel free to try out the dev version and let us know how it works for you!

Fedify: ActivityPub server framework's avatar
Fedify: ActivityPub server framework

@fedify@hollo.social

Exciting news for developers! We've just landed a major milestone for Fedify 2.0—the now runs natively on .js and , not just (#456). If you install @fedify/cli@2.0.0-dev.1761 from npm, you'll get actual JavaScript that executes directly in your runtime, no more pre-compiled binaries from deno compile. This is part of our broader transition to Optique, a new cross-runtime CLI framework we've developed specifically for Fedify's needs (#374).

This change means a more natural development experience regardless of your runtime preference. Node.js developers can now run the CLI tools directly through their familiar ecosystem, and the same goes for Bun users. While Fedify 2.0 isn't released yet, we're excited to share this progress with the community—feel free to try out the dev version and let us know how it works for you!

Fedify: ActivityPub server framework's avatar
Fedify: ActivityPub server framework

@fedify@hollo.social

Exciting news for developers! We've just landed a major milestone for Fedify 2.0—the now runs natively on .js and , not just (#456). If you install @fedify/cli@2.0.0-dev.1761 from npm, you'll get actual JavaScript that executes directly in your runtime, no more pre-compiled binaries from deno compile. This is part of our broader transition to Optique, a new cross-runtime CLI framework we've developed specifically for Fedify's needs (#374).

This change means a more natural development experience regardless of your runtime preference. Node.js developers can now run the CLI tools directly through their familiar ecosystem, and the same goes for Bun users. While Fedify 2.0 isn't released yet, we're excited to share this progress with the community—feel free to try out the dev version and let us know how it works for you!

Fedify: ActivityPub server framework's avatar
Fedify: ActivityPub server framework

@fedify@hollo.social

Exciting news for developers! We've just landed a major milestone for Fedify 2.0—the now runs natively on .js and , not just (#456). If you install @fedify/cli@2.0.0-dev.1761 from npm, you'll get actual JavaScript that executes directly in your runtime, no more pre-compiled binaries from deno compile. This is part of our broader transition to Optique, a new cross-runtime CLI framework we've developed specifically for Fedify's needs (#374).

This change means a more natural development experience regardless of your runtime preference. Node.js developers can now run the CLI tools directly through their familiar ecosystem, and the same goes for Bun users. While Fedify 2.0 isn't released yet, we're excited to share this progress with the community—feel free to try out the dev version and let us know how it works for you!

이광효's avatar
이광효

@widehyo@hackers.pub

요새 awk에 대해 많은 관심을 가지고 있다. 특히 awk는 기본적으로 제공되는 feature가 가장 적은 언어중에 하나이기 때문에 다른 언어에서 편하게 사용했던 편의 기능을 직접 구현해서 사용해야 하는 경우가 많다. 하지만 awk 특유의 script스러움과 여러 편의기능 및 문법은 이에 익숙해진 사용자에게 빠져나가기 힘든 매력을 지니고 있기도 하다.

서론은 여기까지 하고 상당히 복잡한 구현이었던 functools.partial을 awk로 구현한 내용을 자세히 살펴보자.

먼저, awk에 대한 이해를 돕기 위해 언어가 가진 제약사항을 먼저 언급하고 가자.

  1. 모든 자료형은 string, number, or array(associative array)이다.
  2. 데이터를 표현하는 class나 struct를 제공하지 않는다.
  3. nested funciton을 지원하지 않는다.
  4. 따라서 closure를 지원하지 않는다.
  5. array를 return할 수 없다.
  6. multi return이 불가능하다.
  7. function pointer를 사용할 수 없다 (void *)를 이용한 함수 객체 활용이 불가하다.
  8. 변수는 기본적으로 global variable이다.
  9. (gawk가 아닌 awk 한정) multi dimensional array를 지원하지 않는다.
  10. 런타임에서 reflection이나 inspect를 할 수 있는 도구가 제공되지 않는다.

위의 제약사항 중 3, 4, 5, 6번은 C언어가 가진 제약사항을 고려하면 이해가 된다. 그러나 1번과 2번, 그리고 7번은 C언어 보다도 강력한 제약사항이라고 볼 수 있다. 그나마 7번은 gawk(GNU awk) 5.1 버전에서는 functionName = "myfunc"; @functionName을 이용하여 간접호출은 가능하다. 하지만 함수를 반환하거나, 변수에 함수를 할당하거나 파라미터에 함수를 넘기는 것은 불가능하다. 8번의 경우는 그나마 C언어의 함수 스코프가 지원되는 것을 이용하면 함수 내에서 지역변수 취급하고 싶은 변수를 parameter 자리에 넣음으로써 지역변수 취급이 가능하다.

그리고 이를 극복하기 위한 대응방안은 다음과 같다.

1번과 2번의 사용자정의 자료형 문제는 자료형을 표현할 수 있는 문자열을 설계(serialization과 같은 전략)하여 전달하다가 필요한 시점에 해당 문자열을 다시 원하는 형태로 복원하는 방법으로 극복할 수 있다. 이 전략은 posix awk가 multi dimensional array를 지원하지 않는 것에 대한 대응방안으로 a[i][j] 대신 a[i, j]로 사용한 점에서 착안했다. 편의를 위한 배열 인덱스 자리에 위치하는 i, j는 사실 "i\034j" 문자와 같다. 배열의 index에 위치하는 ,는 키보드로 입력 불가능한 문자인 "\034"로 치환되며, awk에서의 강력한 사용성을 지원하기 위해 내장변수 SUBSEP으로 \034 문자를 사용할 수 있다.

3번과 4번의 경우는 함수형 프로그래밍 방식을 선호하는 필자에게는 많은 불편함을 가져다 주었고, 이번 포스팅의 주된 도전과제였다. 간략히 극복전략을 이야기하자면 global table(associative array)를 이용하여 storage에 원하는 내용을 넣었다가 사용하는 방식으로 극복하였다.

5번과 6번은 생각보다 극복 난이도가 낮았는데, C언어의 call by reference 방식으로 우회하면 된다. C언어에서 array를 sort하기 위해 배열의 포인터를 함수에 넘기고 안에서 swap한 것과 근본적으로 같은 방식이다. 한편, multi return을 위해 새로운 배열을 만들어 return하고 싶을 때는 해당 배열을 parameter로 넘기고 함수 본문 시작시 delete 문을 이용해 우연히 같은 이름을 사용하는 global variable 문제를 방지하였다. 그리고 이 방법은 awk의 기본 함수인 split("text", "array", "separator")에서 자연스럽게 사용하는 방법이기 때문에 awk의 idiom과도 부합한다.

7번은 gawk의 힘을 빌려 @fn 을 이용한다. man awk를 읽다가 @fn을 보고 이거 잘하면 함수형 프로그래밍 할 수 있겠는데 라는 생각이 이 글의 근본적인 모티베이션이 되었다. 하지만 10번의 제약사항에 의하여 런타임에서 dynamic하게 함수/매개변수에 접근할 수 없었기 때문에 debugger가 참조하는 프레임 객체와 비슷한 것 중 functools.partial에서 필요한 정보만 담은 global variable을 직접 만들어 구현했다.

가장 먼저 진행한 부분은 함수 signature를 저장하는 방법을 찾는 것이었다. functools.partial과 같은 함수는 parameter의 위치 및 key를 이용하여 default parameter를 binding할 수 있었기 때문에 해당하는 정보를 저장해야 했다. 결론만 말하자면 다음과 같은 함수가 있을 때

function sample(a, b, c) { ... }

[(a, 1), (b, 2), (c, 3)] 과 같은 형태로 함수의 signature가 저장되기를 원했다. 하지만 array는 element로 array를 가질 수 없기에(array의 원소에 array를 할당하려 하면 syntax error), [(a, 1), (b, 2), (c, 3)]의 string representation을 다음과 같이 저장했다.

SSEP = "\035"
"1" SUBSEP "a" SSEP "2" SUBSEP "b" SSEP "3" SUBSEP "c"

구분자가 2개가 필요했는데 하나는 튜플 안에서 데이터를 구분하는 구분자로 사용된 SUBSEP, 그리고 리스트에서 각 튜플의 구분자로 사용된 SSEP이다. 이렇게 function signature를 string으로 표현하여 global variable인 FUNCSIG 테이블에 함수명을 키로, function signature의 string repr을 value로 저장한다. 그러면 대충 python으로 보면 이런 느낌이 된다.

FUNCSIG["sample"] = "1\034a\0352\034b\0353\034c"

그리고 실제로 사용할 때는 SSEP과 SUBSEP으로 split하여(deserialize하여) {"a":1,"b":2,"c":3} 과 같은 형태로 사용한다.

# save function signature to global variable FUNCSIG
# argument information is of form list of tuples (position, parameter name)
# list element delemter: SSEP, key-value delemeter: SUBSEP
function saveSignature(fnname, argInfo) {
  posRepr = bindPosition(argInfo)
  FUNCSIG[fnname] = posRepr
}

function bindPosition(array,    acc) {
  for (i = 1; i <= length(array); i++) {
    acc = acc i SUBSEP array[i] SSEP
  }
  return substr(acc, 1, length(acc) - 1)
}

두번째로는 진행한 함수는 binding된 함수를 만드는 함수이다. functools의 partial이 하는 역할과 같다고 보면 된다.

원본함수명(fnname)과 default parameter의 정보(bindings)를 받아 원본 함수의 parameter 중 명시적으로 호출하지 않은 매개변수는 bindings로 미리 정의한 매개변수를 사용하는 함수의 이름을 key로 등록하는 동작을 awk용으로 바꾼 것이다.

>>> from functools import partial
>>> def fnname(a, b):
...     print(f"a: {a}, b: {b}")
... 
>>> key = partial(fnname, b=3)
>>> key(1)
a: 1, b: 3
function fnname(a, b) {
    printf "a: %s, b: %s", a, b
}
# 정의부
key = "partial_fn"
bind(key, "fnname", "b" SUBSEP "3") # partial_fn = partial(fnname, b=3)과 같은 역할

# 사용부
call(key, "a" SUBSEP "1") # partial_fn(a=1)과 같은 역할 == @key(a=1)과 같은 역할

매개변수는 argument를 binding하는 정보를 담고 있는 array(bindings)와 원본 함수명(fnname) 그리고 binding한 함수명(key)으로 구성된다.

함수명을 통한 함수 간접호출은 gawk에서 @fn 문법으로 가능하기 때문에, 어떤 함수에 어떤 parameter가 바인딩 되었는지를 정보로 전달하고 binding된 새로운 함수를 key로 global variable BINDING이 가지고 있다가 call 함수에 의해 해당 정보를 찾아 reconstruction을 통해 호출하는 방법이다. 최대한의 유연성을 확보하기 위하여 bindings는 associative array로 설계했고, 위에서 저장한 function signature와 실제 실행 책임을 가진 함수 call에서 호출할 args와 함께 사용된다.

binding한 정보는 [원본함수명] [(매개변수1, 값1), (매개변수2, 값2), ...] 와 같은 형태로 저장된다. 물론, awk에는 string과 number만 primitive type으로 가지므로 string representation 형태로 저장한다.

# save binding arguments to global variable BINDING
# key will be used as partial function(default parameter from binding info)
# the form value consists two parts, head and tails separated with first SSEP
# head contains `original function name`
# tail is of form string representation of the list of tuple, which argName SUBSEP value
# each elements is joined with SSEP
function bind(key, fnname, bindings,    argRepr) {
  argRepr = fnname SSEP

  if (length(bindings) == 0) {
    BINDING[key] = argRepr
    return
  }
  argRepr = argRepr serializeAssoc(bindings)
  BINDING[key] = argRepr
}

헬퍼 함수 serializeAssoc을 사용했다.

function serializeAssoc(assoc,    acc) {
  for (key in assoc) {
    acc = acc key SUBSEP assoc[key] SSEP
  }
  return substr(acc, 1, length(acc) - 1)
}

위에서 만든 바인딩된 함수를 호출하는 함수 call이다. 실제 함수호출을 담당하고 내부로직이 가장 복잡한 함수이다. function signature는 다음과 같다.

function call(key, args,    bindings)

위에서 정의한 key로 BINDING에서 argRepr을 가져온다. argRepr의 첫 번째 위치에 있는 함수명을 추출한다 추출한 함수명으로 FUNCSIG에 저장된 posRepr를 가져온다.

argRepr의 두 번째 위치에 있는 binding 정보를 복원하고 원본함수의 function signature를 담고 있는 posRepr을 각각 복원하여, 실제로 호출할 args와 결합하여 호출한다.

전반부는 실제 파라미터를 생성하는 부분으로 구성된다.

function call(key, args,    bindings) {
  if (!BINDING[key]) {
    print "unregistered function call"
    return
  }
  buildParameter(key, args, params)

buildParameter 함수는 바인딩된 함수를 호출할 args를 우선적으로 적용하고 args에서 채워지지 않은 매개변수는 bindingRepr에서 표현된 매개변수 정보에서 채워넣는다. 만약 모든 parameter가 채워지지 않았다면 에러를 출력한다. multi return을 위하여 params 배열을 이용한다.

function buildParameter(key, args, params) {
  partition(BINDING[key], SSEP, fnBinding)
  fnname = fnBinding[1]
  inspectParams(fnname, paramDict)
  bindingRepr = fnBinding[2]
  bindingRepr2Dict(bindingRepr, bindingDict)

  for (idx in args) {
    params[idx] = args[idx]
  }
  for (idx in paramDict) {
    if (!params[paramDict[idx]]) {
      params[paramDict[idx]] = bindingDict[idx]
    }
  }
  if (length(paramDict) != length(params)) {
    print "invalid execution, mismatch between original function and binded function"
    delete params
  }
}

partition은 헬퍼함수이다. separator를 기준으로 전후를 잘라낸다. 역시 multi return이 필요하기 때문에 headtail 매개변수 배열을 이용한다.

function partition(str, sep, headtail) {
  headtail[1] = substr(str, 1, index(str, sep) - length(sep))
  headtail[2] = substr(str, index(str, sep) + length(sep))
}

bindingRepr2Dict는 string representation을 dictionary(associative array)로 복원하는 함수이다. 내용이 간단하므로 먼저 소개한다. BINDING global 변수와 관련있다.

function bindingRepr2Dict(repr, bindingDict,    tmp) {
  split(repr, tmp, SSEP)
  for (idx in tmp) {
    split(tmp[idx], keyVal, SUBSEP)
    bindingDict[keyVal[1]] = keyVal[2]
  }
}

inspectParams는 원본 함수의 function signature를 담고 있는 FUNCSIG global 변수와 관련있다.

function inspectParams(fnname, paramDict) {
  posRepr = FUNCSIG[fnname]
  posRepr2Dict(posRepr, paramDict)
}

function posRepr2Dict(posRepr, paramDict,    tmp, posNameTuple) {
  split(posRepr, tmp, SSEP)
  for (idx in tmp) {
    split(tmp[idx], posName, SUBSEP)
    paramDict[posName[2]] = posName[1]
  }
}

아래 부분이 비즈니스 로직으로, 명시적으로 호출하는 매개변수를 이용해 원본 함수의 funciton signature를 최대한 채워 넣은 후 비어있는 매개변수에 대하여 bindingDict에서 정의되어 있다면 나머지를 채워 넣는 식으로 작동한다.

  for (idx in args) {
    params[idx] = args[idx]
  }
  for (idx in paramDict) {
    if (!params[paramDict[idx]]) {
      params[paramDict[idx]] = bindingDict[idx]
    }
  }

물론, 명시적으로 주어진 parameter와 binding된 매개변수 모두 사용해도 함수가 요구하는 매개변수를 모두 채우지 못한다면 에러메시지를 출력한다.

  if (length(paramDict) != length(params)) {
    print "invalid execution, mismatch between original function and binded function"
    delete params
  }

사실 위의 코드에서는 exit로 나가도 좋다

이렇게 parameter를 구성하면 남은 작업은 간단하다. 매개변수의 개수에 따라 해당하는 함수를 동적으로 호출하는 부분만 남았다. call 함수의 후반부 코드를 보자.


  switch (length(params)) {
    case 1:
      executeFunc1(fnname, params)
      break
    case 2:
      executeFunc2(fnname, params)
      break
    case 3:
      executeFunc3(fnname, params)
      break
    case 4:
      executeFunc4(fnname, params)
      break
    default:
      print "#(function params) must one of 1, 2, 3, or 4"
      return
  }

여러 helper 함수를 사용하는데, 이것은 awk가 동적 프로그래밍이 불가능하기 때문이다. 쉽게 말하면 eval이 없어서 각종 템플릿에 맞는 함수를 하나씩 사전에 정의해 두어야 한다.


function executeFunc1(fnname, params) {
  @fnname(params[1])
}

function executeFunc2(fnname, params) {
  @fnname(params[1], params[2])
}

function executeFunc3(fnname, params) {
  @fnname(params[1], params[2], params[3])
}

function executeFunc4(fnname, params) {
  @fnname(params[1], params[2], params[3], params[4])
}

이상을 모두 적용한 전체 코드는 다음과 같다.


function sample(a, b, c) {
  printf "a: %s, b: %s, c: %s\n", a, b, c
}

# save binding arguments to global variable BINDING
# key will be used as partial function(default parameter from binding info)
# the form value consists two parts, head and tails separated with first SSEP
# head contains `original function name`
# tail is of form string representation of the list of tuple, which argName SUBSEP value
# each elements is joined with SSEP
function bind(key, fnname, bindings,    argRepr) {
  argRepr = fnname SSEP

  if (length(bindings) == 0) {
    BINDING[key] = argRepr
    return
  }
  argRepr = argRepr serializeAssoc(bindings)
  BINDING[key] = argRepr
}

function serializeAssoc(assoc,    acc) {
  for (key in assoc) {
    acc = acc key SUBSEP assoc[key] SSEP
  }
  return substr(acc, 1, length(acc) - 1)
}

function bindPosition(array,    acc) {
  for (i = 1; i <= length(array); i++) {
    acc = acc i SUBSEP array[i] SSEP
  }
  return substr(acc, 1, length(acc) - 1)
}

function flip(assoc) {
  for (idx in assoc) {
    assoc[assoc[idx]] = idx
  }
}

function printArray(arr, arrName) {
  for (idx in arr) {
    printf "%s[%s]: %s\n", (arrName ? arrName : "arr"), idx, arr[idx]
  }
}

function apply(arr, fn) {
  for (idx in arr) {
    arr[idx] = @fn(arr[idx])
  }
}

function strReprArr2dict(strReprArr, dict,    strRepr) {
  delete dict
  for (i = 1; i <= length(strReprArr); i++) {
    strRepr = strReprArr[i]
    partition(strRepr, SUBSEP, headtail)
    dict[headtail[1]] = headtail[2]
  }
}

function partition(str, sep, headtail) {
  headtail[1] = substr(str, 1, index(str, sep) - length(sep))
  headtail[2] = substr(str, index(str, sep) + length(sep))
}

function call(key, args,    bindings) {
  if (!BINDING[key]) {
    print "unregistered function call"
    return
  }
  buildParameter(key, args, params)

  switch (length(params)) {
    case 1:
      executeFunc1(fnname, params)
      break
    case 2:
      executeFunc2(fnname, params)
      break
    case 3:
      executeFunc3(fnname, params)
      break
    case 4:
      executeFunc4(fnname, params)
      break
    default:
      print "#(function params) must one of 1, 2, 3, or 4"
      return
  }

}

function buildParameter(key, args, params) {
  partition(BINDING[key], SSEP, fnBinding)
  fnname = fnBinding[1]
  inspectParams(fnname, paramDict)
  bindingRepr = fnBinding[2]
  bindingRepr2Dict(bindingRepr, bindingDict)

  for (idx in args) {
    params[idx] = args[idx]
  }
  for (idx in paramDict) {
    if (!params[paramDict[idx]]) {
      params[paramDict[idx]] = bindingDict[idx]
    }
  }
  if (length(paramDict) != length(params)) {
    print "invalid execution, mismatch between original function and binded function"
    delete params
  }
}

function bindingRepr2Dict(repr, bindingDict,    tmp) {
  split(repr, tmp, SSEP)
  for (idx in tmp) {
    split(tmp[idx], keyVal, SUBSEP)
    bindingDict[keyVal[1]] = keyVal[2]
  }
}

function inspectParams(fnname, paramDict) {
  posRepr = FUNCSIG[fnname]
  posRepr2Dict(posRepr, paramDict)
}

function posRepr2Dict(posRepr, paramDict,    tmp, posNameTuple) {
  split(posRepr, tmp, SSEP)
  for (idx in tmp) {
    split(tmp[idx], posName, SUBSEP)
    paramDict[posName[2]] = posName[1]
  }
}

function executeFunc1(fnname, params) {
  @fnname(params[1])
}

function executeFunc2(fnname, params) {
  @fnname(params[1], params[2])
}

function executeFunc3(fnname, params) {
  @fnname(params[1], params[2], params[3])
}

function executeFunc4(fnname, params) {
  @fnname(params[1], params[2], params[3], params[4])
}

# save function signature to global variable FUNCSIG
# argument information is of form list of tuples (position, parameter name)
# list element delemter: SSEP, key-value delemeter: SUBSEP
function saveSignature(fnname, argInfo) {
  posRepr = bindPosition(argInfo)
  FUNCSIG[fnname] = posRepr
}

function zip(arr1, arr2, dict) {
  minlen = (length(arr1) < length(arr2) ? length(arr1) : length(arr2))
  for (i = 1; i <= minlen; i++) {
    dict[arr1[i]] = arr2[i]
  }
}

BEGIN {
  SSEP = "\035"
  split("a b c", arginfo)
  saveSignature("sample", arginfo)
  split("b c", keys)
  split("5678 asdf", vals)
  zip(keys, vals, bindings)
  bind("partial", "sample", bindings)
  split("1", args)
  call("partial", args)
}

적절한 라이브러리에 분리하고 import를 사용하면 다음과 같다.


@include "common"
@include "functool"


function sample(a, b, c) {
  printf "a: %s, b: %s, c: %s\n", a, b, c
}

BEGIN {
  SSEP = "\035"
  split("a b c", arginfo)
  saveSignature("sample", arginfo)
  split("b c", keys)
  split("5678 asdf", vals)
  zip(keys, vals, bindings)
  bind("partial", "sample", bindings)
  split("1", args)
  call("partial", args)
}

출력 결과는 아래와 같다.

a: 1, b: 5678, c: asdf
이광효's avatar
이광효

@widehyo@hackers.pub

요새 awk에 대해 많은 관심을 가지고 있다. 특히 awk는 기본적으로 제공되는 feature가 가장 적은 언어중에 하나이기 때문에 다른 언어에서 편하게 사용했던 편의 기능을 직접 구현해서 사용해야 하는 경우가 많다. 하지만 awk 특유의 script스러움과 여러 편의기능 및 문법은 이에 익숙해진 사용자에게 빠져나가기 힘든 매력을 지니고 있기도 하다.

서론은 여기까지 하고 상당히 복잡한 구현이었던 functools.partial을 awk로 구현한 내용을 자세히 살펴보자.

먼저, awk에 대한 이해를 돕기 위해 언어가 가진 제약사항을 먼저 언급하고 가자.

  1. 모든 자료형은 string, number, or array(associative array)이다.
  2. 데이터를 표현하는 class나 struct를 제공하지 않는다.
  3. nested funciton을 지원하지 않는다.
  4. 따라서 closure를 지원하지 않는다.
  5. array를 return할 수 없다.
  6. multi return이 불가능하다.
  7. function pointer를 사용할 수 없다 (void *)를 이용한 함수 객체 활용이 불가하다.
  8. 변수는 기본적으로 global variable이다.
  9. (gawk가 아닌 awk 한정) multi dimensional array를 지원하지 않는다.
  10. 런타임에서 reflection이나 inspect를 할 수 있는 도구가 제공되지 않는다.

위의 제약사항 중 3, 4, 5, 6번은 C언어가 가진 제약사항을 고려하면 이해가 된다. 그러나 1번과 2번, 그리고 7번은 C언어 보다도 강력한 제약사항이라고 볼 수 있다. 그나마 7번은 gawk(GNU awk) 5.1 버전에서는 functionName = "myfunc"; @functionName을 이용하여 간접호출은 가능하다. 하지만 함수를 반환하거나, 변수에 함수를 할당하거나 파라미터에 함수를 넘기는 것은 불가능하다. 8번의 경우는 그나마 C언어의 함수 스코프가 지원되는 것을 이용하면 함수 내에서 지역변수 취급하고 싶은 변수를 parameter 자리에 넣음으로써 지역변수 취급이 가능하다.

그리고 이를 극복하기 위한 대응방안은 다음과 같다.

1번과 2번의 사용자정의 자료형 문제는 자료형을 표현할 수 있는 문자열을 설계(serialization과 같은 전략)하여 전달하다가 필요한 시점에 해당 문자열을 다시 원하는 형태로 복원하는 방법으로 극복할 수 있다. 이 전략은 posix awk가 multi dimensional array를 지원하지 않는 것에 대한 대응방안으로 a[i][j] 대신 a[i, j]로 사용한 점에서 착안했다. 편의를 위한 배열 인덱스 자리에 위치하는 i, j는 사실 "i\034j" 문자와 같다. 배열의 index에 위치하는 ,는 키보드로 입력 불가능한 문자인 "\034"로 치환되며, awk에서의 강력한 사용성을 지원하기 위해 내장변수 SUBSEP으로 \034 문자를 사용할 수 있다.

3번과 4번의 경우는 함수형 프로그래밍 방식을 선호하는 필자에게는 많은 불편함을 가져다 주었고, 이번 포스팅의 주된 도전과제였다. 간략히 극복전략을 이야기하자면 global table(associative array)를 이용하여 storage에 원하는 내용을 넣었다가 사용하는 방식으로 극복하였다.

5번과 6번은 생각보다 극복 난이도가 낮았는데, C언어의 call by reference 방식으로 우회하면 된다. C언어에서 array를 sort하기 위해 배열의 포인터를 함수에 넘기고 안에서 swap한 것과 근본적으로 같은 방식이다. 한편, multi return을 위해 새로운 배열을 만들어 return하고 싶을 때는 해당 배열을 parameter로 넘기고 함수 본문 시작시 delete 문을 이용해 우연히 같은 이름을 사용하는 global variable 문제를 방지하였다. 그리고 이 방법은 awk의 기본 함수인 split("text", "array", "separator")에서 자연스럽게 사용하는 방법이기 때문에 awk의 idiom과도 부합한다.

7번은 gawk의 힘을 빌려 @fn 을 이용한다. man awk를 읽다가 @fn을 보고 이거 잘하면 함수형 프로그래밍 할 수 있겠는데 라는 생각이 이 글의 근본적인 모티베이션이 되었다. 하지만 10번의 제약사항에 의하여 런타임에서 dynamic하게 함수/매개변수에 접근할 수 없었기 때문에 debugger가 참조하는 프레임 객체와 비슷한 것 중 functools.partial에서 필요한 정보만 담은 global variable을 직접 만들어 구현했다.

가장 먼저 진행한 부분은 함수 signature를 저장하는 방법을 찾는 것이었다. functools.partial과 같은 함수는 parameter의 위치 및 key를 이용하여 default parameter를 binding할 수 있었기 때문에 해당하는 정보를 저장해야 했다. 결론만 말하자면 다음과 같은 함수가 있을 때

function sample(a, b, c) { ... }

[(a, 1), (b, 2), (c, 3)] 과 같은 형태로 함수의 signature가 저장되기를 원했다. 하지만 array는 element로 array를 가질 수 없기에(array의 원소에 array를 할당하려 하면 syntax error), [(a, 1), (b, 2), (c, 3)]의 string representation을 다음과 같이 저장했다.

SSEP = "\035"
"1" SUBSEP "a" SSEP "2" SUBSEP "b" SSEP "3" SUBSEP "c"

구분자가 2개가 필요했는데 하나는 튜플 안에서 데이터를 구분하는 구분자로 사용된 SUBSEP, 그리고 리스트에서 각 튜플의 구분자로 사용된 SSEP이다. 이렇게 function signature를 string으로 표현하여 global variable인 FUNCSIG 테이블에 함수명을 키로, function signature의 string repr을 value로 저장한다. 그러면 대충 python으로 보면 이런 느낌이 된다.

FUNCSIG["sample"] = "1\034a\0352\034b\0353\034c"

그리고 실제로 사용할 때는 SSEP과 SUBSEP으로 split하여(deserialize하여) {"a":1,"b":2,"c":3} 과 같은 형태로 사용한다.

# save function signature to global variable FUNCSIG
# argument information is of form list of tuples (position, parameter name)
# list element delemter: SSEP, key-value delemeter: SUBSEP
function saveSignature(fnname, argInfo) {
  posRepr = bindPosition(argInfo)
  FUNCSIG[fnname] = posRepr
}

function bindPosition(array,    acc) {
  for (i = 1; i <= length(array); i++) {
    acc = acc i SUBSEP array[i] SSEP
  }
  return substr(acc, 1, length(acc) - 1)
}

두번째로는 진행한 함수는 binding된 함수를 만드는 함수이다. functools의 partial이 하는 역할과 같다고 보면 된다.

원본함수명(fnname)과 default parameter의 정보(bindings)를 받아 원본 함수의 parameter 중 명시적으로 호출하지 않은 매개변수는 bindings로 미리 정의한 매개변수를 사용하는 함수의 이름을 key로 등록하는 동작을 awk용으로 바꾼 것이다.

>>> from functools import partial
>>> def fnname(a, b):
...     print(f"a: {a}, b: {b}")
... 
>>> key = partial(fnname, b=3)
>>> key(1)
a: 1, b: 3
function fnname(a, b) {
    printf "a: %s, b: %s", a, b
}
# 정의부
key = "partial_fn"
bind(key, "fnname", "b" SUBSEP "3") # partial_fn = partial(fnname, b=3)과 같은 역할

# 사용부
call(key, "a" SUBSEP "1") # partial_fn(a=1)과 같은 역할 == @key(a=1)과 같은 역할

매개변수는 argument를 binding하는 정보를 담고 있는 array(bindings)와 원본 함수명(fnname) 그리고 binding한 함수명(key)으로 구성된다.

함수명을 통한 함수 간접호출은 gawk에서 @fn 문법으로 가능하기 때문에, 어떤 함수에 어떤 parameter가 바인딩 되었는지를 정보로 전달하고 binding된 새로운 함수를 key로 global variable BINDING이 가지고 있다가 call 함수에 의해 해당 정보를 찾아 reconstruction을 통해 호출하는 방법이다. 최대한의 유연성을 확보하기 위하여 bindings는 associative array로 설계했고, 위에서 저장한 function signature와 실제 실행 책임을 가진 함수 call에서 호출할 args와 함께 사용된다.

binding한 정보는 [원본함수명] [(매개변수1, 값1), (매개변수2, 값2), ...] 와 같은 형태로 저장된다. 물론, awk에는 string과 number만 primitive type으로 가지므로 string representation 형태로 저장한다.

# save binding arguments to global variable BINDING
# key will be used as partial function(default parameter from binding info)
# the form value consists two parts, head and tails separated with first SSEP
# head contains `original function name`
# tail is of form string representation of the list of tuple, which argName SUBSEP value
# each elements is joined with SSEP
function bind(key, fnname, bindings,    argRepr) {
  argRepr = fnname SSEP

  if (length(bindings) == 0) {
    BINDING[key] = argRepr
    return
  }
  argRepr = argRepr serializeAssoc(bindings)
  BINDING[key] = argRepr
}

헬퍼 함수 serializeAssoc을 사용했다.

function serializeAssoc(assoc,    acc) {
  for (key in assoc) {
    acc = acc key SUBSEP assoc[key] SSEP
  }
  return substr(acc, 1, length(acc) - 1)
}

위에서 만든 바인딩된 함수를 호출하는 함수 call이다. 실제 함수호출을 담당하고 내부로직이 가장 복잡한 함수이다. function signature는 다음과 같다.

function call(key, args,    bindings)

위에서 정의한 key로 BINDING에서 argRepr을 가져온다. argRepr의 첫 번째 위치에 있는 함수명을 추출한다 추출한 함수명으로 FUNCSIG에 저장된 posRepr를 가져온다.

argRepr의 두 번째 위치에 있는 binding 정보를 복원하고 원본함수의 function signature를 담고 있는 posRepr을 각각 복원하여, 실제로 호출할 args와 결합하여 호출한다.

전반부는 실제 파라미터를 생성하는 부분으로 구성된다.

function call(key, args,    bindings) {
  if (!BINDING[key]) {
    print "unregistered function call"
    return
  }
  buildParameter(key, args, params)

buildParameter 함수는 바인딩된 함수를 호출할 args를 우선적으로 적용하고 args에서 채워지지 않은 매개변수는 bindingRepr에서 표현된 매개변수 정보에서 채워넣는다. 만약 모든 parameter가 채워지지 않았다면 에러를 출력한다. multi return을 위하여 params 배열을 이용한다.

function buildParameter(key, args, params) {
  partition(BINDING[key], SSEP, fnBinding)
  fnname = fnBinding[1]
  inspectParams(fnname, paramDict)
  bindingRepr = fnBinding[2]
  bindingRepr2Dict(bindingRepr, bindingDict)

  for (idx in args) {
    params[idx] = args[idx]
  }
  for (idx in paramDict) {
    if (!params[paramDict[idx]]) {
      params[paramDict[idx]] = bindingDict[idx]
    }
  }
  if (length(paramDict) != length(params)) {
    print "invalid execution, mismatch between original function and binded function"
    delete params
  }
}

partition은 헬퍼함수이다. separator를 기준으로 전후를 잘라낸다. 역시 multi return이 필요하기 때문에 headtail 매개변수 배열을 이용한다.

function partition(str, sep, headtail) {
  headtail[1] = substr(str, 1, index(str, sep) - length(sep))
  headtail[2] = substr(str, index(str, sep) + length(sep))
}

bindingRepr2Dict는 string representation을 dictionary(associative array)로 복원하는 함수이다. 내용이 간단하므로 먼저 소개한다. BINDING global 변수와 관련있다.

function bindingRepr2Dict(repr, bindingDict,    tmp) {
  split(repr, tmp, SSEP)
  for (idx in tmp) {
    split(tmp[idx], keyVal, SUBSEP)
    bindingDict[keyVal[1]] = keyVal[2]
  }
}

inspectParams는 원본 함수의 function signature를 담고 있는 FUNCSIG global 변수와 관련있다.

function inspectParams(fnname, paramDict) {
  posRepr = FUNCSIG[fnname]
  posRepr2Dict(posRepr, paramDict)
}

function posRepr2Dict(posRepr, paramDict,    tmp, posNameTuple) {
  split(posRepr, tmp, SSEP)
  for (idx in tmp) {
    split(tmp[idx], posName, SUBSEP)
    paramDict[posName[2]] = posName[1]
  }
}

아래 부분이 비즈니스 로직으로, 명시적으로 호출하는 매개변수를 이용해 원본 함수의 funciton signature를 최대한 채워 넣은 후 비어있는 매개변수에 대하여 bindingDict에서 정의되어 있다면 나머지를 채워 넣는 식으로 작동한다.

  for (idx in args) {
    params[idx] = args[idx]
  }
  for (idx in paramDict) {
    if (!params[paramDict[idx]]) {
      params[paramDict[idx]] = bindingDict[idx]
    }
  }

물론, 명시적으로 주어진 parameter와 binding된 매개변수 모두 사용해도 함수가 요구하는 매개변수를 모두 채우지 못한다면 에러메시지를 출력한다.

  if (length(paramDict) != length(params)) {
    print "invalid execution, mismatch between original function and binded function"
    delete params
  }

사실 위의 코드에서는 exit로 나가도 좋다

이렇게 parameter를 구성하면 남은 작업은 간단하다. 매개변수의 개수에 따라 해당하는 함수를 동적으로 호출하는 부분만 남았다. call 함수의 후반부 코드를 보자.


  switch (length(params)) {
    case 1:
      executeFunc1(fnname, params)
      break
    case 2:
      executeFunc2(fnname, params)
      break
    case 3:
      executeFunc3(fnname, params)
      break
    case 4:
      executeFunc4(fnname, params)
      break
    default:
      print "#(function params) must one of 1, 2, 3, or 4"
      return
  }

여러 helper 함수를 사용하는데, 이것은 awk가 동적 프로그래밍이 불가능하기 때문이다. 쉽게 말하면 eval이 없어서 각종 템플릿에 맞는 함수를 하나씩 사전에 정의해 두어야 한다.


function executeFunc1(fnname, params) {
  @fnname(params[1])
}

function executeFunc2(fnname, params) {
  @fnname(params[1], params[2])
}

function executeFunc3(fnname, params) {
  @fnname(params[1], params[2], params[3])
}

function executeFunc4(fnname, params) {
  @fnname(params[1], params[2], params[3], params[4])
}

이상을 모두 적용한 전체 코드는 다음과 같다.


function sample(a, b, c) {
  printf "a: %s, b: %s, c: %s\n", a, b, c
}

# save binding arguments to global variable BINDING
# key will be used as partial function(default parameter from binding info)
# the form value consists two parts, head and tails separated with first SSEP
# head contains `original function name`
# tail is of form string representation of the list of tuple, which argName SUBSEP value
# each elements is joined with SSEP
function bind(key, fnname, bindings,    argRepr) {
  argRepr = fnname SSEP

  if (length(bindings) == 0) {
    BINDING[key] = argRepr
    return
  }
  argRepr = argRepr serializeAssoc(bindings)
  BINDING[key] = argRepr
}

function serializeAssoc(assoc,    acc) {
  for (key in assoc) {
    acc = acc key SUBSEP assoc[key] SSEP
  }
  return substr(acc, 1, length(acc) - 1)
}

function bindPosition(array,    acc) {
  for (i = 1; i <= length(array); i++) {
    acc = acc i SUBSEP array[i] SSEP
  }
  return substr(acc, 1, length(acc) - 1)
}

function flip(assoc) {
  for (idx in assoc) {
    assoc[assoc[idx]] = idx
  }
}

function printArray(arr, arrName) {
  for (idx in arr) {
    printf "%s[%s]: %s\n", (arrName ? arrName : "arr"), idx, arr[idx]
  }
}

function apply(arr, fn) {
  for (idx in arr) {
    arr[idx] = @fn(arr[idx])
  }
}

function strReprArr2dict(strReprArr, dict,    strRepr) {
  delete dict
  for (i = 1; i <= length(strReprArr); i++) {
    strRepr = strReprArr[i]
    partition(strRepr, SUBSEP, headtail)
    dict[headtail[1]] = headtail[2]
  }
}

function partition(str, sep, headtail) {
  headtail[1] = substr(str, 1, index(str, sep) - length(sep))
  headtail[2] = substr(str, index(str, sep) + length(sep))
}

function call(key, args,    bindings) {
  if (!BINDING[key]) {
    print "unregistered function call"
    return
  }
  buildParameter(key, args, params)

  switch (length(params)) {
    case 1:
      executeFunc1(fnname, params)
      break
    case 2:
      executeFunc2(fnname, params)
      break
    case 3:
      executeFunc3(fnname, params)
      break
    case 4:
      executeFunc4(fnname, params)
      break
    default:
      print "#(function params) must one of 1, 2, 3, or 4"
      return
  }

}

function buildParameter(key, args, params) {
  partition(BINDING[key], SSEP, fnBinding)
  fnname = fnBinding[1]
  inspectParams(fnname, paramDict)
  bindingRepr = fnBinding[2]
  bindingRepr2Dict(bindingRepr, bindingDict)

  for (idx in args) {
    params[idx] = args[idx]
  }
  for (idx in paramDict) {
    if (!params[paramDict[idx]]) {
      params[paramDict[idx]] = bindingDict[idx]
    }
  }
  if (length(paramDict) != length(params)) {
    print "invalid execution, mismatch between original function and binded function"
    delete params
  }
}

function bindingRepr2Dict(repr, bindingDict,    tmp) {
  split(repr, tmp, SSEP)
  for (idx in tmp) {
    split(tmp[idx], keyVal, SUBSEP)
    bindingDict[keyVal[1]] = keyVal[2]
  }
}

function inspectParams(fnname, paramDict) {
  posRepr = FUNCSIG[fnname]
  posRepr2Dict(posRepr, paramDict)
}

function posRepr2Dict(posRepr, paramDict,    tmp, posNameTuple) {
  split(posRepr, tmp, SSEP)
  for (idx in tmp) {
    split(tmp[idx], posName, SUBSEP)
    paramDict[posName[2]] = posName[1]
  }
}

function executeFunc1(fnname, params) {
  @fnname(params[1])
}

function executeFunc2(fnname, params) {
  @fnname(params[1], params[2])
}

function executeFunc3(fnname, params) {
  @fnname(params[1], params[2], params[3])
}

function executeFunc4(fnname, params) {
  @fnname(params[1], params[2], params[3], params[4])
}

# save function signature to global variable FUNCSIG
# argument information is of form list of tuples (position, parameter name)
# list element delemter: SSEP, key-value delemeter: SUBSEP
function saveSignature(fnname, argInfo) {
  posRepr = bindPosition(argInfo)
  FUNCSIG[fnname] = posRepr
}

function zip(arr1, arr2, dict) {
  minlen = (length(arr1) < length(arr2) ? length(arr1) : length(arr2))
  for (i = 1; i <= minlen; i++) {
    dict[arr1[i]] = arr2[i]
  }
}

BEGIN {
  SSEP = "\035"
  split("a b c", arginfo)
  saveSignature("sample", arginfo)
  split("b c", keys)
  split("5678 asdf", vals)
  zip(keys, vals, bindings)
  bind("partial", "sample", bindings)
  split("1", args)
  call("partial", args)
}

적절한 라이브러리에 분리하고 import를 사용하면 다음과 같다.


@include "common"
@include "functool"


function sample(a, b, c) {
  printf "a: %s, b: %s, c: %s\n", a, b, c
}

BEGIN {
  SSEP = "\035"
  split("a b c", arginfo)
  saveSignature("sample", arginfo)
  split("b c", keys)
  split("5678 asdf", vals)
  zip(keys, vals, bindings)
  bind("partial", "sample", bindings)
  split("1", args)
  call("partial", args)
}

출력 결과는 아래와 같다.

a: 1, b: 5678, c: asdf
Karsten Schmidt's avatar
Karsten Schmidt

@toxi@mastodon.thi.ng

— New version 3.1.0 of the recently talked about thi.ng/args package, a declarative & functional CLI argument parser & app framework. I updated the arg specifications to be fully self-describing & serializable (with minor exceptions), and streamlined the API for factory functions to define the specs.

Why is this useful? For example, now I can (already have!) implemented a CLI as separate short-lived client/process which only acts as RPC frontend/proxy for the actual CLI commands defined & executed in a long running app server, which is heavily based on a plugin architecture. Each plugin can contribute any number of CLI commands, each with its own set of args/options... When the CLI client app is launched, it first retrieves a list of these registered commands and all their options from the server, then uses the thi.ng/args CLI framework to select the right command, validate its options or display formatted usage info. If all is ok, the command is then triggered via an HTTP request to the app server, executes there and the command's log messages are send back as response...

Block diagram giving a highlevel overview of a software architecture consisting of: app server, router, CLI and a number of plugins. These app component interact with each other via registrations and delegations. A separate box "CLI RPC" relates to a separate client app which only interacts with the app server and is used as remote frontend for invoking commands inside the (much longer running) main app.
ALT text detailsBlock diagram giving a highlevel overview of a software architecture consisting of: app server, router, CLI and a number of plugins. These app component interact with each other via registrations and delegations. A separate box "CLI RPC" relates to a separate client app which only interacts with the app server and is used as remote frontend for invoking commands inside the (much longer running) main app.
Karsten Schmidt's avatar
Karsten Schmidt

@toxi@mastodon.thi.ng

Finally got around documenting a little more the small CLI app "framework" I've been using for almost a dozen projects now (incl. several work projects). The package in question is now already 3 years old (thi.ng/args), but I've only just managed now to add a basic, commented usage example for this `cliApp()` feature to the readme:

Defining a multi-command CLI app (incl. two sub-commands):
github.com/thi-ng/umbrella/blo

Also part of this: I've refactored a few other projects to simplify their CLI handling using this `cliApp()` wrapper (project links are in the above readme, in case you'd like to see more advanced/realworld uses...) One of the (non-public) work projects ended up consisting of up to a dozen sub-commands and I found this declarative and modular setup to be very, very helpful (and elegant)...

Karsten Schmidt's avatar
Karsten Schmidt

@toxi@mastodon.thi.ng

Finally got around documenting a little more the small CLI app "framework" I've been using for almost a dozen projects now (incl. several work projects). The package in question is now already 3 years old (thi.ng/args), but I've only just managed now to add a basic, commented usage example for this `cliApp()` feature to the readme:

Defining a multi-command CLI app (incl. two sub-commands):
github.com/thi-ng/umbrella/blo

Also part of this: I've refactored a few other projects to simplify their CLI handling using this `cliApp()` wrapper (project links are in the above readme, in case you'd like to see more advanced/realworld uses...) One of the (non-public) work projects ended up consisting of up to a dozen sub-commands and I found this declarative and modular setup to be very, very helpful (and elegant)...

Florian Pichler's avatar
Florian Pichler

@fp@social.lol

If you're working in the command line daily, here are some tools that made my life better:

- github.com/ajeetdsouza/zoxide for switching directories with more comfort
- github.com/eza-community/eza for more pleasant directory listings
- atuin.sh for helpful history
- github.com/BurntSushi/ripgrep for faster search in files
- github.com/junegunn/fzf for finding files faster
- starship.rs for fast helpful shell prompts

And give fishshell.com a try while you're at it, it's great.

Florian Pichler's avatar
Florian Pichler

@fp@social.lol

If you're working in the command line daily, here are some tools that made my life better:

- github.com/ajeetdsouza/zoxide for switching directories with more comfort
- github.com/eza-community/eza for more pleasant directory listings
- atuin.sh for helpful history
- github.com/BurntSushi/ripgrep for faster search in files
- github.com/junegunn/fzf for finding files faster
- starship.rs for fast helpful shell prompts

And give fishshell.com a try while you're at it, it's great.

Neville Park's avatar
Neville Park

@nev@status.nevillepark.ca

I only just learned you can use the mouse in the TTY! (The Linux text-only console you get to by pressing Ctrl+Alt+F1, F2, etc.)

Some applications that enable this are gpm and consolation.

consolation worked better for me, especially when in tmux; however, I still can't get scrolling with middle button and trackpoint to work, which is what would be the most useful for me. I don't know if it has to do with consolation, tmux mouse bindings, my particular ThinkPad model, etc. I can't find anything online about this, so if you've also dabbled in this, please share your experience!

#CommandLine #cli #tmux #tty #linux #thinkpad

Karsten Schmidt's avatar
Karsten Schmidt

@toxi@mastodon.thi.ng

Speaking of new tools: Here's some other open-ended and work-in-progress tooling I published recently:

Assorted CLI utilities for data wrangling & media conversion
codeberg.org/thi.ng/thing-tools

This is (will be) a Swiss-army knife type multi-tool for frequent little tasks I've been encountering and not found satisfactory equivalent other solutions for. So far, there're only two commands published, but a dozen or so more are to come (for which I still have more cleaning up to do, also in upstream projects):

- CSV-to-JSON parsing/conversion, with configurable filtering, renaming and column value coercions
- De-dupe lines with support for regexp-based inclusions, exclusions and pattern-based uniqueness. Patterns can be read from files.

The readme contains installation instructions and documentation for all commands, their options and some example use cases. E.g. I regularly use the `dedupe-lines` command to cleanup my `.bash_history` file.

Using bun.sh, the tool can be compiled into a standalone executable.

All commands share common infrastructure of the main CLI tooling (based on thi.ng/args and many other thi.ng/umbrella packages). This reduces the code size of each command and makes it trivial to add additional commands (or share functionality, invoke some of those other commands for sub-tasks). There're also re-usable CLI arg specs to provide a uniform "API" for certain types of parameters.

Some of the still unreleased commands are for `ffmpeg` workflows/tasks, will update when ready...

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@hongminhee@hollo.social

Optique 0.4.0 Released!

Big update for our type-safe combinatorial parser for :

  • Labeled merge groups: organize options logically
  • Rich docs: brief, description & footer support
  • @optique/temporal: new package for date/time parsing
  • showDefault: automatic default value display

The help text has never looked this good!

.js

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@hongminhee@hackers.pub


We're excited to announce Optique 0.4.0, which brings significant improvements to help text organization, enhanced documentation capabilities, and introduces comprehensive Temporal API support.

Optique is a type-safe combinatorial CLI parser for TypeScript that makes building command-line interfaces intuitive and maintainable. This release focuses on making your CLI applications more user-friendly and maintainable.

Better help text organization

One of the most visible improvements in Optique 0.4.0 is the enhanced help text organization. You can now label and group your options more effectively, making complex CLIs much more approachable for users.

Labeled merge groups

The merge() combinator now accepts an optional label parameter, solving a common pain point where developers had to choose between clean code structure and organized help output:

// Before: unlabeled merged options appeared scattered
const config = merge(connectionOptions, performanceOptions);

// Now: group related options under a clear section
const config = merge(
  "Server Configuration",  // New label parameter
  connectionOptions,
  performanceOptions
);

This simple addition makes a huge difference in help text readability, especially for CLIs with many options spread across multiple reusable modules.

The resulting help output clearly organizes options under the Server Configuration section:

Demo app showcasing labeled merge groups
Usage: demo-merge.ts --host STRING --port INTEGER --timeout INTEGER --retries
       INTEGER

Server Configuration:
  --host STRING               Server hostname or IP address
  --port INTEGER              Port number for the connection
  --timeout INTEGER           Connection timeout in seconds
  --retries INTEGER           Number of retry attempts

The new group() combinator

For cases where merge() doesn't apply, the new group() combinator lets you wrap any parser with a documentation label:

// Group mutually exclusive options under a clear section
const outputFormat = group(
  "Output Format",
  or(
    map(flag("--json"), () => "json"),
    map(flag("--yaml"), () => "yaml"),
    map(flag("--xml"), () => "xml"),
  )
);

This is particularly useful for organizing mutually exclusive flags, multiple inputs, or any parser that doesn't natively support labeling. The resulting help text becomes much more scannable and user-friendly.

Here's how the grouped output format options appear in the help text:

Demo app showcasing group combinator
Usage: demo-group.ts --json
       demo-group.ts --yaml
       demo-group.ts --xml

Output Format:
  --json                      Output in JSON format
  --yaml                      Output in YAML format
  --xml                       Output in XML format

Rich documentation support

Optique 0.4.0 introduces comprehensive documentation fields that can be added directly through the run() function, eliminating the need to modify parser definitions for documentation purposes.

Brief descriptions, detailed explanations, and footers

Both @optique/core/facade and @optique/run now support brief, description, and footer options through the run() function:

import { run } from "@optique/run";
import { message } from "@optique/core/message";

const result = run(parser, {
  brief: message`A powerful data processing tool`,
  description: message`This tool provides comprehensive data processing capabilities with support for multiple formats and transformations. It can handle JSON, YAML, and CSV files with automatic format detection.`,
  footer: message`Examples:
  myapp process data.json --format yaml
  myapp validate config.toml --strict

For more information, visit https://example.com/docs`,
  help: "option"
});

These documentation fields appear in both help output and error messages (when configured), providing consistent context throughout your CLI's user experience.

The complete help output demonstrates the rich documentation features with brief description, detailed explanation, option descriptions, default values, and footer information:

A powerful data processing tool
Usage: demo-rich-docs.ts [--port INTEGER] [--format STRING] --verbose STRING

This tool provides comprehensive data processing capabilities with support for
multiple formats and transformations. It can handle JSON, YAML, and CSV files
with automatic format detection.

  --port INTEGER              Server port number [3000]
  --format STRING             Output format [json]
  --verbose STRING            Verbosity level

Examples:
  myapp process data.json --format yaml
  myapp validate config.toml --strict

For more information, visit https://example.com/docs

These documentation fields appear in both help output and error messages (when configured), providing consistent context throughout your CLI's user experience.

Display default values

A frequently requested feature is now available: showing default values directly in help text. Enable this with the new showDefault option when using withDefault():

const parser = object({
  port: withDefault(
    option("--port", integer(), { description: message`Server port number` }),
    3000,
  ),
  format: withDefault(
    option("--format", string(), { description: message`Output format` }),
    "json",
  ),
});

run(parser, { showDefault: true });

// Or with custom formatting:
run(parser, {
  showDefault: {
    prefix: " (default: ",
    suffix: ")"
  }  // Shows: --port (default: 3000)
});

Default values are automatically dimmed when colors are enabled, making them visually distinct while remaining readable.

The help output shows default values clearly marked next to each option:

Usage: demo-defaults.ts [--port INTEGER] [--format STRING]

  --port INTEGER              Server port number [3000]
  --format STRING             Output format [json]

Temporal API support

Optique 0.4.0 introduces a new package, @optique/temporal, providing comprehensive support for the modern Temporal API. This brings type-safe parsing for dates, times, durations, and time zones:

import { instant, duration, zonedDateTime } from "@optique/temporal";
import { option } from "@optique/core/parser";

const parser = object({
  // Parse ISO 8601 timestamps
  timestamp: option("--at", instant()),

  // Parse durations like "PT30M" or "P1DT2H"
  timeout: option("--timeout", duration()),

  // Parse zoned datetime with timezone info
  meeting: option("--meeting", zonedDateTime()),
});

The temporal parsers return native Temporal objects with full functionality:

const result = parse(timestampArg, ["2023-12-25T10:30:00Z"]);
if (result.success) {
  const instant = result.value;
  console.log(`UTC: ${instant.toString()}`);
  console.log(`Seoul: ${instant.toZonedDateTimeISO("Asia/Seoul")}`);
}

Install the new package with:

npm add @optique/temporal

Improved type inference

The merge() combinator now supports up to 10 parsers (previously 5), and the tuple() parser has improved type inference using TypeScript's const type parameter. These enhancements enable more complex CLI structures while maintaining perfect type safety.

Breaking changes

While we've maintained backward compatibility for most APIs, there are a few changes to be aware of:

  • The Parser.getDocFragments() method now uses DocState<TState> instead of direct state values (only affects custom parser implementations)
  • The merge() combinator now enforces stricter type constraints at compile time, rejecting non-object-producing parsers

Learn more

For a complete list of changes, bug fixes, and improvements, see the full changelog.

Check out the updated documentation:

Installation

Upgrade to Optique 0.4.0:

npm update @optique/core @optique/run
# or
deno add jsr:@optique/core@^0.4.0 jsr:@optique/run@^0.4.0

Add temporal support (optional):

npm add @optique/temporal
# or
deno add jsr:@optique/temporal

We hope these improvements make building CLI applications with Optique even more enjoyable. As always, we welcome your feedback and contributions on GitHub.

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@hongminhee@hollo.social

Optique 0.4.0 Released!

Big update for our type-safe combinatorial parser for :

  • Labeled merge groups: organize options logically
  • Rich docs: brief, description & footer support
  • @optique/temporal: new package for date/time parsing
  • showDefault: automatic default value display

The help text has never looked this good!

.js

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@hongminhee@hackers.pub


We're excited to announce Optique 0.4.0, which brings significant improvements to help text organization, enhanced documentation capabilities, and introduces comprehensive Temporal API support.

Optique is a type-safe combinatorial CLI parser for TypeScript that makes building command-line interfaces intuitive and maintainable. This release focuses on making your CLI applications more user-friendly and maintainable.

Better help text organization

One of the most visible improvements in Optique 0.4.0 is the enhanced help text organization. You can now label and group your options more effectively, making complex CLIs much more approachable for users.

Labeled merge groups

The merge() combinator now accepts an optional label parameter, solving a common pain point where developers had to choose between clean code structure and organized help output:

// Before: unlabeled merged options appeared scattered
const config = merge(connectionOptions, performanceOptions);

// Now: group related options under a clear section
const config = merge(
  "Server Configuration",  // New label parameter
  connectionOptions,
  performanceOptions
);

This simple addition makes a huge difference in help text readability, especially for CLIs with many options spread across multiple reusable modules.

The resulting help output clearly organizes options under the Server Configuration section:

Demo app showcasing labeled merge groups
Usage: demo-merge.ts --host STRING --port INTEGER --timeout INTEGER --retries
       INTEGER

Server Configuration:
  --host STRING               Server hostname or IP address
  --port INTEGER              Port number for the connection
  --timeout INTEGER           Connection timeout in seconds
  --retries INTEGER           Number of retry attempts

The new group() combinator

For cases where merge() doesn't apply, the new group() combinator lets you wrap any parser with a documentation label:

// Group mutually exclusive options under a clear section
const outputFormat = group(
  "Output Format",
  or(
    map(flag("--json"), () => "json"),
    map(flag("--yaml"), () => "yaml"),
    map(flag("--xml"), () => "xml"),
  )
);

This is particularly useful for organizing mutually exclusive flags, multiple inputs, or any parser that doesn't natively support labeling. The resulting help text becomes much more scannable and user-friendly.

Here's how the grouped output format options appear in the help text:

Demo app showcasing group combinator
Usage: demo-group.ts --json
       demo-group.ts --yaml
       demo-group.ts --xml

Output Format:
  --json                      Output in JSON format
  --yaml                      Output in YAML format
  --xml                       Output in XML format

Rich documentation support

Optique 0.4.0 introduces comprehensive documentation fields that can be added directly through the run() function, eliminating the need to modify parser definitions for documentation purposes.

Brief descriptions, detailed explanations, and footers

Both @optique/core/facade and @optique/run now support brief, description, and footer options through the run() function:

import { run } from "@optique/run";
import { message } from "@optique/core/message";

const result = run(parser, {
  brief: message`A powerful data processing tool`,
  description: message`This tool provides comprehensive data processing capabilities with support for multiple formats and transformations. It can handle JSON, YAML, and CSV files with automatic format detection.`,
  footer: message`Examples:
  myapp process data.json --format yaml
  myapp validate config.toml --strict

For more information, visit https://example.com/docs`,
  help: "option"
});

These documentation fields appear in both help output and error messages (when configured), providing consistent context throughout your CLI's user experience.

The complete help output demonstrates the rich documentation features with brief description, detailed explanation, option descriptions, default values, and footer information:

A powerful data processing tool
Usage: demo-rich-docs.ts [--port INTEGER] [--format STRING] --verbose STRING

This tool provides comprehensive data processing capabilities with support for
multiple formats and transformations. It can handle JSON, YAML, and CSV files
with automatic format detection.

  --port INTEGER              Server port number [3000]
  --format STRING             Output format [json]
  --verbose STRING            Verbosity level

Examples:
  myapp process data.json --format yaml
  myapp validate config.toml --strict

For more information, visit https://example.com/docs

These documentation fields appear in both help output and error messages (when configured), providing consistent context throughout your CLI's user experience.

Display default values

A frequently requested feature is now available: showing default values directly in help text. Enable this with the new showDefault option when using withDefault():

const parser = object({
  port: withDefault(
    option("--port", integer(), { description: message`Server port number` }),
    3000,
  ),
  format: withDefault(
    option("--format", string(), { description: message`Output format` }),
    "json",
  ),
});

run(parser, { showDefault: true });

// Or with custom formatting:
run(parser, {
  showDefault: {
    prefix: " (default: ",
    suffix: ")"
  }  // Shows: --port (default: 3000)
});

Default values are automatically dimmed when colors are enabled, making them visually distinct while remaining readable.

The help output shows default values clearly marked next to each option:

Usage: demo-defaults.ts [--port INTEGER] [--format STRING]

  --port INTEGER              Server port number [3000]
  --format STRING             Output format [json]

Temporal API support

Optique 0.4.0 introduces a new package, @optique/temporal, providing comprehensive support for the modern Temporal API. This brings type-safe parsing for dates, times, durations, and time zones:

import { instant, duration, zonedDateTime } from "@optique/temporal";
import { option } from "@optique/core/parser";

const parser = object({
  // Parse ISO 8601 timestamps
  timestamp: option("--at", instant()),

  // Parse durations like "PT30M" or "P1DT2H"
  timeout: option("--timeout", duration()),

  // Parse zoned datetime with timezone info
  meeting: option("--meeting", zonedDateTime()),
});

The temporal parsers return native Temporal objects with full functionality:

const result = parse(timestampArg, ["2023-12-25T10:30:00Z"]);
if (result.success) {
  const instant = result.value;
  console.log(`UTC: ${instant.toString()}`);
  console.log(`Seoul: ${instant.toZonedDateTimeISO("Asia/Seoul")}`);
}

Install the new package with:

npm add @optique/temporal

Improved type inference

The merge() combinator now supports up to 10 parsers (previously 5), and the tuple() parser has improved type inference using TypeScript's const type parameter. These enhancements enable more complex CLI structures while maintaining perfect type safety.

Breaking changes

While we've maintained backward compatibility for most APIs, there are a few changes to be aware of:

  • The Parser.getDocFragments() method now uses DocState<TState> instead of direct state values (only affects custom parser implementations)
  • The merge() combinator now enforces stricter type constraints at compile time, rejecting non-object-producing parsers

Learn more

For a complete list of changes, bug fixes, and improvements, see the full changelog.

Check out the updated documentation:

Installation

Upgrade to Optique 0.4.0:

npm update @optique/core @optique/run
# or
deno add jsr:@optique/core@^0.4.0 jsr:@optique/run@^0.4.0

Add temporal support (optional):

npm add @optique/temporal
# or
deno add jsr:@optique/temporal

We hope these improvements make building CLI applications with Optique even more enjoyable. As always, we welcome your feedback and contributions on GitHub.

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@hongminhee@hollo.social

Optique 0.4.0 Released!

Big update for our type-safe combinatorial parser for :

  • Labeled merge groups: organize options logically
  • Rich docs: brief, description & footer support
  • @optique/temporal: new package for date/time parsing
  • showDefault: automatic default value display

The help text has never looked this good!

.js

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@hongminhee@hackers.pub


We're excited to announce Optique 0.4.0, which brings significant improvements to help text organization, enhanced documentation capabilities, and introduces comprehensive Temporal API support.

Optique is a type-safe combinatorial CLI parser for TypeScript that makes building command-line interfaces intuitive and maintainable. This release focuses on making your CLI applications more user-friendly and maintainable.

Better help text organization

One of the most visible improvements in Optique 0.4.0 is the enhanced help text organization. You can now label and group your options more effectively, making complex CLIs much more approachable for users.

Labeled merge groups

The merge() combinator now accepts an optional label parameter, solving a common pain point where developers had to choose between clean code structure and organized help output:

// Before: unlabeled merged options appeared scattered
const config = merge(connectionOptions, performanceOptions);

// Now: group related options under a clear section
const config = merge(
  "Server Configuration",  // New label parameter
  connectionOptions,
  performanceOptions
);

This simple addition makes a huge difference in help text readability, especially for CLIs with many options spread across multiple reusable modules.

The resulting help output clearly organizes options under the Server Configuration section:

Demo app showcasing labeled merge groups
Usage: demo-merge.ts --host STRING --port INTEGER --timeout INTEGER --retries
       INTEGER

Server Configuration:
  --host STRING               Server hostname or IP address
  --port INTEGER              Port number for the connection
  --timeout INTEGER           Connection timeout in seconds
  --retries INTEGER           Number of retry attempts

The new group() combinator

For cases where merge() doesn't apply, the new group() combinator lets you wrap any parser with a documentation label:

// Group mutually exclusive options under a clear section
const outputFormat = group(
  "Output Format",
  or(
    map(flag("--json"), () => "json"),
    map(flag("--yaml"), () => "yaml"),
    map(flag("--xml"), () => "xml"),
  )
);

This is particularly useful for organizing mutually exclusive flags, multiple inputs, or any parser that doesn't natively support labeling. The resulting help text becomes much more scannable and user-friendly.

Here's how the grouped output format options appear in the help text:

Demo app showcasing group combinator
Usage: demo-group.ts --json
       demo-group.ts --yaml
       demo-group.ts --xml

Output Format:
  --json                      Output in JSON format
  --yaml                      Output in YAML format
  --xml                       Output in XML format

Rich documentation support

Optique 0.4.0 introduces comprehensive documentation fields that can be added directly through the run() function, eliminating the need to modify parser definitions for documentation purposes.

Brief descriptions, detailed explanations, and footers

Both @optique/core/facade and @optique/run now support brief, description, and footer options through the run() function:

import { run } from "@optique/run";
import { message } from "@optique/core/message";

const result = run(parser, {
  brief: message`A powerful data processing tool`,
  description: message`This tool provides comprehensive data processing capabilities with support for multiple formats and transformations. It can handle JSON, YAML, and CSV files with automatic format detection.`,
  footer: message`Examples:
  myapp process data.json --format yaml
  myapp validate config.toml --strict

For more information, visit https://example.com/docs`,
  help: "option"
});

These documentation fields appear in both help output and error messages (when configured), providing consistent context throughout your CLI's user experience.

The complete help output demonstrates the rich documentation features with brief description, detailed explanation, option descriptions, default values, and footer information:

A powerful data processing tool
Usage: demo-rich-docs.ts [--port INTEGER] [--format STRING] --verbose STRING

This tool provides comprehensive data processing capabilities with support for
multiple formats and transformations. It can handle JSON, YAML, and CSV files
with automatic format detection.

  --port INTEGER              Server port number [3000]
  --format STRING             Output format [json]
  --verbose STRING            Verbosity level

Examples:
  myapp process data.json --format yaml
  myapp validate config.toml --strict

For more information, visit https://example.com/docs

These documentation fields appear in both help output and error messages (when configured), providing consistent context throughout your CLI's user experience.

Display default values

A frequently requested feature is now available: showing default values directly in help text. Enable this with the new showDefault option when using withDefault():

const parser = object({
  port: withDefault(
    option("--port", integer(), { description: message`Server port number` }),
    3000,
  ),
  format: withDefault(
    option("--format", string(), { description: message`Output format` }),
    "json",
  ),
});

run(parser, { showDefault: true });

// Or with custom formatting:
run(parser, {
  showDefault: {
    prefix: " (default: ",
    suffix: ")"
  }  // Shows: --port (default: 3000)
});

Default values are automatically dimmed when colors are enabled, making them visually distinct while remaining readable.

The help output shows default values clearly marked next to each option:

Usage: demo-defaults.ts [--port INTEGER] [--format STRING]

  --port INTEGER              Server port number [3000]
  --format STRING             Output format [json]

Temporal API support

Optique 0.4.0 introduces a new package, @optique/temporal, providing comprehensive support for the modern Temporal API. This brings type-safe parsing for dates, times, durations, and time zones:

import { instant, duration, zonedDateTime } from "@optique/temporal";
import { option } from "@optique/core/parser";

const parser = object({
  // Parse ISO 8601 timestamps
  timestamp: option("--at", instant()),

  // Parse durations like "PT30M" or "P1DT2H"
  timeout: option("--timeout", duration()),

  // Parse zoned datetime with timezone info
  meeting: option("--meeting", zonedDateTime()),
});

The temporal parsers return native Temporal objects with full functionality:

const result = parse(timestampArg, ["2023-12-25T10:30:00Z"]);
if (result.success) {
  const instant = result.value;
  console.log(`UTC: ${instant.toString()}`);
  console.log(`Seoul: ${instant.toZonedDateTimeISO("Asia/Seoul")}`);
}

Install the new package with:

npm add @optique/temporal

Improved type inference

The merge() combinator now supports up to 10 parsers (previously 5), and the tuple() parser has improved type inference using TypeScript's const type parameter. These enhancements enable more complex CLI structures while maintaining perfect type safety.

Breaking changes

While we've maintained backward compatibility for most APIs, there are a few changes to be aware of:

  • The Parser.getDocFragments() method now uses DocState<TState> instead of direct state values (only affects custom parser implementations)
  • The merge() combinator now enforces stricter type constraints at compile time, rejecting non-object-producing parsers

Learn more

For a complete list of changes, bug fixes, and improvements, see the full changelog.

Check out the updated documentation:

Installation

Upgrade to Optique 0.4.0:

npm update @optique/core @optique/run
# or
deno add jsr:@optique/core@^0.4.0 jsr:@optique/run@^0.4.0

Add temporal support (optional):

npm add @optique/temporal
# or
deno add jsr:@optique/temporal

We hope these improvements make building CLI applications with Optique even more enjoyable. As always, we welcome your feedback and contributions on GitHub.

Elena Rossini on GoToSocial ⁂'s avatar
Elena Rossini on GoToSocial ⁂

@elena@aseachange.com

🏕️ my adventures in #selfhosting: day 259 (slow down edition) 🐌​

a blog post that discusses the sense of urgency I felt to learn #Docker (because it will become mandatory for #Ghost)... and how a recent discovery has pushed back my deadline. I can learn slowly, yay!

🔗​: https://news.elenarossini.com/my-so-called-sudo-life/my-adventures-in-self-hosting-day-259-slow-down-edition/

#MySoCalledSudoLife #CLI

Quincy's avatar
Quincy

@quincy@chaos.social

: extract structure from a blob of data

cat very-large-file.jsonl | jq -r 'paths(scalars) | map(tostring) | join(".")' | perl -ne 's/[.][0-9]+(?=[.]|$)/.[]/g; print' | python -c $'import sys\na=set()\nfor l in iter(sys.stdin.readline, ""):\n if l in a: continue\n sys.stdout.write(l)\n a.add(l)' > schema-like.txt

Quincy's avatar
Quincy

@quincy@chaos.social

pw-record -P '{ stream.capture.sink=true }' $(date -Iminutes).flac

# record audio output when using

anne.💫's avatar
anne.💫

@ann3nova@corteximplant.com

Is there a Linux CLI app that lets you unzip files with a visual interface? In the vein of something like mc or ranger?

Orhun Parmaksız 👾's avatar
Orhun Parmaksız 👾

@orhun@fosstodon.org

Terminal power users will like this 🔥

🌀 **tiny-dc** — A tiny but mighty TUI directory changer.

🚀 Faster than doing cd + ls
💯 Supports jumping to previously visited directories
🍬 Has Vim-like key bindings

🦀 Written in Rust & built with @ratatui_rs

⭐ GitHub: github.com/n1ghtmare/tiny-dc

:radare2: radare :verified:'s avatar
:radare2: radare :verified:

@radareorg@infosec.exchange

radare2 6.0 is out! (codename "brainbow" 🧠🌈)

A major release focused on stability and maintainability while bringing many new features under the hood. Breaking the ABI compatibility from the 5.9.x saga for to settle a new base for the upcoming versions.

github.com/radareorg/radare2/r

anne.💫's avatar
anne.💫

@ann3nova@corteximplant.com

Is there a Linux CLI app that lets you unzip files with a visual interface? In the vein of something like mc or ranger?

just small circles 🕊's avatar
just small circles 🕊

@smallcircles@social.coop

Behavior-driven design..

In order to have an unintuitive ,
As a I make anything possible,
So that it is theoretically simple.

pvergain (kolektiva)'s avatar
pvergain (kolektiva)

@pvergain@kolektiva.social

- willmcgugan.github.io/announci (2025-07-23, Announcing Toad - a universal UI for agentic coding in the terminal, by willmcgugan.github.io/, @willmcgugan)

--<--
I’m a little salty that neither Anthropic nor Google reached out to me before they released their terminal-based AI coding agents.

You see until recently I was the CEO of Textualize, a startup promoting rich applications for the terminal. Textualize didn’t make it as a company, but I take heart that we built something amazing. There is now a thriving community of folk building TUIs that I am still a part of.

So you will understand why when I finally got round to checking out Claude code and Gemini CLI, I was more interested in the terminal interface than the AI magic it was performing. And I was not impressed. Both projects suffer from jank and other glitches inherent to terminals that Textualize solved years ago.

....

I’m currently taking a year’s sabbatical. When Textualize wrapped up I genuinely thought I was sick of coding, and I would never gain be able to find joy in building things. I’m happy to be wrong about that. I still enjoy coding, and Toad feels like the perfect hobby project for my very particular set of skills. Something I can build while continuing to focus on my physical and mental health (running a startup is taxing).

So I am going to build it.

I am building it.

Here’s a quick video of Toad in its current state: youtube.com/watch?v=EKsCS54xdu

What I have in mind is a universal front-end for AI in the terminal. This includes both AI chat-bots and agentic coding. The architecture I alluded to earlier is that the front-end built with Python and Textual connects to a back-end subprocess. The back-end handles the interactions with the LLM and performs any agentic coding, while the front-end provides the user interface. The two sides communicate with each other by sending and receiving JSON over stdout and stdin.

...

Toad isn’t quite ready for a public release. It remains a tadpole for now, incubating in a private repository. But you know I’m all about FOSS, and when its ready for a public beta I will release Toad under an Open Source license.

With a bit of luck, this sabbatical needn’t eat in to my retirement fund too much. If it goes well, it may even become my full-time gig.

I will shortly invite a few tech friends and collaborators to the project. These things can’t be the work of a single individual and I am going to need feedback as I work. If you would like to be a part of that, then feel free to reach out. But please note, I would like to prioritize folk in the Open Source community who have potentially related projects.

For everyone else, I will be posting updates regularly here and on my socials (link at the bottom of the page). Expect screenshots, videos, and long form articles. Please be patient—you will be agentic toading before too long.

Looking for markdown streaming? : willmcgugan.github.io/streamin (Efficient streaming of Markdown in the terminal)
-->--

pvergain (kolektiva)'s avatar
pvergain (kolektiva)

@pvergain@kolektiva.social

- willmcgugan.github.io/announci (2025-07-23, Announcing Toad - a universal UI for agentic coding in the terminal, by willmcgugan.github.io/, @willmcgugan)

--<--
I’m a little salty that neither Anthropic nor Google reached out to me before they released their terminal-based AI coding agents.

You see until recently I was the CEO of Textualize, a startup promoting rich applications for the terminal. Textualize didn’t make it as a company, but I take heart that we built something amazing. There is now a thriving community of folk building TUIs that I am still a part of.

So you will understand why when I finally got round to checking out Claude code and Gemini CLI, I was more interested in the terminal interface than the AI magic it was performing. And I was not impressed. Both projects suffer from jank and other glitches inherent to terminals that Textualize solved years ago.

....

I’m currently taking a year’s sabbatical. When Textualize wrapped up I genuinely thought I was sick of coding, and I would never gain be able to find joy in building things. I’m happy to be wrong about that. I still enjoy coding, and Toad feels like the perfect hobby project for my very particular set of skills. Something I can build while continuing to focus on my physical and mental health (running a startup is taxing).

So I am going to build it.

I am building it.

Here’s a quick video of Toad in its current state: youtube.com/watch?v=EKsCS54xdu

What I have in mind is a universal front-end for AI in the terminal. This includes both AI chat-bots and agentic coding. The architecture I alluded to earlier is that the front-end built with Python and Textual connects to a back-end subprocess. The back-end handles the interactions with the LLM and performs any agentic coding, while the front-end provides the user interface. The two sides communicate with each other by sending and receiving JSON over stdout and stdin.

...

Toad isn’t quite ready for a public release. It remains a tadpole for now, incubating in a private repository. But you know I’m all about FOSS, and when its ready for a public beta I will release Toad under an Open Source license.

With a bit of luck, this sabbatical needn’t eat in to my retirement fund too much. If it goes well, it may even become my full-time gig.

I will shortly invite a few tech friends and collaborators to the project. These things can’t be the work of a single individual and I am going to need feedback as I work. If you would like to be a part of that, then feel free to reach out. But please note, I would like to prioritize folk in the Open Source community who have potentially related projects.

For everyone else, I will be posting updates regularly here and on my socials (link at the bottom of the page). Expect screenshots, videos, and long form articles. Please be patient—you will be agentic toading before too long.

Looking for markdown streaming? : willmcgugan.github.io/streamin (Efficient streaming of Markdown in the terminal)
-->--

Nick | OneThingWell.dev's avatar
Nick | OneThingWell.dev

@unixroot@indieweb.social

To prevent git from finishing the current commit/operation, your editor needs to exit with a non-zero status. In vim, you can use :cq to do that.

Nick | OneThingWell.dev's avatar
Nick | OneThingWell.dev

@unixroot@indieweb.social

To prevent git from finishing the current commit/operation, your editor needs to exit with a non-zero status. In vim, you can use :cq to do that.

Jaeyeol Lee's avatar
Jaeyeol Lee

@kodingwarrior@hackers.pub

이 글(그리고 후속작이 될 글들)은, 내 개발환경에서 자주 사용하고 있고 실제로도 애정하고 있는 도구에 대해서 소개하게 될 것 같다. 내가 어떤 환경에서 개발하고 있는지 궁금한 분들은 내 dotfiles 리포지토리를 참고해도 좋을 것 같다.

먼저, dotfiles란 무엇인가?

dotfiles라는 이름 자체만 보면 뭔가 대단해보일 것 같지만, dotfiles라는 이름 자체는 그냥 단순하다.

  • 어딘가의 가이드라인에서 지시하는대로 개발환경을 세팅하다보면, .zshrc/.bashrc 같은 것들을 마주하게 될 것이다.
  • git을 사용하고 있는 사람이라면, 어떤 diff 도구(delta, difft)를 사용할지, 어떤 alias 명령어를 등록할지 같은 것들을 명시하기 위해서 .gitconfig 같은 파일을 수정하게 될 때가 있다.
    • 물론, 이런것보다는 git config pull.rebase true 같은 명령어를 실행하는 경우가 더 많을 수 있다. 하지만, 이런 명령어를 실행하면 .gitconfig에도 그대로 기록이 된다.

위에서 언급한 예시를 보면 알 수 있겠듯이, 앞에 dot(.)이 붙어있는 설정파일이라면 dotfiles라고 할 수 있겠다. dotfiles 리포지토리를 만들어서 관리를 하는 이유는 무엇인가? 그것은 바로 어떤 환경에서든 .zshrc/.gitignore 파일 같은 것들을 동일하게 사용하여 작업의 흐름을 온전히 유지할 수 있다는 장점이 있기 때문이다. dotfiles를 git과 같은 버전관리 도구로 관리할 수 있고, github 같은 저장소에 올려놓을 수 있다면.... 어떤 개발환경으로 갈아타더라도 github에서 바로 내려받고, 각 설정파일들을 옮기면 그만이기 때문에 개발환경 설정하는데 드는 시간적 비용을 굉장히 아낄 수 있다.

dotfiles를 관리하는 방법들은 여러가지 있겠지만(symbolic link를 이용한다던가 등등), 개인적으로는 chezmoi를 권장하는 바이다. chezmoi는 dotfiles들을 버전관리할 수 있게 편의성을 제공해주는 CLI 도구이다.

  • 나도 chezmoi를 엄청 애용하고 있기 때문에, 내 dotfiles를 실제로 사용해보고 싶다면, chezmoi init https://github.com/malkoG/dotfiles.git 명령을 실행해보면 된다.

다시, 본론으로 Wezterm에 대해서 알아보자.

Wezterm은 Konsole/iTerm2/Gnome Terminal/Alacritty과 같은 터미널 에뮬레이터이며, Rust 기반으로 구축이 되어 있고, GPU 가속을 지원한다. 따라서, 렌더링 자체도 어느 정도는 빠른 편이다.

주변 사람들에게 한번 써보도록 권장하는 터미널 에뮬레이터가 세 가지 정도 있는데, Alacritty/Kitty 그리고 이 글에서 소개하는 Wezterm 정도 된다. 요즘은 Zig 기반으로 만들어진 Ghostty[1]도 추천할만 한 것 같다. 하지만, 이 글에서는 Wezterm을 소개하기로 했기 때문에, Wezterm 중심으로 소개하도록 하겠다.

Wezterm은 다음과 같은 특징을 가진다.

  • Linux, MacOS, 윈도우즈, FreeBSD 다양한 환경에서 돌아간다.
  • 한 윈도우를 여러개의 pane으로 쪼개서 분할하여 멀티플렉싱을 지원한다.(물론, 나는 ZelliJ/Tmux를 쓰기때문에 잘 이용하지는 않는 기능이다.
  • 마우스 지원이 잘 된다
  • 터미널에 표시되는 글자를 캡쳐해서 하이퍼링크로 치환이 가능하다.
    • 이건 나도 잘 이용하지는 않는 기능이지만.. T0010 같은 코드가 화면 상에 보여진다면, 특정 린터 페이지의 설명화면으로 이동하는 링크를 심을 수 있다. kiyoon님의 dotfiles 참고
  • lua로 스크립팅이 가능한데, 활용할 수 있는 방향이 굉장히 다양하다.
    • 여기에서 설명한 기능들을 최대한 활용하여 스크립팅이 가능하다.
    • API 문서를 슥 훑어보았을때, "어? 설마 이게 되나?" 싶은 생각이 든다면, 여러분이 생각하는 것도 아마 가능할지도 모른다.

Wezterm, 써보자.

Wezterm을 설치한다면 설치 안내 페이지를 참고해서 설치하면 되는데, 여러분이 Wezterm을 설치했다면 당장은 검은 화면만 뜰지도 모른다.

Wezterm을 설치하고 나서, .config/wezterm/wezterm.lua 파일을 수정해야 하는데, 당장은 아래처럼 비어있을 것이다. 파일이 없다면 만들어두는 것이 좋다.

return {}

위의 코드에서 {}는 lua에서는 테이블(다른 언어로 치면, 딕셔너리/오브젝트 같은 것)이지만, wezterm 터미널의 configuration을 나타내는 테이블이다. 여기에 몇가지 추가사항을 넣어보겠다.

터미널 에뮬레이터를 설치했는데, 터미널 에뮬레이터를 설치했으면 가장 처음부터 하는게 무엇이겠는가? 바로, 폰트를 세팅하는 것이다. 터미널 환경에서 작업할때 폰트만큼 중요한게 또 없다.

local wezterm = require("wezterm")

return {
	font = wezterm.font_with_fallback({'Cascadia Code NF', 'NanumBarunGothic'}),
	font_size = 12.0,
	line_height = 1.2,
}

폰트를 가져다 쓸때는 위의 예시와 같이 font_with_fallback 함수를 이용해서 가져다 쓸 수 있고, 그 외에도 폰트 크기를 지정하거나 행간을 지정할 수도 있다. 공식페이지에서 보았듯이, 여러분의 취향에 따라 배경색 혹은 배경이미지도 지정할 수 있는데 여러분 나름대로의 기준이 있고 욕심이 난다면 한번 도전해보는 것도 나쁘지 않을 것 같다.

위의 코드를 복사 붙여넣고 편집하다보면 느낄 수 있겠지만, wezterm은 설정파일을 편집할때 Hot Reloading을 지원한다. 이 또한, 내가 가장 애정하는 기능 중 하나이다. 혹여나 wezterm 설정 파일을 수정했을때, 문법에 오류가 있거나 설정값을 잘못 지정했을 때, 새 창으로 어떤 부분에 오류가 있는지 친절하게 Alert도 띄워준다.

API 레퍼런스를 보기만 해도 스크립팅으로 기능을 확장할 수 있는 가능성이야 당연히 많긴 하겠지만, 처음 접하는 입장에서는 어떻게 커스터마이징할 지 파악하기 난해할 수 있다.

아래에서는 내가 어떻게 Wezterm을 커스터마이징을 하고 있는지 예시를 나열하는 것으로 글을 끝내겠다. Wezterm, 믿고 써보시라.

내가 Wezterm을 응용하는 방법

1. 반투명도 조정하기

Wezterm에서 터미널 색상을 설정할때, 배경색상의 반투명도를 지정할 수 있는 옵션이 있다. 나는 여기서 단축키를 입력했을때 반투명도를 동적으로 조절하고 싶었다.

반투명도를 상수로 둘 수는 있지만, 모니터 하나 짜리의 환경에서 작업한다면 브라우저를 뒤쪽에 두고 터미널 앱을 앞에 두는 식으로 작업을 많이 하게 된다. HMR(Hot Module Reloading)이 되는 개발환경이라면, 소스코드를 편집하고 화면에 즉각적으로 반영이 되는걸 기대할텐데 이걸 탭 스위칭하면서 확인하기는 굉장히 번거롭다. 온전히 작업을 유지하다가 잠깐 확인하고 싶을때 반투명도를 변경하면 되는데도 말이다.

Wezterm에서는 이벤트를 발신할 수 있고, 다른 프로세스에서 특정 이벤트를 수신했을때 어떤 동작을 할 것인지를 정의할 수 있다. Wezterm 터미널 옵션을 수정하는것도 여기에 포함될 수 있다. 특정 단축키를 입력하면, 어떤 이벤트를 발생시킬 수 있고, 그 이벤트로 인해서 화면의 반투명도를 조정할 수 있게 했다.

local default_opacity = 0.9

local keymaps = {}

-- SHIFT + CTRL + Z 키를 누르면 반투명도를 감소시키는 이벤트가 발생한다.
table.insert(
  keymaps,
  {
	key = "Z",
	mods = 'SHIFT|CTRL',
	action = wezterm.action.EmitEvent 'decrease-opacity',
  }
)

-- SHIFT + CTRL + X 키를 누르면 반투명도를 증가시키는 이벤트가 발생한다.
table.insert(
  keymaps,
  {
	key = 'X',
	mods = 'SHIFT|CTRL',
	action = wezterm.action.EmitEvent 'increase-opacity',
  }
)


-- "increase-opacity" 이벤트를 수신했을때, 반투명도를 증가시키는 동작을 하도록 정의한다.
wezterm.on('increase-opacity', function(window, pane)
  local overrides = window:get_config_overrides() or {}
  local opacity = overrides.window_background_opacity
  if opacity == nil then
	opacity = default_opacity
  end

  opacity = opacity + 0.1
  if opacity > 1.0 then
	opacity = 1.0
  end
  overrides.window_background_opacity = opacity

  window:set_config_overrides(overrides)
end)

-- "increase-opacity" 이벤트를 수신했을때, 반투명도를 증가시키는 동작을 하도록 정의한다.
wezterm.on('decrease-opacity', function(window, pane)
  local overrides = window:get_config_overrides() or {}
  local opacity = overrides.window_background_opacity

  if opacity == nil then
	opacity = default_opacity
  end

  opacity = opacity - 0.1
  if opacity < 0.3 then
	opacity = 0.3
  end
  overrides.window_background_opacity = opacity

  window:set_config_overrides(overrides)
end)

return {
  keys = keymaps
}

2. 탭 이름 변경하기

대부분 터미널 에뮬레이터에서 탭 이름을 표시할때, 현재 탭에서 돌고 있는 프로세스의 이름을 명시할때가 많다. 그런데, 탭에 명시되어 있는 타이틀만 가지고는 각각의 탭이 어떤 역할을 하는 것인지 파악하기 어렵다. 어느 쪽이 서버를 띄우고 있는건지, 어느 쪽이 에디터 편집 화면인지, 어느 쪽이 LLM Agent를 돌리고 있는지 난해하다.

하지만, 아래처럼 wezterm.action.PromptInputLine API를 사용해서 프롬프트 입력을 받은 내용을 기반으로, 현재 활성화된 탭의 이름을 변경하는 식으로 인지부하를 줄일 수 있다.

local wezterm = require('wezterm')
local keymaps = {}

table.insert(
  keymaps,
  {
	key = '`',
	mods = 'CTRL',
	action = wezterm.action.PromptInputLine {
	  description = "Enter new name for tab",
	  action = wezterm.action_callback(function(window, _, line)
	    if line then
		  window:active_tab():set_title(line)
		end
	  end)
	}
  }
)

return {
  keys = keymaps
}

3. BEEP음 대신 화면이 번쩍이게 하기

Aider나 Claude Code 같은 LLM 에이전트가 작업을 수행 후 아예 작업이 끝났거나, 혹은 작업에 대한 승인을 요구할 때가 간혹 있다. LLM 에이전트가 작업을 수행하는걸 가만히 보고만 있을 순 없을 것이다.

Claude Code/Aider는 다행히도 응답을 하고 나서 추가적인 명령을 실행할 수 있는 옵션[2]을 제공해주는데, 거기에 간단하게 echo -ne '\007' 명령어를 넘겨줄 수 있다. 이 명령어는 엄청 어렵지는 않다. 터미널 앱에 내장된 시스템 벨 소리를 재생하는 명령어다.

작업 환경이 어디냐에 따라 다를 순 있겠지만, 작업 완료 여부를 음성으로 받기에는 물리적인 제약이 있을 수 있다. 아예 알림 센터를 이용한다고 치자. 업무 시간대에 방해금지 모드를 설정했다면 알림이 울리게 설정이 했더라도 시스템 제약상 묻힐 가능성도 있다.[3]

visual_bell 옵션을 활용하면, 터미널에 내장된 시스템 벨 소리를 울리는 대신 화면이 반짝이게 해서 다른 에이전트가 응답을 완료했다고 명시적으로 알림을 받을 수 있다. LLM 에이전트가 하는 일을 일일이 모니터링하지 않더라도, 다른 작업을 수행하는 중에 화면이 반짝이면 그때 확인하기만 하면 그만이다.

return {
	colors = {
		visual_bell = '#003355',
	},

	visual_bell = {
		fade_in_duration_ms  = 75,
		fade_out_duration_ms = 75,
		target               = 'BackgroundColor', -- 또는 'CursorColor'
	}
}

  1. Hashicorp 공동창업자인 Mitchell Hashimoto가 만든 터미널 에뮬레이터인데, OpenAI에서 Codex 시연할때 Ghostty 터미널로 시연한 바가 있다. ↩︎

  2. Aider는 notifications-command, Claude Code는 Hook이 있다 ↩︎

  3. 어떤 사람은 휴대전화를 진동모드로 해놓고, 텔레그램/디스코드로 알림쏴서 알림을 수신받는 방식을 쓰고 있는 것을 관찰한 바는 있다. ↩︎

Jaeyeol Lee's avatar
Jaeyeol Lee

@kodingwarrior@hackers.pub

이 글(그리고 후속작이 될 글들)은, 내 개발환경에서 자주 사용하고 있고 실제로도 애정하고 있는 도구에 대해서 소개하게 될 것 같다. 내가 어떤 환경에서 개발하고 있는지 궁금한 분들은 내 dotfiles 리포지토리를 참고해도 좋을 것 같다.

먼저, dotfiles란 무엇인가?

dotfiles라는 이름 자체만 보면 뭔가 대단해보일 것 같지만, dotfiles라는 이름 자체는 그냥 단순하다.

  • 어딘가의 가이드라인에서 지시하는대로 개발환경을 세팅하다보면, .zshrc/.bashrc 같은 것들을 마주하게 될 것이다.
  • git을 사용하고 있는 사람이라면, 어떤 diff 도구(delta, difft)를 사용할지, 어떤 alias 명령어를 등록할지 같은 것들을 명시하기 위해서 .gitconfig 같은 파일을 수정하게 될 때가 있다.
    • 물론, 이런것보다는 git config pull.rebase true 같은 명령어를 실행하는 경우가 더 많을 수 있다. 하지만, 이런 명령어를 실행하면 .gitconfig에도 그대로 기록이 된다.

위에서 언급한 예시를 보면 알 수 있겠듯이, 앞에 dot(.)이 붙어있는 설정파일이라면 dotfiles라고 할 수 있겠다. dotfiles 리포지토리를 만들어서 관리를 하는 이유는 무엇인가? 그것은 바로 어떤 환경에서든 .zshrc/.gitignore 파일 같은 것들을 동일하게 사용하여 작업의 흐름을 온전히 유지할 수 있다는 장점이 있기 때문이다. dotfiles를 git과 같은 버전관리 도구로 관리할 수 있고, github 같은 저장소에 올려놓을 수 있다면.... 어떤 개발환경으로 갈아타더라도 github에서 바로 내려받고, 각 설정파일들을 옮기면 그만이기 때문에 개발환경 설정하는데 드는 시간적 비용을 굉장히 아낄 수 있다.

dotfiles를 관리하는 방법들은 여러가지 있겠지만(symbolic link를 이용한다던가 등등), 개인적으로는 chezmoi를 권장하는 바이다. chezmoi는 dotfiles들을 버전관리할 수 있게 편의성을 제공해주는 CLI 도구이다.

  • 나도 chezmoi를 엄청 애용하고 있기 때문에, 내 dotfiles를 실제로 사용해보고 싶다면, chezmoi init https://github.com/malkoG/dotfiles.git 명령을 실행해보면 된다.

다시, 본론으로 Wezterm에 대해서 알아보자.

Wezterm은 Konsole/iTerm2/Gnome Terminal/Alacritty과 같은 터미널 에뮬레이터이며, Rust 기반으로 구축이 되어 있고, GPU 가속을 지원한다. 따라서, 렌더링 자체도 어느 정도는 빠른 편이다.

주변 사람들에게 한번 써보도록 권장하는 터미널 에뮬레이터가 세 가지 정도 있는데, Alacritty/Kitty 그리고 이 글에서 소개하는 Wezterm 정도 된다. 요즘은 Zig 기반으로 만들어진 Ghostty[1]도 추천할만 한 것 같다. 하지만, 이 글에서는 Wezterm을 소개하기로 했기 때문에, Wezterm 중심으로 소개하도록 하겠다.

Wezterm은 다음과 같은 특징을 가진다.

  • Linux, MacOS, 윈도우즈, FreeBSD 다양한 환경에서 돌아간다.
  • 한 윈도우를 여러개의 pane으로 쪼개서 분할하여 멀티플렉싱을 지원한다.(물론, 나는 ZelliJ/Tmux를 쓰기때문에 잘 이용하지는 않는 기능이다.
  • 마우스 지원이 잘 된다
  • 터미널에 표시되는 글자를 캡쳐해서 하이퍼링크로 치환이 가능하다.
    • 이건 나도 잘 이용하지는 않는 기능이지만.. T0010 같은 코드가 화면 상에 보여진다면, 특정 린터 페이지의 설명화면으로 이동하는 링크를 심을 수 있다. kiyoon님의 dotfiles 참고
  • lua로 스크립팅이 가능한데, 활용할 수 있는 방향이 굉장히 다양하다.
    • 여기에서 설명한 기능들을 최대한 활용하여 스크립팅이 가능하다.
    • API 문서를 슥 훑어보았을때, "어? 설마 이게 되나?" 싶은 생각이 든다면, 여러분이 생각하는 것도 아마 가능할지도 모른다.

Wezterm, 써보자.

Wezterm을 설치한다면 설치 안내 페이지를 참고해서 설치하면 되는데, 여러분이 Wezterm을 설치했다면 당장은 검은 화면만 뜰지도 모른다.

Wezterm을 설치하고 나서, .config/wezterm/wezterm.lua 파일을 수정해야 하는데, 당장은 아래처럼 비어있을 것이다. 파일이 없다면 만들어두는 것이 좋다.

return {}

위의 코드에서 {}는 lua에서는 테이블(다른 언어로 치면, 딕셔너리/오브젝트 같은 것)이지만, wezterm 터미널의 configuration을 나타내는 테이블이다. 여기에 몇가지 추가사항을 넣어보겠다.

터미널 에뮬레이터를 설치했는데, 터미널 에뮬레이터를 설치했으면 가장 처음부터 하는게 무엇이겠는가? 바로, 폰트를 세팅하는 것이다. 터미널 환경에서 작업할때 폰트만큼 중요한게 또 없다.

local wezterm = require("wezterm")

return {
	font = wezterm.font_with_fallback({'Cascadia Code NF', 'NanumBarunGothic'}),
	font_size = 12.0,
	line_height = 1.2,
}

폰트를 가져다 쓸때는 위의 예시와 같이 font_with_fallback 함수를 이용해서 가져다 쓸 수 있고, 그 외에도 폰트 크기를 지정하거나 행간을 지정할 수도 있다. 공식페이지에서 보았듯이, 여러분의 취향에 따라 배경색 혹은 배경이미지도 지정할 수 있는데 여러분 나름대로의 기준이 있고 욕심이 난다면 한번 도전해보는 것도 나쁘지 않을 것 같다.

위의 코드를 복사 붙여넣고 편집하다보면 느낄 수 있겠지만, wezterm은 설정파일을 편집할때 Hot Reloading을 지원한다. 이 또한, 내가 가장 애정하는 기능 중 하나이다. 혹여나 wezterm 설정 파일을 수정했을때, 문법에 오류가 있거나 설정값을 잘못 지정했을 때, 새 창으로 어떤 부분에 오류가 있는지 친절하게 Alert도 띄워준다.

API 레퍼런스를 보기만 해도 스크립팅으로 기능을 확장할 수 있는 가능성이야 당연히 많긴 하겠지만, 처음 접하는 입장에서는 어떻게 커스터마이징할 지 파악하기 난해할 수 있다.

아래에서는 내가 어떻게 Wezterm을 커스터마이징을 하고 있는지 예시를 나열하는 것으로 글을 끝내겠다. Wezterm, 믿고 써보시라.

내가 Wezterm을 응용하는 방법

1. 반투명도 조정하기

Wezterm에서 터미널 색상을 설정할때, 배경색상의 반투명도를 지정할 수 있는 옵션이 있다. 나는 여기서 단축키를 입력했을때 반투명도를 동적으로 조절하고 싶었다.

반투명도를 상수로 둘 수는 있지만, 모니터 하나 짜리의 환경에서 작업한다면 브라우저를 뒤쪽에 두고 터미널 앱을 앞에 두는 식으로 작업을 많이 하게 된다. HMR(Hot Module Reloading)이 되는 개발환경이라면, 소스코드를 편집하고 화면에 즉각적으로 반영이 되는걸 기대할텐데 이걸 탭 스위칭하면서 확인하기는 굉장히 번거롭다. 온전히 작업을 유지하다가 잠깐 확인하고 싶을때 반투명도를 변경하면 되는데도 말이다.

Wezterm에서는 이벤트를 발신할 수 있고, 다른 프로세스에서 특정 이벤트를 수신했을때 어떤 동작을 할 것인지를 정의할 수 있다. Wezterm 터미널 옵션을 수정하는것도 여기에 포함될 수 있다. 특정 단축키를 입력하면, 어떤 이벤트를 발생시킬 수 있고, 그 이벤트로 인해서 화면의 반투명도를 조정할 수 있게 했다.

local default_opacity = 0.9

local keymaps = {}

-- SHIFT + CTRL + Z 키를 누르면 반투명도를 감소시키는 이벤트가 발생한다.
table.insert(
  keymaps,
  {
	key = "Z",
	mods = 'SHIFT|CTRL',
	action = wezterm.action.EmitEvent 'decrease-opacity',
  }
)

-- SHIFT + CTRL + X 키를 누르면 반투명도를 증가시키는 이벤트가 발생한다.
table.insert(
  keymaps,
  {
	key = 'X',
	mods = 'SHIFT|CTRL',
	action = wezterm.action.EmitEvent 'increase-opacity',
  }
)


-- "increase-opacity" 이벤트를 수신했을때, 반투명도를 증가시키는 동작을 하도록 정의한다.
wezterm.on('increase-opacity', function(window, pane)
  local overrides = window:get_config_overrides() or {}
  local opacity = overrides.window_background_opacity
  if opacity == nil then
	opacity = default_opacity
  end

  opacity = opacity + 0.1
  if opacity > 1.0 then
	opacity = 1.0
  end
  overrides.window_background_opacity = opacity

  window:set_config_overrides(overrides)
end)

-- "increase-opacity" 이벤트를 수신했을때, 반투명도를 증가시키는 동작을 하도록 정의한다.
wezterm.on('decrease-opacity', function(window, pane)
  local overrides = window:get_config_overrides() or {}
  local opacity = overrides.window_background_opacity

  if opacity == nil then
	opacity = default_opacity
  end

  opacity = opacity - 0.1
  if opacity < 0.3 then
	opacity = 0.3
  end
  overrides.window_background_opacity = opacity

  window:set_config_overrides(overrides)
end)

return {
  keys = keymaps
}

2. 탭 이름 변경하기

대부분 터미널 에뮬레이터에서 탭 이름을 표시할때, 현재 탭에서 돌고 있는 프로세스의 이름을 명시할때가 많다. 그런데, 탭에 명시되어 있는 타이틀만 가지고는 각각의 탭이 어떤 역할을 하는 것인지 파악하기 어렵다. 어느 쪽이 서버를 띄우고 있는건지, 어느 쪽이 에디터 편집 화면인지, 어느 쪽이 LLM Agent를 돌리고 있는지 난해하다.

하지만, 아래처럼 wezterm.action.PromptInputLine API를 사용해서 프롬프트 입력을 받은 내용을 기반으로, 현재 활성화된 탭의 이름을 변경하는 식으로 인지부하를 줄일 수 있다.

local wezterm = require('wezterm')
local keymaps = {}

table.insert(
  keymaps,
  {
	key = '`',
	mods = 'CTRL',
	action = wezterm.action.PromptInputLine {
	  description = "Enter new name for tab",
	  action = wezterm.action_callback(function(window, _, line)
	    if line then
		  window:active_tab():set_title(line)
		end
	  end)
	}
  }
)

return {
  keys = keymaps
}

3. BEEP음 대신 화면이 번쩍이게 하기

Aider나 Claude Code 같은 LLM 에이전트가 작업을 수행 후 아예 작업이 끝났거나, 혹은 작업에 대한 승인을 요구할 때가 간혹 있다. LLM 에이전트가 작업을 수행하는걸 가만히 보고만 있을 순 없을 것이다.

Claude Code/Aider는 다행히도 응답을 하고 나서 추가적인 명령을 실행할 수 있는 옵션[2]을 제공해주는데, 거기에 간단하게 echo -ne '\007' 명령어를 넘겨줄 수 있다. 이 명령어는 엄청 어렵지는 않다. 터미널 앱에 내장된 시스템 벨 소리를 재생하는 명령어다.

작업 환경이 어디냐에 따라 다를 순 있겠지만, 작업 완료 여부를 음성으로 받기에는 물리적인 제약이 있을 수 있다. 아예 알림 센터를 이용한다고 치자. 업무 시간대에 방해금지 모드를 설정했다면 알림이 울리게 설정이 했더라도 시스템 제약상 묻힐 가능성도 있다.[3]

visual_bell 옵션을 활용하면, 터미널에 내장된 시스템 벨 소리를 울리는 대신 화면이 반짝이게 해서 다른 에이전트가 응답을 완료했다고 명시적으로 알림을 받을 수 있다. LLM 에이전트가 하는 일을 일일이 모니터링하지 않더라도, 다른 작업을 수행하는 중에 화면이 반짝이면 그때 확인하기만 하면 그만이다.

return {
	colors = {
		visual_bell = '#003355',
	},

	visual_bell = {
		fade_in_duration_ms  = 75,
		fade_out_duration_ms = 75,
		target               = 'BackgroundColor', -- 또는 'CursorColor'
	}
}

  1. Hashicorp 공동창업자인 Mitchell Hashimoto가 만든 터미널 에뮬레이터인데, OpenAI에서 Codex 시연할때 Ghostty 터미널로 시연한 바가 있다. ↩︎

  2. Aider는 notifications-command, Claude Code는 Hook이 있다 ↩︎

  3. 어떤 사람은 휴대전화를 진동모드로 해놓고, 텔레그램/디스코드로 알림쏴서 알림을 수신받는 방식을 쓰고 있는 것을 관찰한 바는 있다. ↩︎

Jaeyeol Lee's avatar
Jaeyeol Lee

@kodingwarrior@hackers.pub

이 글(그리고 후속작이 될 글들)은, 내 개발환경에서 자주 사용하고 있고 실제로도 애정하고 있는 도구에 대해서 소개하게 될 것 같다. 내가 어떤 환경에서 개발하고 있는지 궁금한 분들은 내 dotfiles 리포지토리를 참고해도 좋을 것 같다.

먼저, dotfiles란 무엇인가?

dotfiles라는 이름 자체만 보면 뭔가 대단해보일 것 같지만, dotfiles라는 이름 자체는 그냥 단순하다.

  • 어딘가의 가이드라인에서 지시하는대로 개발환경을 세팅하다보면, .zshrc/.bashrc 같은 것들을 마주하게 될 것이다.
  • git을 사용하고 있는 사람이라면, 어떤 diff 도구(delta, difft)를 사용할지, 어떤 alias 명령어를 등록할지 같은 것들을 명시하기 위해서 .gitconfig 같은 파일을 수정하게 될 때가 있다.
    • 물론, 이런것보다는 git config pull.rebase true 같은 명령어를 실행하는 경우가 더 많을 수 있다. 하지만, 이런 명령어를 실행하면 .gitconfig에도 그대로 기록이 된다.

위에서 언급한 예시를 보면 알 수 있겠듯이, 앞에 dot(.)이 붙어있는 설정파일이라면 dotfiles라고 할 수 있겠다. dotfiles 리포지토리를 만들어서 관리를 하는 이유는 무엇인가? 그것은 바로 어떤 환경에서든 .zshrc/.gitignore 파일 같은 것들을 동일하게 사용하여 작업의 흐름을 온전히 유지할 수 있다는 장점이 있기 때문이다. dotfiles를 git과 같은 버전관리 도구로 관리할 수 있고, github 같은 저장소에 올려놓을 수 있다면.... 어떤 개발환경으로 갈아타더라도 github에서 바로 내려받고, 각 설정파일들을 옮기면 그만이기 때문에 개발환경 설정하는데 드는 시간적 비용을 굉장히 아낄 수 있다.

dotfiles를 관리하는 방법들은 여러가지 있겠지만(symbolic link를 이용한다던가 등등), 개인적으로는 chezmoi를 권장하는 바이다. chezmoi는 dotfiles들을 버전관리할 수 있게 편의성을 제공해주는 CLI 도구이다.

  • 나도 chezmoi를 엄청 애용하고 있기 때문에, 내 dotfiles를 실제로 사용해보고 싶다면, chezmoi init https://github.com/malkoG/dotfiles.git 명령을 실행해보면 된다.

다시, 본론으로 Wezterm에 대해서 알아보자.

Wezterm은 Konsole/iTerm2/Gnome Terminal/Alacritty과 같은 터미널 에뮬레이터이며, Rust 기반으로 구축이 되어 있고, GPU 가속을 지원한다. 따라서, 렌더링 자체도 어느 정도는 빠른 편이다.

주변 사람들에게 한번 써보도록 권장하는 터미널 에뮬레이터가 세 가지 정도 있는데, Alacritty/Kitty 그리고 이 글에서 소개하는 Wezterm 정도 된다. 요즘은 Zig 기반으로 만들어진 Ghostty[1]도 추천할만 한 것 같다. 하지만, 이 글에서는 Wezterm을 소개하기로 했기 때문에, Wezterm 중심으로 소개하도록 하겠다.

Wezterm은 다음과 같은 특징을 가진다.

  • Linux, MacOS, 윈도우즈, FreeBSD 다양한 환경에서 돌아간다.
  • 한 윈도우를 여러개의 pane으로 쪼개서 분할하여 멀티플렉싱을 지원한다.(물론, 나는 ZelliJ/Tmux를 쓰기때문에 잘 이용하지는 않는 기능이다.
  • 마우스 지원이 잘 된다
  • 터미널에 표시되는 글자를 캡쳐해서 하이퍼링크로 치환이 가능하다.
    • 이건 나도 잘 이용하지는 않는 기능이지만.. T0010 같은 코드가 화면 상에 보여진다면, 특정 린터 페이지의 설명화면으로 이동하는 링크를 심을 수 있다. kiyoon님의 dotfiles 참고
  • lua로 스크립팅이 가능한데, 활용할 수 있는 방향이 굉장히 다양하다.
    • 여기에서 설명한 기능들을 최대한 활용하여 스크립팅이 가능하다.
    • API 문서를 슥 훑어보았을때, "어? 설마 이게 되나?" 싶은 생각이 든다면, 여러분이 생각하는 것도 아마 가능할지도 모른다.

Wezterm, 써보자.

Wezterm을 설치한다면 설치 안내 페이지를 참고해서 설치하면 되는데, 여러분이 Wezterm을 설치했다면 당장은 검은 화면만 뜰지도 모른다.

Wezterm을 설치하고 나서, .config/wezterm/wezterm.lua 파일을 수정해야 하는데, 당장은 아래처럼 비어있을 것이다. 파일이 없다면 만들어두는 것이 좋다.

return {}

위의 코드에서 {}는 lua에서는 테이블(다른 언어로 치면, 딕셔너리/오브젝트 같은 것)이지만, wezterm 터미널의 configuration을 나타내는 테이블이다. 여기에 몇가지 추가사항을 넣어보겠다.

터미널 에뮬레이터를 설치했는데, 터미널 에뮬레이터를 설치했으면 가장 처음부터 하는게 무엇이겠는가? 바로, 폰트를 세팅하는 것이다. 터미널 환경에서 작업할때 폰트만큼 중요한게 또 없다.

local wezterm = require("wezterm")

return {
	font = wezterm.font_with_fallback({'Cascadia Code NF', 'NanumBarunGothic'}),
	font_size = 12.0,
	line_height = 1.2,
}

폰트를 가져다 쓸때는 위의 예시와 같이 font_with_fallback 함수를 이용해서 가져다 쓸 수 있고, 그 외에도 폰트 크기를 지정하거나 행간을 지정할 수도 있다. 공식페이지에서 보았듯이, 여러분의 취향에 따라 배경색 혹은 배경이미지도 지정할 수 있는데 여러분 나름대로의 기준이 있고 욕심이 난다면 한번 도전해보는 것도 나쁘지 않을 것 같다.

위의 코드를 복사 붙여넣고 편집하다보면 느낄 수 있겠지만, wezterm은 설정파일을 편집할때 Hot Reloading을 지원한다. 이 또한, 내가 가장 애정하는 기능 중 하나이다. 혹여나 wezterm 설정 파일을 수정했을때, 문법에 오류가 있거나 설정값을 잘못 지정했을 때, 새 창으로 어떤 부분에 오류가 있는지 친절하게 Alert도 띄워준다.

API 레퍼런스를 보기만 해도 스크립팅으로 기능을 확장할 수 있는 가능성이야 당연히 많긴 하겠지만, 처음 접하는 입장에서는 어떻게 커스터마이징할 지 파악하기 난해할 수 있다.

아래에서는 내가 어떻게 Wezterm을 커스터마이징을 하고 있는지 예시를 나열하는 것으로 글을 끝내겠다. Wezterm, 믿고 써보시라.

내가 Wezterm을 응용하는 방법

1. 반투명도 조정하기

Wezterm에서 터미널 색상을 설정할때, 배경색상의 반투명도를 지정할 수 있는 옵션이 있다. 나는 여기서 단축키를 입력했을때 반투명도를 동적으로 조절하고 싶었다.

반투명도를 상수로 둘 수는 있지만, 모니터 하나 짜리의 환경에서 작업한다면 브라우저를 뒤쪽에 두고 터미널 앱을 앞에 두는 식으로 작업을 많이 하게 된다. HMR(Hot Module Reloading)이 되는 개발환경이라면, 소스코드를 편집하고 화면에 즉각적으로 반영이 되는걸 기대할텐데 이걸 탭 스위칭하면서 확인하기는 굉장히 번거롭다. 온전히 작업을 유지하다가 잠깐 확인하고 싶을때 반투명도를 변경하면 되는데도 말이다.

Wezterm에서는 이벤트를 발신할 수 있고, 다른 프로세스에서 특정 이벤트를 수신했을때 어떤 동작을 할 것인지를 정의할 수 있다. Wezterm 터미널 옵션을 수정하는것도 여기에 포함될 수 있다. 특정 단축키를 입력하면, 어떤 이벤트를 발생시킬 수 있고, 그 이벤트로 인해서 화면의 반투명도를 조정할 수 있게 했다.

local default_opacity = 0.9

local keymaps = {}

-- SHIFT + CTRL + Z 키를 누르면 반투명도를 감소시키는 이벤트가 발생한다.
table.insert(
  keymaps,
  {
	key = "Z",
	mods = 'SHIFT|CTRL',
	action = wezterm.action.EmitEvent 'decrease-opacity',
  }
)

-- SHIFT + CTRL + X 키를 누르면 반투명도를 증가시키는 이벤트가 발생한다.
table.insert(
  keymaps,
  {
	key = 'X',
	mods = 'SHIFT|CTRL',
	action = wezterm.action.EmitEvent 'increase-opacity',
  }
)


-- "increase-opacity" 이벤트를 수신했을때, 반투명도를 증가시키는 동작을 하도록 정의한다.
wezterm.on('increase-opacity', function(window, pane)
  local overrides = window:get_config_overrides() or {}
  local opacity = overrides.window_background_opacity
  if opacity == nil then
	opacity = default_opacity
  end

  opacity = opacity + 0.1
  if opacity > 1.0 then
	opacity = 1.0
  end
  overrides.window_background_opacity = opacity

  window:set_config_overrides(overrides)
end)

-- "increase-opacity" 이벤트를 수신했을때, 반투명도를 증가시키는 동작을 하도록 정의한다.
wezterm.on('decrease-opacity', function(window, pane)
  local overrides = window:get_config_overrides() or {}
  local opacity = overrides.window_background_opacity

  if opacity == nil then
	opacity = default_opacity
  end

  opacity = opacity - 0.1
  if opacity < 0.3 then
	opacity = 0.3
  end
  overrides.window_background_opacity = opacity

  window:set_config_overrides(overrides)
end)

return {
  keys = keymaps
}

2. 탭 이름 변경하기

대부분 터미널 에뮬레이터에서 탭 이름을 표시할때, 현재 탭에서 돌고 있는 프로세스의 이름을 명시할때가 많다. 그런데, 탭에 명시되어 있는 타이틀만 가지고는 각각의 탭이 어떤 역할을 하는 것인지 파악하기 어렵다. 어느 쪽이 서버를 띄우고 있는건지, 어느 쪽이 에디터 편집 화면인지, 어느 쪽이 LLM Agent를 돌리고 있는지 난해하다.

하지만, 아래처럼 wezterm.action.PromptInputLine API를 사용해서 프롬프트 입력을 받은 내용을 기반으로, 현재 활성화된 탭의 이름을 변경하는 식으로 인지부하를 줄일 수 있다.

local wezterm = require('wezterm')
local keymaps = {}

table.insert(
  keymaps,
  {
	key = '`',
	mods = 'CTRL',
	action = wezterm.action.PromptInputLine {
	  description = "Enter new name for tab",
	  action = wezterm.action_callback(function(window, _, line)
	    if line then
		  window:active_tab():set_title(line)
		end
	  end)
	}
  }
)

return {
  keys = keymaps
}

3. BEEP음 대신 화면이 번쩍이게 하기

Aider나 Claude Code 같은 LLM 에이전트가 작업을 수행 후 아예 작업이 끝났거나, 혹은 작업에 대한 승인을 요구할 때가 간혹 있다. LLM 에이전트가 작업을 수행하는걸 가만히 보고만 있을 순 없을 것이다.

Claude Code/Aider는 다행히도 응답을 하고 나서 추가적인 명령을 실행할 수 있는 옵션[2]을 제공해주는데, 거기에 간단하게 echo -ne '\007' 명령어를 넘겨줄 수 있다. 이 명령어는 엄청 어렵지는 않다. 터미널 앱에 내장된 시스템 벨 소리를 재생하는 명령어다.

작업 환경이 어디냐에 따라 다를 순 있겠지만, 작업 완료 여부를 음성으로 받기에는 물리적인 제약이 있을 수 있다. 아예 알림 센터를 이용한다고 치자. 업무 시간대에 방해금지 모드를 설정했다면 알림이 울리게 설정이 했더라도 시스템 제약상 묻힐 가능성도 있다.[3]

visual_bell 옵션을 활용하면, 터미널에 내장된 시스템 벨 소리를 울리는 대신 화면이 반짝이게 해서 다른 에이전트가 응답을 완료했다고 명시적으로 알림을 받을 수 있다. LLM 에이전트가 하는 일을 일일이 모니터링하지 않더라도, 다른 작업을 수행하는 중에 화면이 반짝이면 그때 확인하기만 하면 그만이다.

return {
	colors = {
		visual_bell = '#003355',
	},

	visual_bell = {
		fade_in_duration_ms  = 75,
		fade_out_duration_ms = 75,
		target               = 'BackgroundColor', -- 또는 'CursorColor'
	}
}

  1. Hashicorp 공동창업자인 Mitchell Hashimoto가 만든 터미널 에뮬레이터인데, OpenAI에서 Codex 시연할때 Ghostty 터미널로 시연한 바가 있다. ↩︎

  2. Aider는 notifications-command, Claude Code는 Hook이 있다 ↩︎

  3. 어떤 사람은 휴대전화를 진동모드로 해놓고, 텔레그램/디스코드로 알림쏴서 알림을 수신받는 방식을 쓰고 있는 것을 관찰한 바는 있다. ↩︎

Jaeyeol Lee's avatar
Jaeyeol Lee

@kodingwarrior@hackers.pub

이 글(그리고 후속작이 될 글들)은, 내 개발환경에서 자주 사용하고 있고 실제로도 애정하고 있는 도구에 대해서 소개하게 될 것 같다. 내가 어떤 환경에서 개발하고 있는지 궁금한 분들은 내 dotfiles 리포지토리를 참고해도 좋을 것 같다.

먼저, dotfiles란 무엇인가?

dotfiles라는 이름 자체만 보면 뭔가 대단해보일 것 같지만, dotfiles라는 이름 자체는 그냥 단순하다.

  • 어딘가의 가이드라인에서 지시하는대로 개발환경을 세팅하다보면, .zshrc/.bashrc 같은 것들을 마주하게 될 것이다.
  • git을 사용하고 있는 사람이라면, 어떤 diff 도구(delta, difft)를 사용할지, 어떤 alias 명령어를 등록할지 같은 것들을 명시하기 위해서 .gitconfig 같은 파일을 수정하게 될 때가 있다.
    • 물론, 이런것보다는 git config pull.rebase true 같은 명령어를 실행하는 경우가 더 많을 수 있다. 하지만, 이런 명령어를 실행하면 .gitconfig에도 그대로 기록이 된다.

위에서 언급한 예시를 보면 알 수 있겠듯이, 앞에 dot(.)이 붙어있는 설정파일이라면 dotfiles라고 할 수 있겠다. dotfiles 리포지토리를 만들어서 관리를 하는 이유는 무엇인가? 그것은 바로 어떤 환경에서든 .zshrc/.gitignore 파일 같은 것들을 동일하게 사용하여 작업의 흐름을 온전히 유지할 수 있다는 장점이 있기 때문이다. dotfiles를 git과 같은 버전관리 도구로 관리할 수 있고, github 같은 저장소에 올려놓을 수 있다면.... 어떤 개발환경으로 갈아타더라도 github에서 바로 내려받고, 각 설정파일들을 옮기면 그만이기 때문에 개발환경 설정하는데 드는 시간적 비용을 굉장히 아낄 수 있다.

dotfiles를 관리하는 방법들은 여러가지 있겠지만(symbolic link를 이용한다던가 등등), 개인적으로는 chezmoi를 권장하는 바이다. chezmoi는 dotfiles들을 버전관리할 수 있게 편의성을 제공해주는 CLI 도구이다.

  • 나도 chezmoi를 엄청 애용하고 있기 때문에, 내 dotfiles를 실제로 사용해보고 싶다면, chezmoi init https://github.com/malkoG/dotfiles.git 명령을 실행해보면 된다.

다시, 본론으로 Wezterm에 대해서 알아보자.

Wezterm은 Konsole/iTerm2/Gnome Terminal/Alacritty과 같은 터미널 에뮬레이터이며, Rust 기반으로 구축이 되어 있고, GPU 가속을 지원한다. 따라서, 렌더링 자체도 어느 정도는 빠른 편이다.

주변 사람들에게 한번 써보도록 권장하는 터미널 에뮬레이터가 세 가지 정도 있는데, Alacritty/Kitty 그리고 이 글에서 소개하는 Wezterm 정도 된다. 요즘은 Zig 기반으로 만들어진 Ghostty[1]도 추천할만 한 것 같다. 하지만, 이 글에서는 Wezterm을 소개하기로 했기 때문에, Wezterm 중심으로 소개하도록 하겠다.

Wezterm은 다음과 같은 특징을 가진다.

  • Linux, MacOS, 윈도우즈, FreeBSD 다양한 환경에서 돌아간다.
  • 한 윈도우를 여러개의 pane으로 쪼개서 분할하여 멀티플렉싱을 지원한다.(물론, 나는 ZelliJ/Tmux를 쓰기때문에 잘 이용하지는 않는 기능이다.
  • 마우스 지원이 잘 된다
  • 터미널에 표시되는 글자를 캡쳐해서 하이퍼링크로 치환이 가능하다.
    • 이건 나도 잘 이용하지는 않는 기능이지만.. T0010 같은 코드가 화면 상에 보여진다면, 특정 린터 페이지의 설명화면으로 이동하는 링크를 심을 수 있다. kiyoon님의 dotfiles 참고
  • lua로 스크립팅이 가능한데, 활용할 수 있는 방향이 굉장히 다양하다.
    • 여기에서 설명한 기능들을 최대한 활용하여 스크립팅이 가능하다.
    • API 문서를 슥 훑어보았을때, "어? 설마 이게 되나?" 싶은 생각이 든다면, 여러분이 생각하는 것도 아마 가능할지도 모른다.

Wezterm, 써보자.

Wezterm을 설치한다면 설치 안내 페이지를 참고해서 설치하면 되는데, 여러분이 Wezterm을 설치했다면 당장은 검은 화면만 뜰지도 모른다.

Wezterm을 설치하고 나서, .config/wezterm/wezterm.lua 파일을 수정해야 하는데, 당장은 아래처럼 비어있을 것이다. 파일이 없다면 만들어두는 것이 좋다.

return {}

위의 코드에서 {}는 lua에서는 테이블(다른 언어로 치면, 딕셔너리/오브젝트 같은 것)이지만, wezterm 터미널의 configuration을 나타내는 테이블이다. 여기에 몇가지 추가사항을 넣어보겠다.

터미널 에뮬레이터를 설치했는데, 터미널 에뮬레이터를 설치했으면 가장 처음부터 하는게 무엇이겠는가? 바로, 폰트를 세팅하는 것이다. 터미널 환경에서 작업할때 폰트만큼 중요한게 또 없다.

local wezterm = require("wezterm")

return {
	font = wezterm.font_with_fallback({'Cascadia Code NF', 'NanumBarunGothic'}),
	font_size = 12.0,
	line_height = 1.2,
}

폰트를 가져다 쓸때는 위의 예시와 같이 font_with_fallback 함수를 이용해서 가져다 쓸 수 있고, 그 외에도 폰트 크기를 지정하거나 행간을 지정할 수도 있다. 공식페이지에서 보았듯이, 여러분의 취향에 따라 배경색 혹은 배경이미지도 지정할 수 있는데 여러분 나름대로의 기준이 있고 욕심이 난다면 한번 도전해보는 것도 나쁘지 않을 것 같다.

위의 코드를 복사 붙여넣고 편집하다보면 느낄 수 있겠지만, wezterm은 설정파일을 편집할때 Hot Reloading을 지원한다. 이 또한, 내가 가장 애정하는 기능 중 하나이다. 혹여나 wezterm 설정 파일을 수정했을때, 문법에 오류가 있거나 설정값을 잘못 지정했을 때, 새 창으로 어떤 부분에 오류가 있는지 친절하게 Alert도 띄워준다.

API 레퍼런스를 보기만 해도 스크립팅으로 기능을 확장할 수 있는 가능성이야 당연히 많긴 하겠지만, 처음 접하는 입장에서는 어떻게 커스터마이징할 지 파악하기 난해할 수 있다.

아래에서는 내가 어떻게 Wezterm을 커스터마이징을 하고 있는지 예시를 나열하는 것으로 글을 끝내겠다. Wezterm, 믿고 써보시라.

내가 Wezterm을 응용하는 방법

1. 반투명도 조정하기

Wezterm에서 터미널 색상을 설정할때, 배경색상의 반투명도를 지정할 수 있는 옵션이 있다. 나는 여기서 단축키를 입력했을때 반투명도를 동적으로 조절하고 싶었다.

반투명도를 상수로 둘 수는 있지만, 모니터 하나 짜리의 환경에서 작업한다면 브라우저를 뒤쪽에 두고 터미널 앱을 앞에 두는 식으로 작업을 많이 하게 된다. HMR(Hot Module Reloading)이 되는 개발환경이라면, 소스코드를 편집하고 화면에 즉각적으로 반영이 되는걸 기대할텐데 이걸 탭 스위칭하면서 확인하기는 굉장히 번거롭다. 온전히 작업을 유지하다가 잠깐 확인하고 싶을때 반투명도를 변경하면 되는데도 말이다.

Wezterm에서는 이벤트를 발신할 수 있고, 다른 프로세스에서 특정 이벤트를 수신했을때 어떤 동작을 할 것인지를 정의할 수 있다. Wezterm 터미널 옵션을 수정하는것도 여기에 포함될 수 있다. 특정 단축키를 입력하면, 어떤 이벤트를 발생시킬 수 있고, 그 이벤트로 인해서 화면의 반투명도를 조정할 수 있게 했다.

local default_opacity = 0.9

local keymaps = {}

-- SHIFT + CTRL + Z 키를 누르면 반투명도를 감소시키는 이벤트가 발생한다.
table.insert(
  keymaps,
  {
	key = "Z",
	mods = 'SHIFT|CTRL',
	action = wezterm.action.EmitEvent 'decrease-opacity',
  }
)

-- SHIFT + CTRL + X 키를 누르면 반투명도를 증가시키는 이벤트가 발생한다.
table.insert(
  keymaps,
  {
	key = 'X',
	mods = 'SHIFT|CTRL',
	action = wezterm.action.EmitEvent 'increase-opacity',
  }
)


-- "increase-opacity" 이벤트를 수신했을때, 반투명도를 증가시키는 동작을 하도록 정의한다.
wezterm.on('increase-opacity', function(window, pane)
  local overrides = window:get_config_overrides() or {}
  local opacity = overrides.window_background_opacity
  if opacity == nil then
	opacity = default_opacity
  end

  opacity = opacity + 0.1
  if opacity > 1.0 then
	opacity = 1.0
  end
  overrides.window_background_opacity = opacity

  window:set_config_overrides(overrides)
end)

-- "increase-opacity" 이벤트를 수신했을때, 반투명도를 증가시키는 동작을 하도록 정의한다.
wezterm.on('decrease-opacity', function(window, pane)
  local overrides = window:get_config_overrides() or {}
  local opacity = overrides.window_background_opacity

  if opacity == nil then
	opacity = default_opacity
  end

  opacity = opacity - 0.1
  if opacity < 0.3 then
	opacity = 0.3
  end
  overrides.window_background_opacity = opacity

  window:set_config_overrides(overrides)
end)

return {
  keys = keymaps
}

2. 탭 이름 변경하기

대부분 터미널 에뮬레이터에서 탭 이름을 표시할때, 현재 탭에서 돌고 있는 프로세스의 이름을 명시할때가 많다. 그런데, 탭에 명시되어 있는 타이틀만 가지고는 각각의 탭이 어떤 역할을 하는 것인지 파악하기 어렵다. 어느 쪽이 서버를 띄우고 있는건지, 어느 쪽이 에디터 편집 화면인지, 어느 쪽이 LLM Agent를 돌리고 있는지 난해하다.

하지만, 아래처럼 wezterm.action.PromptInputLine API를 사용해서 프롬프트 입력을 받은 내용을 기반으로, 현재 활성화된 탭의 이름을 변경하는 식으로 인지부하를 줄일 수 있다.

local wezterm = require('wezterm')
local keymaps = {}

table.insert(
  keymaps,
  {
	key = '`',
	mods = 'CTRL',
	action = wezterm.action.PromptInputLine {
	  description = "Enter new name for tab",
	  action = wezterm.action_callback(function(window, _, line)
	    if line then
		  window:active_tab():set_title(line)
		end
	  end)
	}
  }
)

return {
  keys = keymaps
}

3. BEEP음 대신 화면이 번쩍이게 하기

Aider나 Claude Code 같은 LLM 에이전트가 작업을 수행 후 아예 작업이 끝났거나, 혹은 작업에 대한 승인을 요구할 때가 간혹 있다. LLM 에이전트가 작업을 수행하는걸 가만히 보고만 있을 순 없을 것이다.

Claude Code/Aider는 다행히도 응답을 하고 나서 추가적인 명령을 실행할 수 있는 옵션[2]을 제공해주는데, 거기에 간단하게 echo -ne '\007' 명령어를 넘겨줄 수 있다. 이 명령어는 엄청 어렵지는 않다. 터미널 앱에 내장된 시스템 벨 소리를 재생하는 명령어다.

작업 환경이 어디냐에 따라 다를 순 있겠지만, 작업 완료 여부를 음성으로 받기에는 물리적인 제약이 있을 수 있다. 아예 알림 센터를 이용한다고 치자. 업무 시간대에 방해금지 모드를 설정했다면 알림이 울리게 설정이 했더라도 시스템 제약상 묻힐 가능성도 있다.[3]

visual_bell 옵션을 활용하면, 터미널에 내장된 시스템 벨 소리를 울리는 대신 화면이 반짝이게 해서 다른 에이전트가 응답을 완료했다고 명시적으로 알림을 받을 수 있다. LLM 에이전트가 하는 일을 일일이 모니터링하지 않더라도, 다른 작업을 수행하는 중에 화면이 반짝이면 그때 확인하기만 하면 그만이다.

return {
	colors = {
		visual_bell = '#003355',
	},

	visual_bell = {
		fade_in_duration_ms  = 75,
		fade_out_duration_ms = 75,
		target               = 'BackgroundColor', -- 또는 'CursorColor'
	}
}

  1. Hashicorp 공동창업자인 Mitchell Hashimoto가 만든 터미널 에뮬레이터인데, OpenAI에서 Codex 시연할때 Ghostty 터미널로 시연한 바가 있다. ↩︎

  2. Aider는 notifications-command, Claude Code는 Hook이 있다 ↩︎

  3. 어떤 사람은 휴대전화를 진동모드로 해놓고, 텔레그램/디스코드로 알림쏴서 알림을 수신받는 방식을 쓰고 있는 것을 관찰한 바는 있다. ↩︎

Jaeyeol Lee's avatar
Jaeyeol Lee

@kodingwarrior@hackers.pub

이 글(그리고 후속작이 될 글들)은, 내 개발환경에서 자주 사용하고 있고 실제로도 애정하고 있는 도구에 대해서 소개하게 될 것 같다. 내가 어떤 환경에서 개발하고 있는지 궁금한 분들은 내 dotfiles 리포지토리를 참고해도 좋을 것 같다.

먼저, dotfiles란 무엇인가?

dotfiles라는 이름 자체만 보면 뭔가 대단해보일 것 같지만, dotfiles라는 이름 자체는 그냥 단순하다.

  • 어딘가의 가이드라인에서 지시하는대로 개발환경을 세팅하다보면, .zshrc/.bashrc 같은 것들을 마주하게 될 것이다.
  • git을 사용하고 있는 사람이라면, 어떤 diff 도구(delta, difft)를 사용할지, 어떤 alias 명령어를 등록할지 같은 것들을 명시하기 위해서 .gitconfig 같은 파일을 수정하게 될 때가 있다.
    • 물론, 이런것보다는 git config pull.rebase true 같은 명령어를 실행하는 경우가 더 많을 수 있다. 하지만, 이런 명령어를 실행하면 .gitconfig에도 그대로 기록이 된다.

위에서 언급한 예시를 보면 알 수 있겠듯이, 앞에 dot(.)이 붙어있는 설정파일이라면 dotfiles라고 할 수 있겠다. dotfiles 리포지토리를 만들어서 관리를 하는 이유는 무엇인가? 그것은 바로 어떤 환경에서든 .zshrc/.gitignore 파일 같은 것들을 동일하게 사용하여 작업의 흐름을 온전히 유지할 수 있다는 장점이 있기 때문이다. dotfiles를 git과 같은 버전관리 도구로 관리할 수 있고, github 같은 저장소에 올려놓을 수 있다면.... 어떤 개발환경으로 갈아타더라도 github에서 바로 내려받고, 각 설정파일들을 옮기면 그만이기 때문에 개발환경 설정하는데 드는 시간적 비용을 굉장히 아낄 수 있다.

dotfiles를 관리하는 방법들은 여러가지 있겠지만(symbolic link를 이용한다던가 등등), 개인적으로는 chezmoi를 권장하는 바이다. chezmoi는 dotfiles들을 버전관리할 수 있게 편의성을 제공해주는 CLI 도구이다.

  • 나도 chezmoi를 엄청 애용하고 있기 때문에, 내 dotfiles를 실제로 사용해보고 싶다면, chezmoi init https://github.com/malkoG/dotfiles.git 명령을 실행해보면 된다.

다시, 본론으로 Wezterm에 대해서 알아보자.

Wezterm은 Konsole/iTerm2/Gnome Terminal/Alacritty과 같은 터미널 에뮬레이터이며, Rust 기반으로 구축이 되어 있고, GPU 가속을 지원한다. 따라서, 렌더링 자체도 어느 정도는 빠른 편이다.

주변 사람들에게 한번 써보도록 권장하는 터미널 에뮬레이터가 세 가지 정도 있는데, Alacritty/Kitty 그리고 이 글에서 소개하는 Wezterm 정도 된다. 요즘은 Zig 기반으로 만들어진 Ghostty[1]도 추천할만 한 것 같다. 하지만, 이 글에서는 Wezterm을 소개하기로 했기 때문에, Wezterm 중심으로 소개하도록 하겠다.

Wezterm은 다음과 같은 특징을 가진다.

  • Linux, MacOS, 윈도우즈, FreeBSD 다양한 환경에서 돌아간다.
  • 한 윈도우를 여러개의 pane으로 쪼개서 분할하여 멀티플렉싱을 지원한다.(물론, 나는 ZelliJ/Tmux를 쓰기때문에 잘 이용하지는 않는 기능이다.
  • 마우스 지원이 잘 된다
  • 터미널에 표시되는 글자를 캡쳐해서 하이퍼링크로 치환이 가능하다.
    • 이건 나도 잘 이용하지는 않는 기능이지만.. T0010 같은 코드가 화면 상에 보여진다면, 특정 린터 페이지의 설명화면으로 이동하는 링크를 심을 수 있다. kiyoon님의 dotfiles 참고
  • lua로 스크립팅이 가능한데, 활용할 수 있는 방향이 굉장히 다양하다.
    • 여기에서 설명한 기능들을 최대한 활용하여 스크립팅이 가능하다.
    • API 문서를 슥 훑어보았을때, "어? 설마 이게 되나?" 싶은 생각이 든다면, 여러분이 생각하는 것도 아마 가능할지도 모른다.

Wezterm, 써보자.

Wezterm을 설치한다면 설치 안내 페이지를 참고해서 설치하면 되는데, 여러분이 Wezterm을 설치했다면 당장은 검은 화면만 뜰지도 모른다.

Wezterm을 설치하고 나서, .config/wezterm/wezterm.lua 파일을 수정해야 하는데, 당장은 아래처럼 비어있을 것이다. 파일이 없다면 만들어두는 것이 좋다.

return {}

위의 코드에서 {}는 lua에서는 테이블(다른 언어로 치면, 딕셔너리/오브젝트 같은 것)이지만, wezterm 터미널의 configuration을 나타내는 테이블이다. 여기에 몇가지 추가사항을 넣어보겠다.

터미널 에뮬레이터를 설치했는데, 터미널 에뮬레이터를 설치했으면 가장 처음부터 하는게 무엇이겠는가? 바로, 폰트를 세팅하는 것이다. 터미널 환경에서 작업할때 폰트만큼 중요한게 또 없다.

local wezterm = require("wezterm")

return {
	font = wezterm.font_with_fallback({'Cascadia Code NF', 'NanumBarunGothic'}),
	font_size = 12.0,
	line_height = 1.2,
}

폰트를 가져다 쓸때는 위의 예시와 같이 font_with_fallback 함수를 이용해서 가져다 쓸 수 있고, 그 외에도 폰트 크기를 지정하거나 행간을 지정할 수도 있다. 공식페이지에서 보았듯이, 여러분의 취향에 따라 배경색 혹은 배경이미지도 지정할 수 있는데 여러분 나름대로의 기준이 있고 욕심이 난다면 한번 도전해보는 것도 나쁘지 않을 것 같다.

위의 코드를 복사 붙여넣고 편집하다보면 느낄 수 있겠지만, wezterm은 설정파일을 편집할때 Hot Reloading을 지원한다. 이 또한, 내가 가장 애정하는 기능 중 하나이다. 혹여나 wezterm 설정 파일을 수정했을때, 문법에 오류가 있거나 설정값을 잘못 지정했을 때, 새 창으로 어떤 부분에 오류가 있는지 친절하게 Alert도 띄워준다.

API 레퍼런스를 보기만 해도 스크립팅으로 기능을 확장할 수 있는 가능성이야 당연히 많긴 하겠지만, 처음 접하는 입장에서는 어떻게 커스터마이징할 지 파악하기 난해할 수 있다.

아래에서는 내가 어떻게 Wezterm을 커스터마이징을 하고 있는지 예시를 나열하는 것으로 글을 끝내겠다. Wezterm, 믿고 써보시라.

내가 Wezterm을 응용하는 방법

1. 반투명도 조정하기

Wezterm에서 터미널 색상을 설정할때, 배경색상의 반투명도를 지정할 수 있는 옵션이 있다. 나는 여기서 단축키를 입력했을때 반투명도를 동적으로 조절하고 싶었다.

반투명도를 상수로 둘 수는 있지만, 모니터 하나 짜리의 환경에서 작업한다면 브라우저를 뒤쪽에 두고 터미널 앱을 앞에 두는 식으로 작업을 많이 하게 된다. HMR(Hot Module Reloading)이 되는 개발환경이라면, 소스코드를 편집하고 화면에 즉각적으로 반영이 되는걸 기대할텐데 이걸 탭 스위칭하면서 확인하기는 굉장히 번거롭다. 온전히 작업을 유지하다가 잠깐 확인하고 싶을때 반투명도를 변경하면 되는데도 말이다.

Wezterm에서는 이벤트를 발신할 수 있고, 다른 프로세스에서 특정 이벤트를 수신했을때 어떤 동작을 할 것인지를 정의할 수 있다. Wezterm 터미널 옵션을 수정하는것도 여기에 포함될 수 있다. 특정 단축키를 입력하면, 어떤 이벤트를 발생시킬 수 있고, 그 이벤트로 인해서 화면의 반투명도를 조정할 수 있게 했다.

local default_opacity = 0.9

local keymaps = {}

-- SHIFT + CTRL + Z 키를 누르면 반투명도를 감소시키는 이벤트가 발생한다.
table.insert(
  keymaps,
  {
	key = "Z",
	mods = 'SHIFT|CTRL',
	action = wezterm.action.EmitEvent 'decrease-opacity',
  }
)

-- SHIFT + CTRL + X 키를 누르면 반투명도를 증가시키는 이벤트가 발생한다.
table.insert(
  keymaps,
  {
	key = 'X',
	mods = 'SHIFT|CTRL',
	action = wezterm.action.EmitEvent 'increase-opacity',
  }
)


-- "increase-opacity" 이벤트를 수신했을때, 반투명도를 증가시키는 동작을 하도록 정의한다.
wezterm.on('increase-opacity', function(window, pane)
  local overrides = window:get_config_overrides() or {}
  local opacity = overrides.window_background_opacity
  if opacity == nil then
	opacity = default_opacity
  end

  opacity = opacity + 0.1
  if opacity > 1.0 then
	opacity = 1.0
  end
  overrides.window_background_opacity = opacity

  window:set_config_overrides(overrides)
end)

-- "increase-opacity" 이벤트를 수신했을때, 반투명도를 증가시키는 동작을 하도록 정의한다.
wezterm.on('decrease-opacity', function(window, pane)
  local overrides = window:get_config_overrides() or {}
  local opacity = overrides.window_background_opacity

  if opacity == nil then
	opacity = default_opacity
  end

  opacity = opacity - 0.1
  if opacity < 0.3 then
	opacity = 0.3
  end
  overrides.window_background_opacity = opacity

  window:set_config_overrides(overrides)
end)

return {
  keys = keymaps
}

2. 탭 이름 변경하기

대부분 터미널 에뮬레이터에서 탭 이름을 표시할때, 현재 탭에서 돌고 있는 프로세스의 이름을 명시할때가 많다. 그런데, 탭에 명시되어 있는 타이틀만 가지고는 각각의 탭이 어떤 역할을 하는 것인지 파악하기 어렵다. 어느 쪽이 서버를 띄우고 있는건지, 어느 쪽이 에디터 편집 화면인지, 어느 쪽이 LLM Agent를 돌리고 있는지 난해하다.

하지만, 아래처럼 wezterm.action.PromptInputLine API를 사용해서 프롬프트 입력을 받은 내용을 기반으로, 현재 활성화된 탭의 이름을 변경하는 식으로 인지부하를 줄일 수 있다.

local wezterm = require('wezterm')
local keymaps = {}

table.insert(
  keymaps,
  {
	key = '`',
	mods = 'CTRL',
	action = wezterm.action.PromptInputLine {
	  description = "Enter new name for tab",
	  action = wezterm.action_callback(function(window, _, line)
	    if line then
		  window:active_tab():set_title(line)
		end
	  end)
	}
  }
)

return {
  keys = keymaps
}

3. BEEP음 대신 화면이 번쩍이게 하기

Aider나 Claude Code 같은 LLM 에이전트가 작업을 수행 후 아예 작업이 끝났거나, 혹은 작업에 대한 승인을 요구할 때가 간혹 있다. LLM 에이전트가 작업을 수행하는걸 가만히 보고만 있을 순 없을 것이다.

Claude Code/Aider는 다행히도 응답을 하고 나서 추가적인 명령을 실행할 수 있는 옵션[2]을 제공해주는데, 거기에 간단하게 echo -ne '\007' 명령어를 넘겨줄 수 있다. 이 명령어는 엄청 어렵지는 않다. 터미널 앱에 내장된 시스템 벨 소리를 재생하는 명령어다.

작업 환경이 어디냐에 따라 다를 순 있겠지만, 작업 완료 여부를 음성으로 받기에는 물리적인 제약이 있을 수 있다. 아예 알림 센터를 이용한다고 치자. 업무 시간대에 방해금지 모드를 설정했다면 알림이 울리게 설정이 했더라도 시스템 제약상 묻힐 가능성도 있다.[3]

visual_bell 옵션을 활용하면, 터미널에 내장된 시스템 벨 소리를 울리는 대신 화면이 반짝이게 해서 다른 에이전트가 응답을 완료했다고 명시적으로 알림을 받을 수 있다. LLM 에이전트가 하는 일을 일일이 모니터링하지 않더라도, 다른 작업을 수행하는 중에 화면이 반짝이면 그때 확인하기만 하면 그만이다.

return {
	colors = {
		visual_bell = '#003355',
	},

	visual_bell = {
		fade_in_duration_ms  = 75,
		fade_out_duration_ms = 75,
		target               = 'BackgroundColor', -- 또는 'CursorColor'
	}
}

  1. Hashicorp 공동창업자인 Mitchell Hashimoto가 만든 터미널 에뮬레이터인데, OpenAI에서 Codex 시연할때 Ghostty 터미널로 시연한 바가 있다. ↩︎

  2. Aider는 notifications-command, Claude Code는 Hook이 있다 ↩︎

  3. 어떤 사람은 휴대전화를 진동모드로 해놓고, 텔레그램/디스코드로 알림쏴서 알림을 수신받는 방식을 쓰고 있는 것을 관찰한 바는 있다. ↩︎

Jaeyeol Lee's avatar
Jaeyeol Lee

@kodingwarrior@hackers.pub

이 글(그리고 후속작이 될 글들)은, 내 개발환경에서 자주 사용하고 있고 실제로도 애정하고 있는 도구에 대해서 소개하게 될 것 같다. 내가 어떤 환경에서 개발하고 있는지 궁금한 분들은 내 dotfiles 리포지토리를 참고해도 좋을 것 같다.

먼저, dotfiles란 무엇인가?

dotfiles라는 이름 자체만 보면 뭔가 대단해보일 것 같지만, dotfiles라는 이름 자체는 그냥 단순하다.

  • 어딘가의 가이드라인에서 지시하는대로 개발환경을 세팅하다보면, .zshrc/.bashrc 같은 것들을 마주하게 될 것이다.
  • git을 사용하고 있는 사람이라면, 어떤 diff 도구(delta, difft)를 사용할지, 어떤 alias 명령어를 등록할지 같은 것들을 명시하기 위해서 .gitconfig 같은 파일을 수정하게 될 때가 있다.
    • 물론, 이런것보다는 git config pull.rebase true 같은 명령어를 실행하는 경우가 더 많을 수 있다. 하지만, 이런 명령어를 실행하면 .gitconfig에도 그대로 기록이 된다.

위에서 언급한 예시를 보면 알 수 있겠듯이, 앞에 dot(.)이 붙어있는 설정파일이라면 dotfiles라고 할 수 있겠다. dotfiles 리포지토리를 만들어서 관리를 하는 이유는 무엇인가? 그것은 바로 어떤 환경에서든 .zshrc/.gitignore 파일 같은 것들을 동일하게 사용하여 작업의 흐름을 온전히 유지할 수 있다는 장점이 있기 때문이다. dotfiles를 git과 같은 버전관리 도구로 관리할 수 있고, github 같은 저장소에 올려놓을 수 있다면.... 어떤 개발환경으로 갈아타더라도 github에서 바로 내려받고, 각 설정파일들을 옮기면 그만이기 때문에 개발환경 설정하는데 드는 시간적 비용을 굉장히 아낄 수 있다.

dotfiles를 관리하는 방법들은 여러가지 있겠지만(symbolic link를 이용한다던가 등등), 개인적으로는 chezmoi를 권장하는 바이다. chezmoi는 dotfiles들을 버전관리할 수 있게 편의성을 제공해주는 CLI 도구이다.

  • 나도 chezmoi를 엄청 애용하고 있기 때문에, 내 dotfiles를 실제로 사용해보고 싶다면, chezmoi init https://github.com/malkoG/dotfiles.git 명령을 실행해보면 된다.

다시, 본론으로 Wezterm에 대해서 알아보자.

Wezterm은 Konsole/iTerm2/Gnome Terminal/Alacritty과 같은 터미널 에뮬레이터이며, Rust 기반으로 구축이 되어 있고, GPU 가속을 지원한다. 따라서, 렌더링 자체도 어느 정도는 빠른 편이다.

주변 사람들에게 한번 써보도록 권장하는 터미널 에뮬레이터가 세 가지 정도 있는데, Alacritty/Kitty 그리고 이 글에서 소개하는 Wezterm 정도 된다. 요즘은 Zig 기반으로 만들어진 Ghostty[1]도 추천할만 한 것 같다. 하지만, 이 글에서는 Wezterm을 소개하기로 했기 때문에, Wezterm 중심으로 소개하도록 하겠다.

Wezterm은 다음과 같은 특징을 가진다.

  • Linux, MacOS, 윈도우즈, FreeBSD 다양한 환경에서 돌아간다.
  • 한 윈도우를 여러개의 pane으로 쪼개서 분할하여 멀티플렉싱을 지원한다.(물론, 나는 ZelliJ/Tmux를 쓰기때문에 잘 이용하지는 않는 기능이다.
  • 마우스 지원이 잘 된다
  • 터미널에 표시되는 글자를 캡쳐해서 하이퍼링크로 치환이 가능하다.
    • 이건 나도 잘 이용하지는 않는 기능이지만.. T0010 같은 코드가 화면 상에 보여진다면, 특정 린터 페이지의 설명화면으로 이동하는 링크를 심을 수 있다. kiyoon님의 dotfiles 참고
  • lua로 스크립팅이 가능한데, 활용할 수 있는 방향이 굉장히 다양하다.
    • 여기에서 설명한 기능들을 최대한 활용하여 스크립팅이 가능하다.
    • API 문서를 슥 훑어보았을때, "어? 설마 이게 되나?" 싶은 생각이 든다면, 여러분이 생각하는 것도 아마 가능할지도 모른다.

Wezterm, 써보자.

Wezterm을 설치한다면 설치 안내 페이지를 참고해서 설치하면 되는데, 여러분이 Wezterm을 설치했다면 당장은 검은 화면만 뜰지도 모른다.

Wezterm을 설치하고 나서, .config/wezterm/wezterm.lua 파일을 수정해야 하는데, 당장은 아래처럼 비어있을 것이다. 파일이 없다면 만들어두는 것이 좋다.

return {}

위의 코드에서 {}는 lua에서는 테이블(다른 언어로 치면, 딕셔너리/오브젝트 같은 것)이지만, wezterm 터미널의 configuration을 나타내는 테이블이다. 여기에 몇가지 추가사항을 넣어보겠다.

터미널 에뮬레이터를 설치했는데, 터미널 에뮬레이터를 설치했으면 가장 처음부터 하는게 무엇이겠는가? 바로, 폰트를 세팅하는 것이다. 터미널 환경에서 작업할때 폰트만큼 중요한게 또 없다.

local wezterm = require("wezterm")

return {
	font = wezterm.font_with_fallback({'Cascadia Code NF', 'NanumBarunGothic'}),
	font_size = 12.0,
	line_height = 1.2,
}

폰트를 가져다 쓸때는 위의 예시와 같이 font_with_fallback 함수를 이용해서 가져다 쓸 수 있고, 그 외에도 폰트 크기를 지정하거나 행간을 지정할 수도 있다. 공식페이지에서 보았듯이, 여러분의 취향에 따라 배경색 혹은 배경이미지도 지정할 수 있는데 여러분 나름대로의 기준이 있고 욕심이 난다면 한번 도전해보는 것도 나쁘지 않을 것 같다.

위의 코드를 복사 붙여넣고 편집하다보면 느낄 수 있겠지만, wezterm은 설정파일을 편집할때 Hot Reloading을 지원한다. 이 또한, 내가 가장 애정하는 기능 중 하나이다. 혹여나 wezterm 설정 파일을 수정했을때, 문법에 오류가 있거나 설정값을 잘못 지정했을 때, 새 창으로 어떤 부분에 오류가 있는지 친절하게 Alert도 띄워준다.

API 레퍼런스를 보기만 해도 스크립팅으로 기능을 확장할 수 있는 가능성이야 당연히 많긴 하겠지만, 처음 접하는 입장에서는 어떻게 커스터마이징할 지 파악하기 난해할 수 있다.

아래에서는 내가 어떻게 Wezterm을 커스터마이징을 하고 있는지 예시를 나열하는 것으로 글을 끝내겠다. Wezterm, 믿고 써보시라.

내가 Wezterm을 응용하는 방법

1. 반투명도 조정하기

Wezterm에서 터미널 색상을 설정할때, 배경색상의 반투명도를 지정할 수 있는 옵션이 있다. 나는 여기서 단축키를 입력했을때 반투명도를 동적으로 조절하고 싶었다.

반투명도를 상수로 둘 수는 있지만, 모니터 하나 짜리의 환경에서 작업한다면 브라우저를 뒤쪽에 두고 터미널 앱을 앞에 두는 식으로 작업을 많이 하게 된다. HMR(Hot Module Reloading)이 되는 개발환경이라면, 소스코드를 편집하고 화면에 즉각적으로 반영이 되는걸 기대할텐데 이걸 탭 스위칭하면서 확인하기는 굉장히 번거롭다. 온전히 작업을 유지하다가 잠깐 확인하고 싶을때 반투명도를 변경하면 되는데도 말이다.

Wezterm에서는 이벤트를 발신할 수 있고, 다른 프로세스에서 특정 이벤트를 수신했을때 어떤 동작을 할 것인지를 정의할 수 있다. Wezterm 터미널 옵션을 수정하는것도 여기에 포함될 수 있다. 특정 단축키를 입력하면, 어떤 이벤트를 발생시킬 수 있고, 그 이벤트로 인해서 화면의 반투명도를 조정할 수 있게 했다.

local default_opacity = 0.9

local keymaps = {}

-- SHIFT + CTRL + Z 키를 누르면 반투명도를 감소시키는 이벤트가 발생한다.
table.insert(
  keymaps,
  {
	key = "Z",
	mods = 'SHIFT|CTRL',
	action = wezterm.action.EmitEvent 'decrease-opacity',
  }
)

-- SHIFT + CTRL + X 키를 누르면 반투명도를 증가시키는 이벤트가 발생한다.
table.insert(
  keymaps,
  {
	key = 'X',
	mods = 'SHIFT|CTRL',
	action = wezterm.action.EmitEvent 'increase-opacity',
  }
)


-- "increase-opacity" 이벤트를 수신했을때, 반투명도를 증가시키는 동작을 하도록 정의한다.
wezterm.on('increase-opacity', function(window, pane)
  local overrides = window:get_config_overrides() or {}
  local opacity = overrides.window_background_opacity
  if opacity == nil then
	opacity = default_opacity
  end

  opacity = opacity + 0.1
  if opacity > 1.0 then
	opacity = 1.0
  end
  overrides.window_background_opacity = opacity

  window:set_config_overrides(overrides)
end)

-- "increase-opacity" 이벤트를 수신했을때, 반투명도를 증가시키는 동작을 하도록 정의한다.
wezterm.on('decrease-opacity', function(window, pane)
  local overrides = window:get_config_overrides() or {}
  local opacity = overrides.window_background_opacity

  if opacity == nil then
	opacity = default_opacity
  end

  opacity = opacity - 0.1
  if opacity < 0.3 then
	opacity = 0.3
  end
  overrides.window_background_opacity = opacity

  window:set_config_overrides(overrides)
end)

return {
  keys = keymaps
}

2. 탭 이름 변경하기

대부분 터미널 에뮬레이터에서 탭 이름을 표시할때, 현재 탭에서 돌고 있는 프로세스의 이름을 명시할때가 많다. 그런데, 탭에 명시되어 있는 타이틀만 가지고는 각각의 탭이 어떤 역할을 하는 것인지 파악하기 어렵다. 어느 쪽이 서버를 띄우고 있는건지, 어느 쪽이 에디터 편집 화면인지, 어느 쪽이 LLM Agent를 돌리고 있는지 난해하다.

하지만, 아래처럼 wezterm.action.PromptInputLine API를 사용해서 프롬프트 입력을 받은 내용을 기반으로, 현재 활성화된 탭의 이름을 변경하는 식으로 인지부하를 줄일 수 있다.

local wezterm = require('wezterm')
local keymaps = {}

table.insert(
  keymaps,
  {
	key = '`',
	mods = 'CTRL',
	action = wezterm.action.PromptInputLine {
	  description = "Enter new name for tab",
	  action = wezterm.action_callback(function(window, _, line)
	    if line then
		  window:active_tab():set_title(line)
		end
	  end)
	}
  }
)

return {
  keys = keymaps
}

3. BEEP음 대신 화면이 번쩍이게 하기

Aider나 Claude Code 같은 LLM 에이전트가 작업을 수행 후 아예 작업이 끝났거나, 혹은 작업에 대한 승인을 요구할 때가 간혹 있다. LLM 에이전트가 작업을 수행하는걸 가만히 보고만 있을 순 없을 것이다.

Claude Code/Aider는 다행히도 응답을 하고 나서 추가적인 명령을 실행할 수 있는 옵션[2]을 제공해주는데, 거기에 간단하게 echo -ne '\007' 명령어를 넘겨줄 수 있다. 이 명령어는 엄청 어렵지는 않다. 터미널 앱에 내장된 시스템 벨 소리를 재생하는 명령어다.

작업 환경이 어디냐에 따라 다를 순 있겠지만, 작업 완료 여부를 음성으로 받기에는 물리적인 제약이 있을 수 있다. 아예 알림 센터를 이용한다고 치자. 업무 시간대에 방해금지 모드를 설정했다면 알림이 울리게 설정이 했더라도 시스템 제약상 묻힐 가능성도 있다.[3]

visual_bell 옵션을 활용하면, 터미널에 내장된 시스템 벨 소리를 울리는 대신 화면이 반짝이게 해서 다른 에이전트가 응답을 완료했다고 명시적으로 알림을 받을 수 있다. LLM 에이전트가 하는 일을 일일이 모니터링하지 않더라도, 다른 작업을 수행하는 중에 화면이 반짝이면 그때 확인하기만 하면 그만이다.

return {
	colors = {
		visual_bell = '#003355',
	},

	visual_bell = {
		fade_in_duration_ms  = 75,
		fade_out_duration_ms = 75,
		target               = 'BackgroundColor', -- 또는 'CursorColor'
	}
}

  1. Hashicorp 공동창업자인 Mitchell Hashimoto가 만든 터미널 에뮬레이터인데, OpenAI에서 Codex 시연할때 Ghostty 터미널로 시연한 바가 있다. ↩︎

  2. Aider는 notifications-command, Claude Code는 Hook이 있다 ↩︎

  3. 어떤 사람은 휴대전화를 진동모드로 해놓고, 텔레그램/디스코드로 알림쏴서 알림을 수신받는 방식을 쓰고 있는 것을 관찰한 바는 있다. ↩︎

Fedify: ActivityPub server framework's avatar
Fedify: ActivityPub server framework

@fedify@hollo.social

🎉 Big thanks to @2chanhaeng for his first contribution to ! He implemented the new fedify webfinger command in PR #278, which allows isolated lookups for testing configurations. This addresses the need for developers to test WebFinger functionality without performing comprehensive object retrieval.

The contribution includes:

  • A new fedify webfinger <handle> command that accepts @user@domain format handles or URIs
  • Clean JSON output of WebFinger JRD results
  • Proper error handling for invalid handles and lookup failures
  • Complete integration with help text and usage examples

This was originally filed as issue #260 and marked as a good first issue—perfect for newcomers to learn the codebase structure while contributing meaningful functionality. The PR has been merged and will be included in the upcoming Fedify 1.8.0 release.

We appreciate all first-time contributors who help make Fedify better for the entire community. Welcome aboard, ChanHaeng!

Fedify: ActivityPub server framework's avatar
Fedify: ActivityPub server framework

@fedify@hollo.social

🎉 Big thanks to @2chanhaeng for his first contribution to ! He implemented the new fedify webfinger command in PR #278, which allows isolated lookups for testing configurations. This addresses the need for developers to test WebFinger functionality without performing comprehensive object retrieval.

The contribution includes:

  • A new fedify webfinger <handle> command that accepts @user@domain format handles or URIs
  • Clean JSON output of WebFinger JRD results
  • Proper error handling for invalid handles and lookup failures
  • Complete integration with help text and usage examples

This was originally filed as issue #260 and marked as a good first issue—perfect for newcomers to learn the codebase structure while contributing meaningful functionality. The PR has been merged and will be included in the upcoming Fedify 1.8.0 release.

We appreciate all first-time contributors who help make Fedify better for the entire community. Welcome aboard, ChanHaeng!

Fedify: ActivityPub server framework's avatar
Fedify: ActivityPub server framework

@fedify@hollo.social

🎉 Big thanks to @2chanhaeng for his first contribution to ! He implemented the new fedify webfinger command in PR #278, which allows isolated lookups for testing configurations. This addresses the need for developers to test WebFinger functionality without performing comprehensive object retrieval.

The contribution includes:

  • A new fedify webfinger <handle> command that accepts @user@domain format handles or URIs
  • Clean JSON output of WebFinger JRD results
  • Proper error handling for invalid handles and lookup failures
  • Complete integration with help text and usage examples

This was originally filed as issue #260 and marked as a good first issue—perfect for newcomers to learn the codebase structure while contributing meaningful functionality. The PR has been merged and will be included in the upcoming Fedify 1.8.0 release.

We appreciate all first-time contributors who help make Fedify better for the entire community. Welcome aboard, ChanHaeng!

Fedify: ActivityPub server framework's avatar
Fedify: ActivityPub server framework

@fedify@hollo.social

🎉 Big thanks to @2chanhaeng for his first contribution to ! He implemented the new fedify webfinger command in PR #278, which allows isolated lookups for testing configurations. This addresses the need for developers to test WebFinger functionality without performing comprehensive object retrieval.

The contribution includes:

  • A new fedify webfinger <handle> command that accepts @user@domain format handles or URIs
  • Clean JSON output of WebFinger JRD results
  • Proper error handling for invalid handles and lookup failures
  • Complete integration with help text and usage examples

This was originally filed as issue #260 and marked as a good first issue—perfect for newcomers to learn the codebase structure while contributing meaningful functionality. The PR has been merged and will be included in the upcoming Fedify 1.8.0 release.

We appreciate all first-time contributors who help make Fedify better for the entire community. Welcome aboard, ChanHaeng!

Fedify: ActivityPub server framework's avatar
Fedify: ActivityPub server framework

@fedify@hollo.social

🎉 Big thanks to @2chanhaeng for his first contribution to ! He implemented the new fedify webfinger command in PR #278, which allows isolated lookups for testing configurations. This addresses the need for developers to test WebFinger functionality without performing comprehensive object retrieval.

The contribution includes:

  • A new fedify webfinger <handle> command that accepts @user@domain format handles or URIs
  • Clean JSON output of WebFinger JRD results
  • Proper error handling for invalid handles and lookup failures
  • Complete integration with help text and usage examples

This was originally filed as issue #260 and marked as a good first issue—perfect for newcomers to learn the codebase structure while contributing meaningful functionality. The PR has been merged and will be included in the upcoming Fedify 1.8.0 release.

We appreciate all first-time contributors who help make Fedify better for the entire community. Welcome aboard, ChanHaeng!

Fedify: ActivityPub server framework's avatar
Fedify: ActivityPub server framework

@fedify@hollo.social

🎉 Big thanks to @2chanhaeng for his first contribution to ! He implemented the new fedify webfinger command in PR #278, which allows isolated lookups for testing configurations. This addresses the need for developers to test WebFinger functionality without performing comprehensive object retrieval.

The contribution includes:

  • A new fedify webfinger <handle> command that accepts @user@domain format handles or URIs
  • Clean JSON output of WebFinger JRD results
  • Proper error handling for invalid handles and lookup failures
  • Complete integration with help text and usage examples

This was originally filed as issue #260 and marked as a good first issue—perfect for newcomers to learn the codebase structure while contributing meaningful functionality. The PR has been merged and will be included in the upcoming Fedify 1.8.0 release.

We appreciate all first-time contributors who help make Fedify better for the entire community. Welcome aboard, ChanHaeng!

Fedify: ActivityPub server framework's avatar
Fedify: ActivityPub server framework

@fedify@hollo.social

🎉 Big thanks to @2chanhaeng for his first contribution to ! He implemented the new fedify webfinger command in PR #278, which allows isolated lookups for testing configurations. This addresses the need for developers to test WebFinger functionality without performing comprehensive object retrieval.

The contribution includes:

  • A new fedify webfinger <handle> command that accepts @user@domain format handles or URIs
  • Clean JSON output of WebFinger JRD results
  • Proper error handling for invalid handles and lookup failures
  • Complete integration with help text and usage examples

This was originally filed as issue #260 and marked as a good first issue—perfect for newcomers to learn the codebase structure while contributing meaningful functionality. The PR has been merged and will be included in the upcoming Fedify 1.8.0 release.

We appreciate all first-time contributors who help make Fedify better for the entire community. Welcome aboard, ChanHaeng!

Fedify: ActivityPub server framework's avatar
Fedify: ActivityPub server framework

@fedify@hollo.social

🎉 Big thanks to @2chanhaeng for his first contribution to ! He implemented the new fedify webfinger command in PR #278, which allows isolated lookups for testing configurations. This addresses the need for developers to test WebFinger functionality without performing comprehensive object retrieval.

The contribution includes:

  • A new fedify webfinger <handle> command that accepts @user@domain format handles or URIs
  • Clean JSON output of WebFinger JRD results
  • Proper error handling for invalid handles and lookup failures
  • Complete integration with help text and usage examples

This was originally filed as issue #260 and marked as a good first issue—perfect for newcomers to learn the codebase structure while contributing meaningful functionality. The PR has been merged and will be included in the upcoming Fedify 1.8.0 release.

We appreciate all first-time contributors who help make Fedify better for the entire community. Welcome aboard, ChanHaeng!

DWeb's avatar
DWeb

@dweb@social.coop

⚡ Use the Internet Archive like a Hacker-Librarian! 🔮

Join a hands-on workshop where we’ll demystify the CLI and turn it into your super power for archiving, accessing, and uploading content to the @internetarchive.

Hosted by the @ZFAVClub, with the participation of @tommi, we’ll learn and share our experience using the awesome ia tool!

🗓️ Jul 3, 16:00 UTC (9 PDT, 18 CEST)
PARTICIPATION IS FREE

ℹ️ Info + registration: lu.ma/zv3blohp

Graphic with the title “Introduction to the Command Line Interface of Internet Archive”
ALT text detailsGraphic with the title “Introduction to the Command Line Interface of Internet Archive”
readbeanicecream's avatar
readbeanicecream

@readbeanicecream@mastodon.social

Mastodon on Toot TUI

There is nothing like a TUI (text user interface) to really help me focus. So when I stumbled on Toot TUI, I had to give it a try. Now, it is probably one of my favorite terminal applications.

readbeanicecream.surge.sh/2025

readbeanicecream's avatar
readbeanicecream

@readbeanicecream@mastodon.social

Mastodon on Toot TUI

There is nothing like a TUI (text user interface) to really help me focus. So when I stumbled on Toot TUI, I had to give it a try. Now, it is probably one of my favorite terminal applications.

readbeanicecream.surge.sh/2025

Paco Hope for Harris's avatar
Paco Hope for Harris

@paco@infosec.exchange

I am slowly oxidizing my unix CLI. A lot of people have made rust based versions of common unix utilities and some of them are REALLY good.

Like fd-find for doing essentially find . -name blah. And rg (ripgrep) which does grep -R but it's aware of git, files like pyc or .bak files, and it excludes them by default.

Now I have sd which is hopefully replacing the last thing I used perl for. I write perl -pi -e s/x/y/g a lot. Just doing a quick string replace inside a file. So sd can start doing that.

I'm also trying to get used to zellij instead of tmux and starship for modern prompt decorations like the kids do.

These kids, my friends, are welcome on my lawn.

Monsieur B.'s avatar
Monsieur B.

@jesuismonsieurb@framapiaf.org

Gens de Mastodon, j'ai une nouvelle fois besoin de votre aide.
Existerait-il un petite commande magique en bash qui permette de puiser dans un dossier contenant des images pour en faire un diaporama à partir d'elles, dans un ordre aléatoire ?

Monsieur B.'s avatar
Monsieur B.

@jesuismonsieurb@framapiaf.org

Gens de Mastodon, j'ai une nouvelle fois besoin de votre aide.
Existerait-il un petite commande magique en bash qui permette de puiser dans un dossier contenant des images pour en faire un diaporama à partir d'elles, dans un ordre aléatoire ?

JdeBP's avatar
JdeBP

@JdeBP@tty0.social · Reply to Chris Siebenmann's post

@cks

You and Ted Unangst. (-:

* news.ycombinator.com/item?id=4

Unless there are two *different* pieces about text editors today that conflate command-line and textual user interface.

Joan León's avatar
Joan León

@nucliweb@webperf.social

Bold Brew (bbrew) - A Homebrew TUI Manager

github.com/Valkyrie00/bold-bre

bbrew installed screenshot
ALT text detailsbbrew installed screenshot
Joan León's avatar
Joan León

@nucliweb@webperf.social

Bold Brew (bbrew) - A Homebrew TUI Manager

github.com/Valkyrie00/bold-bre

bbrew installed screenshot
ALT text detailsbbrew installed screenshot
grobi's avatar
grobi

@grobi@defcon.social

Please Please stop the madness! Stop using Java-script for Unix/Linux tutorials !!

As an intensive Unix and Linux user, I love to use a command-line browser. As a rule, these are links, elinks or lynx for me.

So far, they have guided me to my goal at lightning speed, are resource-saving, require little bandwidth, do not distract with unnecessary bells and whistles and, above all, they work even if the X-system fails and I have to boot without a desktop !

For me, commandline or text-based browsers are part of the Linux fire brigade and are the salvation of many users in need. But it doesn't help at all if manuals, help pages and other tutorials use Java-script!

In the example below, you can see a search query in the links browser with the parameters: "Linux close all windows commandline"

Of the 10 websites shown in the search results, 7 (!) could not be displayed at all because of Javascript, 2 did not really correspond to the parameters and only one (the github page) had a corresponding readable answer.

Does that make sense?
Absolutely not!!

Therefore, an anxious request:

Dear Tutorial Content Creators, Dear OS Developers please stop using Javascript or at least provide a plain text or html option, PLEASE PLEASE PLEASE PLEASE PLEASE

Andrew Graves :arch: :linux:'s avatar
Andrew Graves :arch: :linux:

@graves501@fosstodon.org

Is there a tool that can convert markdown files to PDFs that is not Pandoc? Pandoc has a lot of dependencies that I won't use, so I'd like to avoid that.

Hugo van Kemenade's avatar
Hugo van Kemenade

@hugovk@mastodon.social · Reply to Hugo van Kemenade's post

Just released! 🚀

Enabled colour help for Python 3.14:

🎨 em-keyboard 5.2.0
🎨 linkotron 0.5.0
🎨 norwegianblue 0.22.0
🎨 pepotron 1.5.0
🎨 pypistats 1.10.0

Also added Python 3.15 to pepotron: `pep 3.15` opens PEP 790.

Colour output of `linkotron --help` and `em --help`.
ALT text detailsColour output of `linkotron --help` and `em --help`.
Colour output of `pep --help`.
ALT text detailsColour output of `pep --help`.
Colour output of `pypistats python_minor --help`.
ALT text detailsColour output of `pypistats python_minor --help`.
Colour output of `eol --help`.
ALT text detailsColour output of `eol --help`.
LavX News's avatar
LavX News

@lavxnews@ioc.exchange

Introducing kdlfmt: The Essential CLI Tool for KDL Document Formatting

The new kdlfmt CLI tool simplifies the formatting and validation of KDL (Kotlin Data Language) documents, making it an indispensable utility for developers working with this emerging data format. Buil...

news.lavx.hu/article/introduci

Introducing kdlfmt: The Essential CLI Tool for KDL Document Formatting
ALT text detailsIntroducing kdlfmt: The Essential CLI Tool for KDL Document Formatting
Karsten Schmidt's avatar
Karsten Schmidt

@toxi@mastodon.thi.ng

Just pushed a new version of thi.ng/block-fs, now with additional multi-command CLI tooling to convert & bundle a local file system tree into a single block-based binary blob (e.g. for bundling assets, or distributing a virtual filesystem as part of a web app, or for snapshot testing, or as bridge for WASM interop etc.)

Also new, the main API now includes a `.readAsObjectURL()` method to wrap files as URLs to binary blobs with associated MIME types, thereby making it trivial to use the virtual filesystem for sourcing stored images and other assets for direct use in the browser...

(Ps. For more context see other recent announcement: mastodon.thi.ng/@toxi/11426498)

Screenshot excerpt from the project readme (link in post) containing information about the CLI wrapper, as well as example usage (here to convert/bundle as filesystem tree)
ALT text detailsScreenshot excerpt from the project readme (link in post) containing information about the CLI wrapper, as well as example usage (here to convert/bundle as filesystem tree)
Screenshot excerpt from the project readme (link in post) containing information about the CLI wrapper, as well as example usage (here to list contents of an already bundled filesystem)
ALT text detailsScreenshot excerpt from the project readme (link in post) containing information about the CLI wrapper, as well as example usage (here to list contents of an already bundled filesystem)
readbeanicecream's avatar
readbeanicecream

@readbeanicecream@mastodon.social

Zettelkasten on the CLI

Let's take a look at my Zettelkasten notetaking workflow on the Linux Command Line. Trust me, it's simple.

readbeanicecream.surge.sh/2025

indieweb

Manos Pitsidianakis's avatar
Manos Pitsidianakis

@epilys@chaos.social

Stupid-but-works tip on how to add inline documentation comments for multi-line shell commands in scripts: Combine command substitution with grave accents "`" and the do-nothing built-in command ":":

```shell
% ls \
> -h `: this is a comment` \
> -a `: this is another comment` \
> -t `: more commentssss`
```

Manos Pitsidianakis's avatar
Manos Pitsidianakis

@epilys@chaos.social

Stupid-but-works tip on how to add inline documentation comments for multi-line shell commands in scripts: Combine command substitution with grave accents "`" and the do-nothing built-in command ":":

```shell
% ls \
> -h `: this is a comment` \
> -a `: this is another comment` \
> -t `: more commentssss`
```

readbeanicecream's avatar
readbeanicecream

@readbeanicecream@mastodon.social

Zettelkasten on the CLI

Let's take a look at my Zettelkasten notetaking workflow on the Linux Command Line. Trust me, it's simple.

readbeanicecream.surge.sh/2025

indieweb

Hugo van Kemenade's avatar
Hugo van Kemenade

@hugovk@mastodon.social · Reply to Hugo van Kemenade's post

Just released: pypistats 1.9.0 🚀

pypistats is CLI to show download stats from PyPI

pypi.org/project/pypistats/1.9

* Replace deprecated classifier with licence expression (PEP 639)
* Remove GitHub attestation, uses PyPI attestations instead (PEP 740)
* Add input validation for total and fix --monthly with no mirror
* Update docs for recent command

Terminal output of running "pypistats python_minor pillow", showing a table of Python versions sorted by how many downloads each is responsible for.
ALT text detailsTerminal output of running "pypistats python_minor pillow", showing a table of Python versions sorted by how many downloads each is responsible for.
Fedi.Tips's avatar
Fedi.Tips

@FediTips@social.growyourown.services

Here's a very brief tip for the more techy people on here:

You can use Mastodon (and compatible servers) through command lines and text-based interfaces with the free open source client "toot":

➡️ toot.bezdomni.net

There are lots more details on the developer's website.

Fedi.Tips's avatar
Fedi.Tips

@FediTips@social.growyourown.services

Here's a very brief tip for the more techy people on here:

You can use Mastodon (and compatible servers) through command lines and text-based interfaces with the free open source client "toot":

➡️ toot.bezdomni.net

There are lots more details on the developer's website.

scy's avatar
scy

@scy@chaos.social

`lowdown -tterm` produces pretty nice rendering in the .

kristaps.bsd.lv/lowdown/

Screenshot of an article talking about tab-completion for bash aliases, rendered in plain text. Monospace parts are rendered blue & bold, links are yellow and bold and followed by the URL they're linking to in green and underlined. Code blocks are indented, bold, and with a blue line to their left.
ALT text detailsScreenshot of an article talking about tab-completion for bash aliases, rendered in plain text. Monospace parts are rendered blue & bold, links are yellow and bold and followed by the URL they're linking to in green and underlined. Code blocks are indented, bold, and with a blue line to their left.
maxlath's avatar
maxlath

@maxlath@mastodon.social · Reply to Sebastian Lasse's post

@sl007 which command are you using? Somethink like the following could work:

wd data Q183 --props P3086 --simplify --keep richvalues,qualifiers

freespiritlinux69 :fedi:'s avatar
freespiritlinux69 :fedi:

@freespiritlinux69@fedi.at

Schönen guten Morgen,

Ich habe mich entschieden, ein kleines Tutorial über CLI-Befehle unter Linux zu erstellen.
CLI steht für Command Line Interface, was auf Deutsch als Befehlszeilenschnittstelle bezeichnet wird. Es handelt sich um eine textbasierte Benutzeroberfläche, die es Benutzern ermöglicht, mit einem Computer oder einem Betriebssystem zu interagieren, indem sie Befehle in Form von Text eingeben.
In Linux kann das sogenannte Terminal zur Eingabe von CLI-Befehlen verwendet werden.

Bitte teilt das mit eurer , damit mehr Menschen darauf aufmerksam werden. Dieses Tutorial richtet sich an Anfänger, die das Terminal unter Linux nicht als furchterregendes Monster betrachten, sondern effizient damit arbeiten möchten.

DANKESCHÖN

Der Link führt direkt zum Thread mit dem Tutorial und kann bei Bedarf gespeichert werden.

fedi.at/@freespiritlinux69/114

Tuist's avatar
Tuist

@tuist@fosstodon.org

Soon our Noora single-choice prompt component will support filtering thanks to @finnvoorhees's brilliant work in this PR:
github.com/tuist/Noora/pull/19

Tuist's avatar
Tuist

@tuist@fosstodon.org

Soon our Noora single-choice prompt component will support filtering thanks to @finnvoorhees's brilliant work in this PR:
github.com/tuist/Noora/pull/19

Artemis's avatar
Artemis

@artemissian@fosstodon.org

Alternative tools to check out and try:

bat github.com/sharkdp/bat
bottom github.com/ClementTsang/bottom
broot github.com/Canop/broot
btop github.com/aristocratos/btop
cheat github.com/cheat/cheat
choose github.com/theryangeary/choose
curlie github.com/rs/curlie
delta github.com/dandavison/delta
doggo github.com/mr-karan/doggo
dust github.com/bootandy/dust
duf github.com/muesli/duf
dysk github.com/Canop/dysk
eza github.com/eza-community/eza
fd github.com/sharkdp/fd
fzf github.com/junegunn/fzf

Artemis's avatar
Artemis

@artemissian@fosstodon.org

Alternative tools to check out and try:

bat github.com/sharkdp/bat
bottom github.com/ClementTsang/bottom
broot github.com/Canop/broot
btop github.com/aristocratos/btop
cheat github.com/cheat/cheat
choose github.com/theryangeary/choose
curlie github.com/rs/curlie
delta github.com/dandavison/delta
doggo github.com/mr-karan/doggo
dust github.com/bootandy/dust
duf github.com/muesli/duf
dysk github.com/Canop/dysk
eza github.com/eza-community/eza
fd github.com/sharkdp/fd
fzf github.com/junegunn/fzf

hyaline.systems's avatar
hyaline.systems

@hyalinesystems@mastodon.social

📼 Command line video magic for ARTISTS

A cookbook by @madskjeldgaard for audio and video processing on the command line – with examples!

Includes how to generate a spectrum video from an audio file. How to combine an audio file and an image into a video. Among other things.

And it includes full scripts and examples for for-loops, so you could do this on tons of audio files, if you so fancied 🤠

hyaline.systems/blog/ffmpeg-fo

ploum's avatar
ploum

@ploum@mamot.fr

If you are a Unix nerd and wish you spend less time using your mouse while watching flashy colors, I recommend that you give Offpunk a try:

offpunk.net/

I’m trying to make it easier to get started with offpunk. Feedbacks and discussions are welcome on the mailing-list :

lists.sr.ht/~lioploum/offpunk-

or on the fediverse, using the hashtag. Or on your blog. That would be awesome to read blog posts about people using offpunk

Orhun Parmaksız 👾's avatar
Orhun Parmaksız 👾

@orhun@fosstodon.org

I found the ultimate CLI tool for processing CSV files! 🔥

🪄✨ **xan**: The CSV magician.

💯 Supports expressions, parallelism, advanced filtering, sorting, and visualizations.

🦀 Written in Rust & uses @ratatui_rs

⭐ GitHub: github.com/medialab/xan

ploum's avatar
ploum

@ploum@mamot.fr

If you are a Unix nerd and wish you spend less time using your mouse while watching flashy colors, I recommend that you give Offpunk a try:

offpunk.net/

I’m trying to make it easier to get started with offpunk. Feedbacks and discussions are welcome on the mailing-list :

lists.sr.ht/~lioploum/offpunk-

or on the fediverse, using the hashtag. Or on your blog. That would be awesome to read blog posts about people using offpunk

Orhun Parmaksız 👾's avatar
Orhun Parmaksız 👾

@orhun@fosstodon.org

I found the ultimate CLI tool for processing CSV files! 🔥

🪄✨ **xan**: The CSV magician.

💯 Supports expressions, parallelism, advanced filtering, sorting, and visualizations.

🦀 Written in Rust & uses @ratatui_rs

⭐ GitHub: github.com/medialab/xan

nev's avatar
nev

@nev@bananachips.club · Reply to Julia's Reruns Bot's post

@b0rk_reruns ok so i have a kind of cursed question. often i'm doing something like `for file in $(ls *.txt); do echo ${file%.txt}; done`. why won't bash let me do ${$(ls *.txt)%.txt} and is there a better way to do it

(cc @b0rk)

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@hongminhee@hollo.social

, an -powered app for summarizing web pages, now distributes the official executables for Linux, macOS, and Windows!

https://github.com/dahlia/yoyak/releases/tag/0.3.0

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@hongminhee@hollo.social

, an -powered app for summarizing web pages, now distributes the official executables for Linux, macOS, and Windows!

https://github.com/dahlia/yoyak/releases/tag/0.3.0

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@hongminhee@hollo.social

, an -powered app for summarizing web pages, now distributes the official executables for Linux, macOS, and Windows!

https://github.com/dahlia/yoyak/releases/tag/0.3.0

blinry's avatar
blinry

@blinry@chaos.social

I'm looking for a command line tool that allows watching a video file together on two computers, with synchronized play/pause, like these "watch party" sites, but inside a local network.

In the simplest case, it could be a Bash command streaming/decoding a local file at the same time, and another person could receive that stream…? Has anyone seen something like that?

blinry's avatar
blinry

@blinry@chaos.social

I'm looking for a command line tool that allows watching a video file together on two computers, with synchronized play/pause, like these "watch party" sites, but inside a local network.

In the simplest case, it could be a Bash command streaming/decoding a local file at the same time, and another person could receive that stream…? Has anyone seen something like that?

ploum's avatar
ploum

@ploum@mamot.fr

Released Offpunk 2.5 which add custom "aliases" and improve compatibility with and version < 3.11

What is Offpunk?

offpunk.net/whatisoffpunk.html

You are welcome to discuss and ask questions on the offpunk-users list:

lists.sr.ht/~lioploum/offpunk-

If you are familiar with python development, join the offpunk-devel list to help intregrate offpunk and unmerdify, a new library developed by @vjousse :

lists.sr.ht/~lioploum/offpunk-

ploum's avatar
ploum

@ploum@mamot.fr

Released Offpunk 2.5 which add custom "aliases" and improve compatibility with and version < 3.11

What is Offpunk?

offpunk.net/whatisoffpunk.html

You are welcome to discuss and ask questions on the offpunk-users list:

lists.sr.ht/~lioploum/offpunk-

If you are familiar with python development, join the offpunk-devel list to help intregrate offpunk and unmerdify, a new library developed by @vjousse :

lists.sr.ht/~lioploum/offpunk-

Robert Kingett's avatar
Robert Kingett

@WeirdWriter@caneandable.social

So, I am giving a try. It’s a command line utility that will allow you to copy things from one cloud storage to the other with ease, sync one way or buy directionally, and Mount cloud storage as virtual drives on your machine so you can mount things like Google Drive, iCloud Drive, and even OneDrive without using any of their bloated and inaccessible software. Of course, the first thing I tried to do with it, it’s not capable of Yet. I tried to copy my writing from an off-line hard drive to three different cloud services with one command. That’s not possible as of yet, but I would still highly recommend this tool even if I’m sure I’m not utilizing it to its full glory as of yet. , ,

nickbearded's avatar
nickbearded

@nickbearded@mastodon.social

The website is live!

bashcore.org/

:rss: Qiita - 人気の記事's avatar
:rss: Qiita - 人気の記事

@qiita@rss-mstdn.studiofreesia.com

JavaでCLIツールを作る
qiita.com/umiushi_1/items/4da6

Levi Beach's avatar
Levi Beach

@levibeach@merveilles.town · Reply to Levi Beach's post

Thinking through some settings UI this morning.

Mockup of ADSR settings for command line synthesizer.
ALT text detailsMockup of ADSR settings for command line synthesizer.
Stephen Ramsay's avatar
Stephen Ramsay

@sramsay@hcommons.social

I'm pleased to present a new blog post -- "Beautiful Documents with Groff (Part II)" stephenramsay.net/posts/groff- -- only a year-and-a-half after "Beautiful Documents with Groff (Part I)" stephenramsay.net/posts/groff-

Of interest, perhaps, to users of and/or , cultists, and digital document nerds. Discusses , , , and even (though not the kind that makes you sneeze).

Levi Beach's avatar
Levi Beach

@levibeach@merveilles.town · Reply to Levi Beach's post

So I guess it's happening and I'm really excited to explore all the possibilities. Using the Node binding for Rust's Web Audio API to create sound, which means I can do stuff like impulse response to model spaces!

Two command line windows, one running Orca, the other running something called "HORSE SYNTH". Extremely basic controls for wave shape and ADSR are visible.
ALT text detailsTwo command line windows, one running Orca, the other running something called "HORSE SYNTH". Extremely basic controls for wave shape and ADSR are visible.
Hugo van Kemenade's avatar
Hugo van Kemenade

@hugovk@mastodon.social · Reply to Hugo van Kemenade's post

Just released! stravavis 0.5.0 🚀

Create artistic visualisations with your exercise data.

pypi.org/project/stravavis/0.5

🚴 Drop support for EOL Python 3.8

🏃 Skip segments in GPX tracks with empty trkseg

🛶 Fix pandas warnings

A heatmap of Helsinki and surrounding with black lines indicating bike rides.
ALT text detailsA heatmap of Helsinki and surrounding with black lines indicating bike rides.
Hugo van Kemenade's avatar
Hugo van Kemenade

@hugovk@mastodon.social · Reply to Hugo van Kemenade's post

Just released: blurb 1.3.0 🚀

blurb is the CLI we use for managing CPython's news/changelog entries.

🗞️ Add support for Python 3.13

🗞️ Drop support for Python 3.8

🗞️ Generate digital attestations for PyPI (PEP 740)

🗞️ Allow running blurb test from blurb-* directories by

🗞️ Add version subcommand

🗞️ Generate __version__ at build to avoid slow importlib.metadata

pypi.org/project/blurb/1.3.0/

Hugo van Kemenade's avatar
Hugo van Kemenade

@hugovk@mastodon.social · Reply to Hugo van Kemenade's post

Just released: norwegianblue 0.19.0 🚀

🦜 Drop support for Python 3.8

🦜 Generate digital attestations for PyPI (PEP 740)

🦜 Test with tox-uv

🦜 Lint with pre-commit-uv

pypi.org/project/norwegianblue

norwegianblue is a CLI to show EOLs from endoflife.date

A CLI call of "eol python" showing a coloured table of each Python feature release, its latest x.y.z version and date, and the dates of when it enters security-only and EOL.
ALT text detailsA CLI call of "eol python" showing a coloured table of each Python feature release, its latest x.y.z version and date, and the dates of when it enters security-only and EOL.
Hugo van Kemenade's avatar
Hugo van Kemenade

@hugovk@mastodon.social · Reply to Hugo van Kemenade's post

Just released: pepotron 1.3.0 🚀

🔩 Generate digital attestations for PyPI (PEP 740)

🔩 Drop support for Python 3.8

🔩 Generate __version__ at build to avoid slow importlib.metadata

🔩 Test on CI with uv

pypi.org/project/pepotron/1.3.

Pepotron is a CLI for opening PEPs in your browser. For example, try:

$ pep 8

$ pep 3.14

$ pep dead batteries

$ pep calendar

Hugo van Kemenade's avatar
Hugo van Kemenade

@hugovk@mastodon.social · Reply to Hugo van Kemenade's post

Just released: pypistats 1.7.0 🚀

📈 Generate digital attestations for PyPI (PEP 740)

📉 Drop support for EOL Python 3.8

📈 Generate __version__ at build to avoid slow importlib.metadata

pypi.org/project/pypistats/1.7

Example use, showing an ASCII chart:

❯ pypistats python_minor pillow --last-month
┌──────────┬─────────┬─────────────┐
│ category │ percent │   downloads │
├──────────┼─────────┼─────────────┤
│ 3.10     │  16.80% │  20,297,555 │
│ 3.11     │  15.78% │  19,062,442 │
│ 3.7      │  14.86% │  17,958,611 │
│ 3.9      │  13.68% │  16,530,171 │
│ 3.8      │  12.32% │  14,887,891 │
│ 3.6      │  11.73% │  14,169,137 │
│ 3.12     │   9.56% │  11,548,054 │
│ null     │   4.73% │   5,716,677 │
│ 2.7      │   0.50% │     598,393 │
│ 3.13     │   0.03% │      34,987 │
│ 3.5      │   0.02% │      20,237 │
│ 3.4      │   0.00% │         817 │
│ 3.14     │   0.00% │         232 │
│ 3.3      │   0.00% │          14 │
│ 3.1      │   0.00% │           5 │
│ 3.2      │   0.00% │           2 │
│ Total    │         │ 120,825,225 │
└──────────┴─────────┴─────────────┘

Date range: 2024-09-01 - 2024-09-30
ALT text detailsExample use, showing an ASCII chart: ❯ pypistats python_minor pillow --last-month ┌──────────┬─────────┬─────────────┐ │ category │ percent │ downloads │ ├──────────┼─────────┼─────────────┤ │ 3.10 │ 16.80% │ 20,297,555 │ │ 3.11 │ 15.78% │ 19,062,442 │ │ 3.7 │ 14.86% │ 17,958,611 │ │ 3.9 │ 13.68% │ 16,530,171 │ │ 3.8 │ 12.32% │ 14,887,891 │ │ 3.6 │ 11.73% │ 14,169,137 │ │ 3.12 │ 9.56% │ 11,548,054 │ │ null │ 4.73% │ 5,716,677 │ │ 2.7 │ 0.50% │ 598,393 │ │ 3.13 │ 0.03% │ 34,987 │ │ 3.5 │ 0.02% │ 20,237 │ │ 3.4 │ 0.00% │ 817 │ │ 3.14 │ 0.00% │ 232 │ │ 3.3 │ 0.00% │ 14 │ │ 3.1 │ 0.00% │ 5 │ │ 3.2 │ 0.00% │ 2 │ │ Total │ │ 120,825,225 │ └──────────┴─────────┴─────────────┘ Date range: 2024-09-01 - 2024-09-30
marius's avatar
marius

@mariusor@metalhead.club

Man, I enjoy the API of but sometimes bending one's UI to its paradigm is a pain in the butt.

Summer Emacs 🏳️‍🌈🇺🇦's avatar
Summer Emacs 🏳️‍🌈🇺🇦

@summeremacs@fashionsocial.host

I just posted a new file about how I got into using , , the , and other things.

Here it is: summeremacs.github.io/posts/ho

And no @daviwil, I'm still not starting a blog to post this stuff. 😀

Edit: I was wrong. @daviwil was right. I am leaving my post up here as a victory for him. 🤣

Jelloeater 🥥🌴🚫🔙's avatar
Jelloeater 🥥🌴🚫🔙

@jelloeater@mastodon.social

Got bored, wrote a timestamp app in
github.com/Jelloeater/stampy

matclab's avatar
matclab

@matclab@mamot.fr

Je relance mon blog, en modifiant le système de commentaire pour qu'il utilise mastodon.

Je vais mettre quelques liens ici et commencer par un retour d'expérience sur l'utilisation de `ledger-cli` pour faire mes comptes (que j'utilise toujours).

ontoblogie.clabaut.net/posts/2

Charlie O’Hara's avatar
Charlie O’Hara

@whalecoiner@indieweb.social

Does anyone have a recommendation for a CLI boilerplate text file creator? I need something to help with using my personal website better. I’m thinking of something where I can type “<app> new post” or “<app> new note” and a markdown file of appropriate frontmatter stubs is created, in a predefined directory. It’d have to have some kind of template system available. Know of anything?

OS/1337's avatar
OS/1337

@OS1337@infosec.space

For everyone wanting to test out OS/1337 there's good news:

You can just clone the repo or pull it as :
github.com/OS-1337/OS1337

and then just run ./scripts/build.sh

and within a few mins it'll spit out a bootable image in /build/0.CORE/ to put on a 3,5" FDD or run in a VM [may it be or ]...

Thanks to @SweetAIBelle for the generous contributions!

Servio Paladines's avatar
Servio Paladines

@servio@libretics.org

Presentación

Imagen del Ñu la mascota oficial del movimiento del Software Libre.

: un lugar de encuentro, debate, investigación, desarrollo y difusión acerca de los usos sociales de la tecnología.

Contacto:

Web https://www.libretics.org

Radio https://libretics.org/radio

: podcast.libretics.org/

Grupo xmpp:hacklab-libretics@salas.gnlug…

Grupo : i.delta.chat/#FF36E74BCB6E7C00

Blog: http://3puc73jz3pbflplwe7y5hkopdoq…

Me gusta mucho el concepto de la internet pequeña: 1 persona = 1 servidor = 1 página web. 🧑‍💻🧰🐃🐧🇪🇨

Imagen del Ñu la mascota oficial del movimiento del Software Libre.
ALT text detailsImagen del Ñu la mascota oficial del movimiento del Software Libre.
scy's avatar
scy

@scy@chaos.social

`lowdown -tterm` produces pretty nice rendering in the .

kristaps.bsd.lv/lowdown/

Screenshot of an article talking about tab-completion for bash aliases, rendered in plain text. Monospace parts are rendered blue & bold, links are yellow and bold and followed by the URL they're linking to in green and underlined. Code blocks are indented, bold, and with a blue line to their left.
ALT text detailsScreenshot of an article talking about tab-completion for bash aliases, rendered in plain text. Monospace parts are rendered blue & bold, links are yellow and bold and followed by the URL they're linking to in green and underlined. Code blocks are indented, bold, and with a blue line to their left.
Jean-Mi à peu près expert's avatar
Jean-Mi à peu près expert

@nojhan@mamot.fr

Il parait que j'aurais dû faire une depuis 6 ans, alors voilà. Ici, je pouet :
– science (recherche appliqué en algorithmique de l', en ce moment assez saoulé par son dévoiement corporate),
– design & illustration (souvent vectorielle sous ),
– code libre (auteur de  : , , …),
– politique (anar gauchiste, centriste repenti, radicalisé par le macronisme),
– sondages bizarres (neuroatypique tentant de comprendre comment ça marche dans votre tête).

Elijah Manor's avatar
Elijah Manor

@elijahmanor@hachyderm.io

npx elijahmanor

> Updated to include mastodon instance

business card

📌

Terminal output from the "npx elijahmanor" command
ALT text detailsTerminal output from the "npx elijahmanor" command
Soso's avatar
Soso

@sgued@pouet.chapril.org

🇫🇷 Étudiant, passionné de logiciels libres. J'ai créé peertube-viewer, un petit outil en ligne de commande pour naviguer les vidéos , dans le même esprit que youtube-viewer

🇬🇧 Student, passionate by . I created peertube-viewer, a small tool to browse peertube instances, quite similar to youtube-viewer.