Captain's Oath

The Captain's Oath was an oath for Starfleet captains, they took when assuming the command of a starship, that outlined the mission and objectives of the given ship in the United Federation of Planets and the core values Starfleet stood for. 

History
Some of the words in the Captain's Oath were based on the historic speech given by Zefram Cochrane at the dedication ceremony of the Warp Five Complex in 2119. A recording of this speech was broadcasted, when the was launched in 2151. In his speech Cochrane said: "Imagine it. Thousands of inhabited planets at our fingertips. And we'll be able to explore those strange new worlds and seek out new life and new civilizations. This engine will let us go boldly where no man has gone before."

In 2258 in the alternate reality, Captain was asked to recite the Captain's Oath by  before assuming command of the USS Enterprise (alternate reality). At the time he didn't appreciate the meaning of the words in the oath. Almost two years later, at the ship's rechristening ceremony, Kirk recited the oath again. At that time, he felt that the oath was a call for the Federation to remember who they had once been, and who they must become again.

For the mission, the Enterprise was about to embark on, the Captain's Oath was: "Space: the final frontier. These are the voyages of the starship Enterprise. Her five-year mission: to explore strange new worlds. To seek out new life and new civilizations. To boldly go where no one has gone before."

The final words of the oath have been inscribed to the dedication plaques of most starships named Enterprise that have served, among other duties, as ships of exploration for the United Earth and the Federation. (Star Trek: Enterprise; Star Trek: The Next Generation; Star Trek films set artwork)

The oath Starfleet captains made also implicitly meant they were required to sacrifice their own life and the lives of their crew rather than violate the Prime Directive. In 2369, Captain Jean-Luc Picard said, he refused to mass murder the Borg species, because of the oath he had taken to uphold certain values. In 2376, Captain Kathryn Janeway reminded Captain Rudolph Ransom of the oath he had taken "to seek out life, not destroy it," when it was discovered he was responsible for murdering several nucleogenic lifeforms. 

Background information
The Captain's Oath in Star Trek Into Darkness was a revised version of the well known monologue by William Shatner's James T. Kirk from the title sequence of Star Trek: The Original Series. However, Kirk's recital of the oath in the film marks the first time that it appears as part of dialogue and not as a voice-over speech, only spoken to the audience.

Apocrypha
In Star Trek After Darkness, Part 1, Kirk was interrupted as he was reciting the Oath again to his Captain's log. called the Oath a beautiful ode to the Captain's job. Kirk thought it was important and good for the soul to reflect on why they were out there in deep space.