UWaterlooRFRChatBot / docs /04_terminal_command_cheatsheet.md
Anna Zhou
Add team handoff documentation
c8016f6
|
Raw History Blame Contribute Delete
3.27 kB

A newer version of the Streamlit SDK is available: 1.67.0

Upgrade

04 - Terminal Command Cheatsheet

This file lists common commands in the order a team member is most likely to use them.

Start Work

cd UWaterlooManagedRetreatChatbot
source venv/bin/activate
git status
git pull origin main
git checkout -b your-branch-name

Run the Website

streamlit run app/app.py

Check Python Syntax

python3 -m py_compile app/app.py
python3 -m py_compile rag/pipeline.py
python3 -m py_compile rag/retriever.py

Rebuild All Ingested Case Data

Use this after changing many pipeline outputs:

python3 ingest/ingest_pipeline_outputs.py
python3 ingest/create_summary_chunks.py
python3 ingest/embed_and_index.py

Rebuild One Case

Replace CS124 with the case ID:

python3 ingest/ingest_pipeline_outputs.py --case-id CS124
python3 ingest/create_summary_chunks.py
python3 ingest/embed_and_index.py

Run One New Case Through the Pipeline

python3 -m case_study_pipeline.run_case_study \
  --case-folder data/raw/CS124 \
  --case-id CS124 \
  --llm-provider claude \
  --max-chars-per-source 150000 \
  --force

Then:

python3 -m case_study_pipeline.select_best_run --case-id CS124
python3 ingest/ingest_pipeline_outputs.py --case-id CS124
python3 ingest/create_summary_chunks.py
python3 ingest/embed_and_index.py

Download Papers from a Registered Case Drive Folder

This uses case_study_pipeline/drive_folders.json.

python3 -m case_study_pipeline.download_drive_papers --case-id CS124

Sort a Downloaded PDF into a Case Folder

python3 -m case_study_pipeline.sort_inbox --list

Then:

python3 -m case_study_pipeline.sort_inbox \
  --filename "Downloaded Paper.pdf" \
  --case-id CS124 \
  --rename "Author_Year_Short_Title.pdf"

Upload the Current Code to Hugging Face

Preferred if your Hugging Face remote exists:

git push uwrfr-chatbot HEAD:main

If the remote does not exist:

git remote add uwrfr-chatbot https://huggingface.co/spaces/UWRFR/UWaterlooRFRChatBot
git push uwrfr-chatbot HEAD:main

Alternative using the Hugging Face CLI:

hf upload UWRFR/UWaterlooRFRChatBot . \
  --type space \
  --exclude ".git/*" \
  --exclude ".github/*" \
  --exclude ".venv/*" \
  --exclude "venv/*" \
  --exclude "__pycache__/*" \
  --exclude "data/raw/*" \
  --exclude "*.pdf" \
  --commit-message "Update website"

Push to Shared GitHub

git push shared-github HEAD:main

If the remote does not exist:

git remote add shared-github https://github.com/rfrraguwaterloo-cmyk/UWaterlooManagedRetreatChatbot.git
git push shared-github HEAD:main

Check Hugging Face Space Status

hf spaces info UWRFR/UWaterlooRFRChatBot

Look for:

  • sha - deployed commit.
  • runtime.stage - whether it is running, building, or failed.
  • host - public app URL.

See Recent Git History

git log --oneline -10

See What Changed

git status
git diff --stat

Undo an Uncommitted Edit to One File

Only do this if you are sure you do not want your local changes to that file:

git restore path/to/file.py

Do not use broad destructive commands like git reset --hard unless the team explicitly agrees.