Given a coordinate list and a metric, this should work by using MMa Sum command.
Christoffel symbols from the standard formula
Γudd[aa_, bb_, cc_] := (1/2)*Sum[guu[[aa,dd]]*(D[gdd[[dd,cc]], clist[[bb]]] + D[gdd[[dd,bb]], clist[[cc]]] -
D[gdd[[bb,cc]], clist[[dd]]]), {dd, 1, Length[gdd]}]
∇[Au[[a]],clist[[b]]]. covariant derivative of a vector element A[[a]] wrt clist[[b]] from a standard formula.
covDu[A_, a_, b_] := D[A[[a]], clist[[b]]] + Sum[Γudd[a, b, c]*A[[c]], {c, 1, Length[gdd]}]
where gdd and guu are the covariant and contravariant metrics and clist is the coordinate list.
For example the Schwarzschild metric.
Coordinate list
clist = {t, r, θ, ϕ}
The metrics - g down down.
gdd = DiagonalMatrix[{-(1 - 2 m/r), 1 - 2 m/r, r^2, r^2 Sin[θ]^2}];
g up up
guu = Inverse[gdd] // Simplify;
We can look at the Christoffel symbols.
Table[Γudd[a, b, c], {a, Length[gdd]}, {b, Length[gdd]}, {c, Length[gdd]}]
(*{{{0, -(m/((2 m - r) r)), 0, 0}, {-(m/((2 m - r) r)), 0, 0, 0}, {0, 0,
0, 0}, {0, 0, 0, 0}}, {{-(m/((2 m - r) r)), 0, 0,
0}, {0, -(m/((2 m - r) r)), 0, 0}, {0, 0, r^2/(2 m - r), 0}, {0, 0,
0, (r^2 Sin[θ]^2)/(2 m - r)}}, {{0, 0, 0, 0}, {0, 0, 1/r,
0}, {0, 1/r, 0, 0}, {0, 0, 0, -Cos[θ] Sin[θ]}}, {{0,
0, 0, 0}, {0, 0, 0, 1/r}, {0, 0, 0, Cot[θ]}, {0, 1/r,
Cot[θ], 0}}}*)
Example vector
A = {t, r , Cos[θ], Sin[ϕ]}
and a table of the covariant derivative components.
Table[covDu[A, a, b], {a, Length[gdd]}, {b, Length[gdd]}] // Simplify
(*{{1 - m/(2 m - r), -((m t)/(2 m r - r^2)), 0,
0}, {-((m t)/(2 m r - r^2)), 1 - m/(2 m - r), (r^2 Cos[θ])/(
2 m - r), (r^2 Sin[θ]^2 Sin[ϕ])/(2 m - r)}, {0,
Cos[θ]/r,
1 - Sin[θ], -Cos[θ] Sin[θ] Sin[ϕ]}, {0,
Sin[ϕ]/r, Cot[θ] Sin[ϕ],
Cos[ϕ] + Cos[θ] Cot[θ] + 1}}*)
It should work for any dimension. The user inputs are the coordinate list, the metric and the object vector to differentiate.