I wanted to say something more about the connection with Hosea 2:20-24 and the curious motif of "Heavens and Earth" being described in animated or anthropomorphic terms, just as in the Ugaritic texts. Thus in v. 21, Yahweh says "I will respond to the heavens (hsmym) and they will respond to the earth (h'rts), and the earth will respond to the grain, etc." This may be compared with KTU 1.1 III 14, 1.3 III 24, IV 16 referring to the "conversings of the Heavens (smm) to the Earth ('rts)", which is also linked through parallelism to the conversing of the "Deeps (thmt) to the Stars (kbkbm)". In Psalm 148:3-7, we similarly read of "all the stars of light (kl-kwkby 'wr)", "the highest heavens (smy hsmym)", "the waters beneath the heavens (hmym 'sr m'l hsmym)", and "all the Deeps (kl-thmt)" that praise Yahweh. The theme is also the same: the proclamations of nature (e.g. fertility) herald the divine king's reign of peace. Another parallel is Psalm 19:1-4 which says "the heavens are telling the glory of God ... their voice is not heard".
All of this could simply be treated as animating or anthropomorphic language, but then there are other texts like Isaiah 1:2 which invokes the Heavens and Earth to act as witnesses against Israel for breaking the covenant with Yahweh: "Hear, O Heavens, listen O Earth, for Yahweh has spoken: 'I reared children and brought them up, but they have rebelled against me". The prophet Micah makes a similar appeal, this time to the "Mountains and Hills": "Stand up, plead your case before the mountains; let the hills hear what you have to say. Hear, O Mountains, Yahweh's accusation, listen, you everlasting foundations of the earth. For Yahweh has a case against his people, he is lodging a charge against Israel" (Micah 6:1-2). A third example may be found in Jeremiah 2:12: "Be appalled at this, O Heavens, and shudder with great horror, Yahweh declares". There are many further examples in Deuteronomy:
"I call Heaven and Earth as witnesses against you this day that you will quickly perish from the land that you are crossing the Jordan to possess. You will not live there long but will certainly be destroyed" (Deuteronomy 4:46).
"This day I call Heaven and Earth as witnesses against you that I have set before you life and death, blessings and curses. Now choose life, so that you and your children may live" (30:19)
"Assemble before me all the elders of your tribes and all your officials, so that I can speak these words in their hearing and call Heaven and Earth to testify against them" (31:28).
These covenant judicial formulae strongly resemble similar invocations of divine witnesses in Hittite and Hurrian treaties and lawsuits. These divine witnesses include not just the usual members of the pantheon but especially the "olden gods", which include mountains and the heavens. In the treaty between Shuppiluliuma and Aziru, we read:
"Behold, I have summoned the Thousand Gods to assembly for this oath and I have called them to witness. Let them be witnesses! ... Mount Lablana, Mount Shariyana, Mount Pishaisha, the luahhi gods, ... all the olden gods: Nara, Namshara, Minki, Tuhashi, Ammunki, Ammizzadu, Alalu, Antu, Anu, Apantu, Enlil, Ninlil, Mountains and Rivers, Springs and the Great Sea, Heaven and Earth, Winds and Clouds. Let them be witnesses to this treaty and to the oath!" (COS 2.17A iv 30-32, A. rev. 1'-11')
The treaty of Tudhalya IV with Kurunta of Tarhuntassa similarly summons "Heaven and Earth, the Great Sea, the Mountains, the Rivers and Springs of the land of Hatti and of the land of Tarhuntassa," and declares that "if anyone alters even a single word of this tablet, may these oath-deities destroy him" (COS 2.18: 25). These primordial deities can both curse and bless. We may also compare Genesis 49:24-26:
"El your father, who helps you
Shadday who blesses you
The blessings of Heavens (smym), from above,
The blessings of the Deep (thwm), crouching below,
The blessings of Breasts-and-Womb,
The blessings of your Father, Hero, and Almighty,
The blessings of the Everlasting Mountains (hwry 'd-t'wt),
The delight of the Everlasting Hills (gb't 'wlm)" (Genesis 49:24-26).
The Hittite treaties suggest that the nature deities and "Heaven and Earth" belong to the primordial, or "olden gods", e.g. the first generation of gods that preceded the current generation. Note especially how Sumerian and Hurrian gods Alalu, Anu, Antu, Enlil, Ninlil are included. Alalu was an early god of heaven from Hurrian mythology who was replaced by Anu. Anu or An was the early god of heaven, father of gods and especially the creator god Enlil (= Ellil, syncretised with El in the Levant), and belonged to the first age of the gods. Anu's name meant "heaven" in Sumerian and was often synonymous with heaven itself. An's first consort was Antu, who begat the Annunaki, the chthonic gods. Then An "Heaven" married Ki "Earth" and together they begat Enlil. Enlil, on the other hand, was identified with the mountains and called shadu rabu "big mountain" (equivalent of Imhursag), and thus was "lord of the winds" as his name signifies. In the Akkadian Enuma Elish, Tiamat and Apsu were also primordial gods of the Deeps (cf. Hebrew thwmt), later used by Marduk (=Enlil) to construct the physical heavens and earth.
Hesiod's Theogony relates the backstory of the first generation of gods (e.g. the Titans) which derives from Hittite and/or Phoenician mythology. Hesiod relates the primeval marriage between Ouranos (< ? ur. ANU "foundation of Anu"; Latin Uranus), "Heaven", and Gaia "Earth". Gaia was actually the asexual mother of Ouranos "Heaven", and she also gave birth to Mountains and Pontos "Seas". Then with Ouranos, Gaia gave birth to Okeanos "Oceans", Kronos (equivalent to El in Phoenician mythology), and the other Titans. These olden gods were then consigned to Tartarus, becoming chthnonic deities. Now, when we look at the Ugaritic pantheon, we find these other gods listed as well: Arts-w-Smm "Earth and Heaven", Grm-w-'mqt "Mountains and Valleys", Ym "Sea", and other primordial gods (KTU 1.47, 1.118). This suggests that the Greek gods of Gaia and Ouranos correspond to the West Semitic gods Arts and Shamem (=An). Philo of Byblos gives some other tantalizing details about the mythology of Shamem in Phoenicia. First, we find that out of primeval chaos was produced Mot (later a chthonic god of the underworld) and the Zophasemin "Watchers of Heaven" (cf. the "Watchers" or angels of Daniel and 1 Enoch, Jubilees). The primeval wind Colpias (cf. the "Winds and Clouds" of the Hittite treaty) and his wife Baau (cf. bhw "chaos" in Genesis 1:2, over which God's rwch "wind" was blowing) were also produced from the chaos. Elioun (=Elyon) and his wife Beruth (=brwt "covenant", cf. Beirut), the parents of the old gods, then gave birth to Ouranos (=Shamem) who married his sister Ge (=Arts). This is a little similar to Hesiod who has Ouranos marrying his own mother. Then Elioun died in an encounter with a monster and Ouranos became king of the gods. Ouranos/Shamem then fathered "Elus (i.e. El) who is also Kronos", Baetylus (e.g. the Phoenician god Bethel), and Dagon "who is also Sidon". Thus El and Dagan (the father of Baal-Hadad in Ugaritic mythology) were brothers. Then El fought a war against Shamem and drove him from his kingship. This war might be analoguous to the war of the Titans in Hesiod. During the war, El took the pregnant concubine of Shamem and gave her to Dagon to become his wife. Then she gave birth to Demaros (= dmrn, an epithet of Baal in the Ugaritic Baal Epic), who was raised by Dagan as his own son tho he was begotten by Shamem. This is reminiscent of Baal being called "son of Dagan" in Ugaritic texts, but who was also recognized by El as his son as well. The other gods who threw their support behind El were called the Eloim (cf. 'lhym, "gods"), but the imprisoned Shamem tried to avenge El by sending his daughters Astarte (= Ugaritic Athtart) and Asherah (= Rhea and Dione) to secretly kill El. But El captured them and although they were his sisters, he married both Astarte and Asherah. In the Ugaritic myth, Asherah is the wife of El and Astarte is the wife of Baal (formerly, the consort of Athtar). Then Dagon discovered corn and agriculture, and Demaros (= Baal) and Pontos (= Yamm, the Sea) fight with Demaros put into flight, and then El captured his father Shamem and put him to death. His blood flowed into the fountations and rivers. Finally, Astarte (=Athtart) and Zeus Demaros, also Adodos (=Hadad) "reigned over the country with the consent of Kronos (= El)," which is just the situation we find in the Baal Epic (PE, 1.10.1-35).
With this backdrop, we then find the depotenized Earth and Heaven, Mountains, Seas, etc. appearing in Hittite, Ugaritic, and later OT texts, as entities that can bless or curse and who can testify and serve as witnesses in legal contexts, but who are also specifically identified in Hittite legal texts (which strongly resemble passages in the OT) as the primordial "olden gods".