Is there a way to end a questline?

completequest <QuestID> is your solution.

However, you have to know ids of quests so you can simply complete them with this command in order.

Alternatively, you could use setstage <quest id> <stage value> to finish all of the quest. However, you will need to figure out the Quest and Stage ID's to do this.

SetStage is recommended since CompleteQuest can cause bugs.