You need bitcoind.
It will give you all supported commands.
To get private key you need use command:
bitcoind dumpprivkey 1YourAddressYouWantToDump
If wallet is encrypted you need
bitcoind walletpassphrase YourWalletPassword 60
to unlock it for 60seconds.
To import address to another wallet you need use
bitcoind importprivkey PrivKeyYouHaveDumpedEarlier LabelForThisAddress
Importing new key takes some time (even few mins, depends on machine), because bitcoin is scanning entire blockchain to determine current address balance.