Skip to content

Instantly share code, notes, and snippets.

@lasantosr
Last active October 16, 2025 15:50
Show Gist options
  • Select an option

  • Save lasantosr/137846d029efcc59468ff2c9d2098b4f to your computer and use it in GitHub Desktop.

Select an option

Save lasantosr/137846d029efcc59468ff2c9d2098b4f to your computer and use it in GitHub Desktop.
IntelliShell Commands

IntelliShell Commands

This Gist contains a collection of command templates and dynamic completions exported from intelli-shell, a smart command-line assistant designed to boost your productivity by creating a searchable and reusable library of your shell commands, featuring templates for common tools like git, cargo, docker, and kubectl.

You can easily import all the commands and completions by running:

intelli-shell import -i --gist 137846d029efcc59468ff2c9d2098b4f

This will open an interactive menu where you can review, edit, and select the commands and completions you want to import.

  • Use Space to discard an item, and Ctrl+Space to toggle all
  • Press F2 to edit a command or its description before importing
  • Hit Enter to import all non-discarded items into your library
# intelli-shell import --gist 137846d029efcc59468ff2c9d2098b4f/cargo.sh
# [alias:clippy] Lint the current package or workspace
cargo cargo clippy {{--all-features}} -- -D warnings
# [alias:rustfmt] Check for nightly rustfmt problems on the current package or workspace
cargo +nightly fmt -- --check
# Publishes a crate to crates.io
cargo publish {{--allow-dirty}} {{-p package-name}}
# Manually execute ignored tests matching the given test name in cargo
cargo test {{test-name}} -- --ignored
# Manually run rustfmt for each rust file individually to detect even internal errors
find . -path './target' -prune -o \( -type f -name '*.rs' -exec rustfmt +nightly --check --edition 2024 {} + \)
## --- Completions ---
$ (cargo) -p package-name: cargo metadata --no-deps --format-version 1 | jq -r 'INDEX(.packages[]; .id) as $pkg_by_id | .workspace_members[] | $pkg_by_id[.] | "-p \(.name)"' | sort
# intelli-shell import --gist 137846d029efcc59468ff2c9d2098b4f/docker.sh
# [alias:dr] Runs a docker image and remove it on exit
docker run {{-it}} --rm {{image}}
# [alias:dshell] Opens a shell on a running container
docker exec -it -e TERM {{container}} {{bash}}
# [alias:db] Build a docker image
docker build {{--target name}} -t {{name:tag}} {{.}}
# Clear docker builder cache
docker builder prune
# Pull latest images for a compose
docker compose pull
# [alias:dc] Start or stop a docker compose file
docker compose {{up -d|down}}
# [alias:dclog] Follow log output for a compose service
docker compose logs --follow {{service}}
# Restart a docker compose service
docker compose restart {{service}}
## --- Completions ---
$ (docker) image: docker images --filter "dangling=false" --format "{{.Repository}}:{{.Tag}}" | grep -v ":<none>$"
$ (docker) container: docker ps -a --format '{{.Names}}'
$ (docker) service: docker compose config --services
# intelli-shell import --gist 137846d029efcc59468ff2c9d2098b4f/git.sh
# [alias:gb] Checkout a new git feature or bugfix branch
git checkout -b {{feature|bugfix}}/{{{description:kebab}}}
# [alias:gcp] Checkout trunk branch back and pull new changes
git checkout {{main|develop}} && git pull
# [alias:gprune] Prune remote branches that no longer exist
git fetch {{remote}} --prune
# List last git commits
git --no-pager log -n {{3}} --oneline
# Amend a commit without editing the message
git commit --amend --no-edit
# Undo last commit(s) from git into staged changes
git reset --soft HEAD~{{1}}
# [alias:gt] Create and push a new git tag
git tag -a {{tag}} -m "{{{description}}}" && git push {{remote}} {{tag}}
# Delete a tag and push its deletion to remote
git tag -d {{tag}} && git push {{remote}} --delete {{tag}}
## --- Completions ---
$ (git) tag: git tag --sort=-v:refname
$ (git) remote: git remote
# intelli-shell import --gist 137846d029efcc59468ff2c9d2098b4f/kubectl.sh
# [alias:kube] Kubectl pointing at a specific environment, to be completed after selection
kubectl --context {{context}} -n {{namespace}}
# [alias:kport] Port forward a k8s service
kubectl port-forward --context {{context}} -n {{namespace}} {{service}} {{local-port:remote-port}}
# [alias:klog] Follow logs for a k8s service
kubectl logs --context {{context}} -n {{namespace}} {{service}} --follow --since {{10m}}
# [alias:ksecret] Retrieve a secret from k8s
kubectl get secret --context {{context}} -n {{namespace}} {{secret-name}} -o json | jq -r '.data."{{secret-key}}"' | base64 --decode
# [alias:kexec] Execute an interactive bash shell in a specific pod
kubectl exec --context {{context}} -n {{namespace}} -it {{pod}} -- {{bash}}
## --- Completions ---
$ (kubectl) context: kubectl config get-contexts -o name
$ (kubectl) namespace: kubectl get ns {{--context {{context}}}} --no-headers -o custom-columns=':.metadata.name'
$ (kubectl) pod: kubectl get pods {{--context {{context}}}} {{-n {{namespace}}}} -o name
$ (kubectl) service: kubectl get svc {{--context {{context}}}} {{-n {{namespace}}}} -o name | sed 's|^service/|svc/|'
$ (kubectl) secret-name: kubectl get secret {{--context {{context}}}} {{-n {{namespace}}}} --no-headers -o custom-columns=':.metadata.name'
$ (kubectl) secret-key: kubectl get secret {{--context {{context}}}} {{-n {{namespace}}}} {{{{secret-name}}}} -o json | jq -r '.data | keys[]'
# intelli-shell import --gist 137846d029efcc59468ff2c9d2098b4f/misc.sh
# Find some text in any file of a path
grep {{--include=\*.rs}} -Rnw '{{path}}' {{-e|-E}} '{{{pattern-or-regex}}}'
# Generate an SSH key pair
ssh-keygen -t ed25519 -C "{{[email protected]}}"
# Measure multiple metrics when executing a command
/usr/bin/time -v {{{command}}}
# Update intelli-shell to the latest version
curl -sSf https://raw.githubusercontent.com/lasantosr/intelli-shell/main/install.sh | sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment