Last active
January 3, 2026 11:22
-
-
Save wassname/00539244455041b3a1a6d5081163217f to your computer and use it in GitHub Desktop.
justfile cheatsheet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # see https://cheatography.com/linux-china/cheat-sheets/justfile/ | |
| # we can set sehll | |
| set shell := ["zsh", "-cu"] | |
| # settings | |
| set dotenv-load | |
| # Export all just variables as environment variables. | |
| set export | |
| export AWS_PROFILE := "cds" | |
| export DISTRIBUTION_ID := "EH0PEV5I6TH" | |
| export S3_BUCKET_NAME := "wassn" | |
| [private] | |
| default: @just --list | |
| variables: | |
| #!/bin/bash -x | |
| # JUST curly vars work even when we've called bash | |
| echo {{S3_BUCKET_NAME}}ucket | |
| serv: | |
| # good for non secret env vars | |
| echo "$DATABASE_ADDRESS from .env" | |
| serv_alt: | |
| #!/bin/bash | |
| export DATABASE_ADDRESS=88 | |
| @just serv | |
| # run some python | |
| python: | |
| #!python | |
| import os, shutil, subprocess | |
| os.listdir('.') | |
| # run breakout | |
| breakout: srv # dependant on srv | |
| python src/main.py env.train.id=BreakoutNoFrameskip-v4 | |
| crafter: | |
| python src/main.py env.train.id=CrafterReward-v1 | |
| # param with default value | |
| minihack env='MiniHack-River-v0': | |
| python src/main.py env.train.id={{env}} | |
| # watch the latest runs | |
| watch_latest: | |
| #!/bin/bash | |
| # NOTE: declaring bash seems to fix `export` and break @just. It seems like unless you declare the shell it does some hybrid? | |
| . ./.venv/bin/activate | |
| cd ./outputs && \ | |
| cd *([-1]) && \ | |
| cd *([-1]) && \ | |
| scripts/play.sh -e -r -h | |
| # run one method, by argument | |
| run METHOD='reprpo_ortho' +EXTRA_ARGS='': | |
| #!/usr/bin/zsh -x | |
| # -x prints, -e exits on failure | |
| export EXTRA_ARGS=${EXTRA_ARGS:-} | |
| source ./.venv/bin/activate | |
| python scripts/train.py {{METHOD}} $EXTRA_ARGS | |
| # Imports | |
| import 'foo/bar.just' |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.