# 2. KSQL Command Line

After docker-compose up

#### Refer <https://github.com/saubury/stream-smarts> to start KSQL Server/CLI

#### Go inside the project where docker-compose.yml is located.

docker-compose exec ksqldb-cli ksql "[http://ksqldb-server:8088](http://ksql-server:8088)"

<https://docs.ksqldb.io/en/latest/operate-and-deploy/installation/installing/>

![](/files/-MDYkHAsszhiODmGaQd9)

![](/files/-MDYkO5mqnHV6rw7_h2S)

![](/files/-MDYkm87qFGS9zTxtSnX)

![](/files/-MDYl1Jv7Tg8ZRDHGS1r)

![](/files/-MDYl9fEGukY3n_8f15O)

KSQL only shows us the latest data //////So we can need to start producer in one terminal & KSQL client on another terminal , then we can test the lastes feed to data.

But what if we can want to see the data that already persisted in topic . We need to use beginning in PRINT statement shown below :

![](/files/-MDYlqd9WyxdxNenr-fj)

KSQL terminated after receiving two records shown below :

![](/files/-MDYm1eMTFOkBan0UG-u)

![](/files/-MDYmRCv7khUm0Rgi9-W)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://architectures.gitbook.io/project/apahce-kafka/ksql-on-ksqldb-for-stream-processing/ksql-setup/2.-ksql-command-line.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
