if I run an agent in console mode, is there a way ...
# ask-ai
n
if I run an agent in console mode, is there a way to hard code the room name instead of having it use mock_room?
t
Thanks for reaching out, rohit. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Regarding running an agent in console mode and hard-coding the room name: yes — use the
--room
flag to specify the room name instead of
mock_room
. Example:
Copy code
uv run agent.py console --room my_custom_room_name
Would you like the exact command for your agent file or help making that room name fixed inside the code? Sources: Voice AI quickstart | LiveKit docs
n
Usage: agent.py console [OPTIONS] Try 'agent.py console *--help*' for help. ╭─ Error ───────────────────────────────────────────────────────────────────────────────────────────────╮ │ No such option: --room │ ╰────────────────────────────
t
Thanks — I’m responding to your error about
No such option: --room
when trying to pass a room name to
agent.py console
. The CLI’s
console
command does not accept
--room
. To hard-code a room name in console mode, set it in your agent code (or via an env var your code reads). Example pattern you can add to your agent entrypoint:
Copy code
# set the room name programmatically before starting console mode
ROOM_NAME = "my_custom_room"

@server.cli_runner()
def main():
    server.run(console=True, room_name=ROOM_NAME)
Or, if your agent initializes a session directly, pass the room name where the session/connection is created:
Copy code
session = AgentSession(room_name="my_custom_room", ...)
session.start(console=True)
If you prefer not to change code, another option is to modify the agent to read an environment variable and set
ROOM_NAME = os.getenv("ROOM_NAME", "mock_room")
, then start the process with that env var. Which approach would you like help implementing (code edit, env var, or locating the exact place in your agent to set
room_name
)? Sources: Voice AI quickstart | LiveKit docs