1. Define the "commandments of God" and the Commandments that Christ was referring to.
In the NT letters, there are many admonishments against various kinds of sins, which are in effect Christ’s “Thou shalt not …” commandments. Here are a few examples:
“For this cause
God delivered them up to shameful affections. For their women have changed the natural use into that use which is against nature. And, in like manner, the men also, leaving the natural use of the women, have burned in their lusts one towards another, men with men working that which is filthy, and receiving in themselves the recompense which was due to their error. And as they liked not to have God in their knowledge, God delivered them up to a reprobate sense, to do those things which are not convenient; Being filled with all iniquity, malice, fornication, avarice, wickedness, full of envy, murder, contention, deceit, malignity, whisperers, Detractors, hateful to God, contumelious, proud, haughty, inventors of evil things, disobedient to parents, Foolish, dissolute, without affection, without fidelity, without mercy. Who, having known the justice of God, did not understand that they who do such things, are worthy of death; and not only they that do them, but they also that consent to them that do them” (Romans 1:29-31);
“Now the works of the flesh are plain: immorality, impurity, licentiousness, idolatry, sorcery, enmity, strife, jealousy, anger, selfishness, dissension, party spirit, envy, drunkenness, carousing and the like. I warn you, as I warned you before, that those who do such things shall not inherit the kingdom of God.” (Galatians 5:19-21);
”Do you not know that the unrighteous will not inherit the kingdom of God? Do not be deceived; neither the immoral, nor idolaters, nor adulterers, nor homosexuals, nor thieves, nor the greedy, nor drunkards, nor revilers, nor robber will inherit the kingdom of God. And such were some of you. But you were washed, you were sanctified, you were justified in the name of the Lord Jesus Christ and in the Spirit of our God” (1Cor 6:9-11).
Avoiding the sins mentioned in the NT are included in what Jesus means by “my commandments” in John 14:15, “my word(s)” in John 14:23-24) and “His commandments” in 1John 2:3-6. Furthermore, there is Christ direct commandment: “This is my commandment, that you love one another, as I have loved you” (John 15:12). From this commandment come many commandments, as explained by Paul in Romans 13:8-10.
When the rich man asks Jesus, “’Good Teacher, what shall I do to inherit eternal life?’” (Luke 18:18-22), Jesus quotes some of the Ten Commandments. So these are Christ’s commandments as well.
I will argue that the Paul was talking about the works of the Law, that was not required
Paul argues that works alone don’t save - he doesn’t argue that works are irrelevant to salvation. In fact, Paul warns believers in Gal 5 that their sins - ie, disobeying Christ’s commandments (aka “works”) - can lead them to Hell. Furthermore, as can be seen from Romans 13:8-10 and Gal 5, Paul argues that the moral laws of Moses still apply to Christians - the moral laws of Moses (regarding sexual immorality and love of God and neighbour) and are in fact eternal.
James was presenting the need to applying Christian works as helping one another.
The “need to”? Are you saying works are needed for salvation? If so, I agree - James (like Paul) argues that salvation requires not just faith, but also keeping Christ’s commandments.
James says “a man is justified by works and not by faith alone” and “faith without works is dead” (James 2:24-26) - what he means by “works” is keeping Christ’s commandments.