Algebraic/Categorical motivation for the Chevalley Eilenberg Complex Is there a purely algebraic or categorical way to introduce the Chevalley-Eilenberg complex in the definition of Lie algebra cohomology?
In group cohomology, for example, the bar resolution of a group is equal to the chain complex associated to the nerve of the group when considered as a category; I wonder if something like this is also possible for the Chevalley-Eilenberg complex?
I know that the Chevalley-Eilenberg complex arises as the subcomplex of left-invariant differential forms on a Lie group, but apart from this geometric origin, its definition doesn't seem very natural to me, so it would be nice to have some algebraic or categorical construction as well.
 A: Both (Lie) group and Lie algebra cohomology are essentially part of a more general procedure. Namely, we take an abelian category $C$ with enough projectives or enough injectives, take a (say, left) exact functor $F$ from $C$ to abelian groups (or modules over a commutative ring) and compute the (right) derived functors of $F$  using projective or injective resolutions.
For example, if $\mathfrak{g}$ is a Lie algerba over a field $k$, we can take the category of $U(\mathfrak{g})$-modules as $C$ and $$M\mapsto\mathrm{Hom}_{\mathfrak{g}}(k,M)$$
as $F$ (here $k$ is a trivial $\mathfrak{g}$-module). Notice that this takes $M$ to the set of all elements annihilated by any element of $\mathfrak{g}$; this is not a $\mathfrak{g}$-module, only a $k$-module, so the target category is the category of $k$-vector spaces.
In the category of $U(\mathfrak{g})$-modules there are enough projectives and enough injectives, so in principle to compute the Exts from $k$ to $M$ we can use either an injective resolution of $M$ or a projective resolution of $k$ as $U(\mathfrak{g})$-modules. 
I've never seen anyone considering injective $U(\mathfrak{g})$-modules, probably because they are quite messy. So most of the time people go for the second option and construct a projective resolution of $k$.
One of the ways to choose such a resolution is the "standard" resolution with
$$C_q=U(\mathfrak{g}\otimes\Lambda^q(\mathfrak{g})$$ but any other resolution would do, e.g. the bar-resolution (which is "larger" then Chevalley-Eilenberg, but more general, it exists for arbitrary augmented algebras). Applying $\mathrm{Hom}_{\mathfrak{g}}(\bullet,M)$ to the standard resolution we get the Chevalley-Eilenberg complex.
All the above holds for group cohomology as well. We have to replace $U(\mathfrak{g})$ by the group ring (or algebra) of a group $G$. The only difference is that there is no analogue of the Chevalley-Eilenberg complex, so one has to use the bar resolution. Probably, Van Est cohomology of a topological group can also be described in this way.
A: Consider the universal enveloping algebra $U(\mathfrak g)$ of your Lie algebra $\mathfrak g$. Since it is a Hopf algebra, then you can construct a filtered simplicial cocommutative coalgebra $A_\bullet$: 


*

*$A_i=U(\mathfrak g)^{\otimes i}$

*face maps are given by applying the product

*degeneracy maps are given by applying the unit
The $E_1$ term of the associated spectral sequence is precisely the Chevalley-Eilenberg chain complex*. 
In other words, the Chevalley-Eilenberg complex of $\mathfrak g$ is a by-product of the Bar complex of $U(\mathfrak g)$. And the Bar complex of an augmented unital algebra $A$ arises as the chain complex associated to the simplicial set $Nerve(A)$ (where I view $A$ as a linear category  with one object). 


*

*this is another way of saying what Mariano Suárez-Alvarez says in his answer. 

A: Lie algebras are algebras over an operad, usually denoted $\mathscr{L}\mathit{ie}$. This is a quadratic operad, which happens to be Koszul. It therefore comes with a prefered cohomology theory (there is an analogue of Hochschild cohomology of algebras over a Koszul operad) which is defined in terms of a certain canonical complex —unsurprisingl called the Koszul complex. If you work out the details in this general construction, you obtain the Chevalley-Eilenberg resolution.
Alternatively, if $\mathfrak{g}$ is a Lie algebra, we can view $U(\mathfrak g)$, its enveloping algebra, as a PBW deformation of the symmetric algebra $S(\mathfrak g)$. The latter is just a polynomial ring, so we have a nice resolution for it, the Koszul complex, and there is a more or less canonical way of deforming that resolution so that it becomes a resolution for the PBW deformation. Again, working out the details rapidly shows that the deformed complex is the Chevalley-Eilenberg complex.
Finally (I haven't really checked this, but it should be true :) ) if you look at $U(\mathfrak g)$ as presented by picking a basis $B=\{X_i\}$ for $\mathbb g$ and dividing the free algebra it generates by the ideal generated by the relations $X_iX_j-X_jX_i-[X_i,X_j]$, as usual, you can construct the so called Annick resolution. Picking a sensible order for monomials in the free algebra (so that standard monomials are precisely the elements of the PBW basis of $U(\mathfrak g)$ constructed from some total ordering of $B$), this is the Chevalley-Eilenberg complex again.
These three procedures (which are of course closely interrelated!) construct the resolution you want as a special case of a general procedure. History, of course, goes in the other direction.
