Can you please help me identify this plant.It has purple coloring in the base and little thorns.Look like an agave but can be something else.Thanks.
It's a bromeliad - possibly a Neoregelia
Bromeliads require specialized care...you'll need to do some research!
Main immediate need is keeping water in tank in center of leaf rosette at all times.
I think it may be Neoregelia 'Patricia'.
Here is a link that might be useful: Neoregelia 'Patricia'