Skip to content

Commit 0a91665

Browse files
committed
feat: move to amazing-sandbox for running various CLI tools
Use https://github.com/ashishb/amazing-sandbox for running tools inside Docker https://ashishb.net/programming/run-tools-inside-docker/ and have an added safety layer
1 parent b3929e9 commit 0a91665

10 files changed

Lines changed: 39 additions & 14 deletions

File tree

_local_bin/aisbom

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
asb uvx --from aisbom-cli aisbom "$@"

_local_bin/claude

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
asb npx @anthropic-ai/claude-code
5+

_local_bin/fastlane

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
asb gem exec fastlane "$@"

_local_bin/gemini-cli

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
asb npx https://github.com/google-gemini/gemini-cli "$@"

_local_bin/mdl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
asb -n gem exec mdl "$@"

_local_bin/npm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
asb npm "$@"

_local_bin/pnpm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
asb npx pnpm "$@"

_local_bin/yarn

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
asb yarn "$@"

bashrc_includes/custom_aliases.bash

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,16 @@ alias localip="ipconfig getifaddr en0"
1515
# List all make targets.
1616
alias make_list="make -qp | sed -n -e 's/^\([^.#[:space:]][^:[:space:]]*\): .*/\1/p'"
1717
alias jq_non_empty="jq 'del(..|select(. == null))' | jq 'del(..|select(. == 0))' | jq 'del(..|select(. == \"\"))'"
18-
# --net=host is to map all web service from docker image to host image
19-
alias npm='docker run --rm --init -it --user=$(id -u):$(id -g) -v "${PWD}":"${PWD}" --net=host --workdir=${PWD} node:25-bookworm-slim npm'
20-
alias npx='docker run --rm --init --user=$(id -u):$(id -g) -v "${PWD}":"${PWD}" --net=host --workdir=${PWD} node:25-bookworm-slim npx'
21-
alias yarn='docker run --rm --init -it --user=$(id -u):$(id -g) --mount=target=/usr/local/share/.cache/yarn/ -v "${PWD}":"${PWD}" --net=host --workdir=${PWD} node:25-bookworm-slim yarn'
22-
# alias uv='docker run --rm -it -v "${PWD}":"${PWD}" ghcr.io/astral-sh/uv:debian uv --directory="${PWD}"'
2318
alias pyupdate='go run github.com/ashishb/pyupdate/src/cmd/pyupdate@latest'
2419
# audiowaveform - https://github.com/bbc/audiowaveform#docker
2520
alias awf='docker run --rm -v `pwd`:/tmp -w /tmp realies/audiowaveform'
26-
27-
28-
# function uv() {
29-
# docker run --rm -it -user $(id -u):$(id -g) -v "${PWD}:${PWD}" -v "${HOME}/.cache/uv:${HOME}/.cache/uv" ghcr.io/astral-sh/uv:debian uv --directory="${PWD}" "$@"
30-
# }
31-
32-
alias htmlhint="npx htmlhint"
21+
# Aliases works only in interactive shells, so, there are in _local_bin and "~/.local/bin" is soft-linked into it
22+
# alias yamllint="asb uvx yamllint"
23+
# alias claude="asb npx @anthropic-ai/claude-code"
24+
# alias npm="asb npm"
25+
# alias npx="asb npx"
26+
# alias yarn="asb yarn"
27+
# alias htmlhint="npx htmlhint"
3328

3429
# Ref: https://serverfault.com/a/1123925/1053189
3530
alias delete_unused_cloud_run="gcloud run revisions list --filter=\"status.conditions.type:Active AND status.conditions.status:'False'\" --format='value(metadata.name)' | xargs -r -L1 gcloud run revisions delete --quiet"

setup/setup_new_mac_machine.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ brew install homebrew/cask/docker
170170
# Docker file linter
171171
brew install hadolint
172172
# YAML file linter
173-
brew install yamllint
173+
# brew install yamllint
174174
# GPG for signing git commits
175175
# https://docs.github.com/en/authentication/managing-commit-signature-verification/generating-a-new-gpg-key
176176
brew install gpg
@@ -243,4 +243,4 @@ fi
243243

244244
# For re-starting running executable on source file changes
245245
sudo gem install filewatcher
246-
sudo gem install mdl
246+
# sudo gem install mdl

0 commit comments

Comments
 (0)