Arduino Uno & ESP8266

I am starting a project with an Uno & an ESP8266.
The issue I am having is I can get the ESP8266 to respond to commands I type in the serial monitor if I only load the basic sketch. However, when I issue the commands programatically, I get no response.

With only the basic sketch loaded
baud - 115200
both NL & CR selected

If I type AT
response: OK
If I type AT+RST
response: alot more data ending with ready

When I load the following sketch, I do not get any response in the window

  char cmd = {"AT"};
  #define cc  "AT"
void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial.setTimeout(5000);
   
}

void loop() {
  // put your main code here, to run repeatedly:
Serial.print("AT");
Serial.println();
delay(1000);
Serial.println("AT+RST");
delay(1000);
Serial.println(cc);
delay(1000);
}

I have the uno connected as follows:
UNO ESP8266
gnd - gnd
3.3 - vcc
3.3 - enable
rx - rx
tx - tx

Does anyone know whey there would be no response when the commands are given in the sketch rather than manually?

void setup() {
  Serial.begin(115200);
  Serial.setTimeout(5000);
}

void loop() {
  // put your main code here, to run repeatedly:
  SendCommand("AT");
}

void SendCommand(char * Commandbuf){
  strcat_P(Commandbuf,"\x0d\x0a");
  Serial.print(Commandbuf);
  Commandbuf[0] = '\0';
}

you are not terminating the serial output correctly
Try this function in you code
Z

Which ESP8266 ?
Not all breakouts are 5volt tolerant on the pins (RX) and require an external level shifter in between it and the Uno.

[color=red]rx - rx
tx - tx[/color]

That’s not good… the one who speaks needs to speak into the ear of the one who listens…
so Rx <-> Tx and Tx <-> Rx

Also indeed you need to shift voltage and ensure you provide adequate power to the ESP