Skip to content

Instantly share code, notes, and snippets.

@wassname
Last active January 3, 2026 11:22
Show Gist options
  • Select an option

  • Save wassname/00539244455041b3a1a6d5081163217f to your computer and use it in GitHub Desktop.

Select an option

Save wassname/00539244455041b3a1a6d5081163217f to your computer and use it in GitHub Desktop.
justfile cheatsheet
# 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'
@wassname
Copy link
Author

wassname commented Mar 15, 2024

@wassname
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment