Why does Nephi believe he can keep all the commandments? I can't get the wording exactly right on this question, and it's gonna take some explaining.
Nephi says this about the Lord's commandment to get the brass plates,


  "for I know that the Lord giveth no commandments unto the children of men, save he shall prepare a way for them that they may accomplish the thing which he commandeth them." (1 Nephi 3:7)


Later, when trying to keep the commandment to get the brass plates, he and his brothers failed twice, but he said,


  "As the Lord liveth, and as we live, we will not go down unto our father in the wilderness until we have accomplished the thing which the Lord hath commanded us. Wherefore, let us be faithful in keeping the commandments of the Lord;" (1 Nephi 3:15-16)


Later he says,


  "And it came to pass that thus far I and my father had kept the commandments wherewith the Lord had commanded us." (1 Nephi 5:20)


His last words in the Book of Mormon are,


  "For what I seal on earth, shall be brought against you at the judgment bar; for thus hath the Lord commanded me, and I must obey. Amen."


It seems clear to me that every commandment can be obeyed. But it's very hard, especially to obey constantly. I'd like to know why was he able to do it? I believe at the root of that is the question: Why did he believe he could do it rather than believing he would eventually fail? The obvious answer is that it isn't his own strength, but the grace of God that makes this possible, but what makes the enabling power of the Atonement available constantly rather than "every so often"? I'm not sure how to believe that obeying the commandments is really truly all the time possible, and I think I'm misunderstanding the doctrine of grace.
Nephi was not perfect in keeping the commandments. In fact, in 2 Nephi 4 he cries out:

17 Nevertheless, notwithstanding the great goodness of the Lord, in showing me his great and marvelous works, my heart exclaimeth: O wretched man that I am! Yea, my heart sorroweth because of my flesh; my soul grieveth because of mine iniquities.
18 I am encompassed about, because of the temptations and the sins which do so easily beset me.
19 And when I desire to rejoice, my heart groaneth because of my sins; nevertheless, I know in whom I have trusted.

(Emphasis added.) What follows is the beautiful Psalm of Nephi (2 Nephi 4:17-35) in which Nephi praises the Lord for his goodness and mercy and affirms his commitment to follow the Savior. Every commandment can be obeyed, but we fail again and again to keep all the commandments all the time. Yet, we can be perfected through the grace of Christ and his atonement as Moroni states in Moroni 10:

32 Yea, come unto Christ, and be perfected in him, and deny yourselves of all ungodliness; and if ye shall deny yourselves of all ungodliness, and love God with all your might, mind and strength, then is his grace sufficient for you, that by his grace ye may be perfect in Christ; and if by the grace of God ye are perfect in Christ, ye can in nowise deny the power of God.
33 And again, if ye by the grace of God are perfect in Christ, and deny not his power, then are ye sanctified in Christ by the grace of God, through the shedding of the blood of Christ, which is in the covenant of the Father unto the remission of your sins, that ye become holy, without spot.

(Emphasis added.) It is evident from the scriptures, that all have sinned, and come short of the glory of God (Romans 3:23). It is natural for men, to fail keeping the commandments (Mosiah 3:19), and God does not expect us to keep all commandments all the time perfectly. Jesus has done that work for us. What he asks us to do, is to do the best to keep his commandments and repent whenever we fail. Patience and perseverance in trying to do your best are much more important than beating oneself up over every little thing you do wrong (see Alma 42:29; 2 Cor 7:10). Yet we have the promise that

God is faithful, who will not suffer you to be tempted above that ye are able; but will with the temptation also make a way to escape, that ye may be able to bear it. (1 Cor 10:13)

(See also Alma 13:28.) Hence, we can overcome every sin through God's grace. All he asks us is to try the best we can and whenever we fail, to try again and continue. There's an excellent talk at BYU by Brad Wilcox about the topic of grace which explains this really well.