Parshas Yisro · Passuk 20:10
Chabad.org — English translation + Rashi
Torah Temimah points to Mechilta on the ger within the gates.
Sefaria — Exodus 20:10
Sefaria — Mechilta
English: “And your stranger who is within your gates” — this is the ger toshav, who has accepted upon himself not to worship idolatry and who dwells within the gates of Israel.
On the daf / in context: The verse includes the resident alien who has renounced idolatry in the Shabbos rest obligation of the household.
Category B — Textual / lexical / linguistic method
Method — The derashah identifies “your stranger who is within your gates” as the ger toshav, thereby extending the Shabbos prohibition to a non-Jew who lives under Jewish jurisdiction and has accepted certain basic obligations.
Textual trigger — וְגֵרְךָ אֲשֶׁר בִּשְׁעָרֶיךָ.
The ger toshav who dwells within the gates of Israel is included in the Shabbos work prohibition.