Is there api or cli to create new projct?
# ask-ai
c
Is there api or cli to create new projct?
t
Thanks for reaching out, Redususantha. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'd be happy to help you create a new project using the LiveKit CLI! You can use the command
lk project add
to add a new project to your local CLI configuration. Here’s a simple example to guide you:
Copy code
lk project add my-project \
--url <http://localhost:7880> \
--api-key <my-api-key> \
--api-secret <my-api-secret> \
--default
With this command, you’ll need to provide the project name, LiveKit server URL, API key, and API secret. If you want, you can also set this project as your default by including the
--default
flag. Don’t worry if you miss any required fields—the CLI will kindly prompt you to fill them in interactively. If you’re working with LiveKit Cloud projects, there’s a handy command:
lk cloud auth
. It takes care of creating a project configuration for you right after you authenticate through your browser. At the moment, there isn’t a dedicated API endpoint for programmatically creating projects, but I’m here to help if you have any other questions or need further guidance! Sources: LiveKit CLI project management | LiveKit Docs | Docs::Home | cmd/lk/utils.go | README.md
c
Do we have api to do it? As I need to programatically create the project
t
Thanks for reaching out! Right now, there isn’t an API specifically documented for programmatically creating a project in LiveKit. Projects are typically created manually through the LiveKit Cloud dashboard. Once you have your project set up, you can easily manage it using the CLI with commands like
lk project add
to configure it locally. If automating project creation is really important for your workflow, it might be worth exploring some alternative approaches or checking in with LiveKit Cloud directly to see if there’s an API that’s not publicly documented yet. Please feel free to reach out if you have any more questions or need a hand with anything else—I’m here to help! Sources: Mini tutorial: setting up a LiveKit Cloud project | README.md | Docs::Home | Docs::Home | Example Applications | livekit/livekit_composite | DeepWiki
c
how to connct with deployed agnt
t
I'd be happy to guide you through connecting with a deployed agent in LiveKit! Here’s a simple step-by-step to help you along: 1. Development and Testing: Start by running your agent in development mode using the CLI: `uv run agent.py dev`This will connect your agent to LiveKit for testing purposes. Feel free to use the Agents Playground or a custom frontend to interact with your agent and see how it performs. 2. Production Deployment: When you’re ready for production, deploy your agent to LiveKit Cloud with these commands: `lk cloud auth lk agent create`This will register and deploy your agent smoothly. After that, you can connect through the Agents Playground, your own custom frontend, or even telephony integration. 3. Agent Connection Logic: In your agent’s code, make sure to use the
connect()
method to join the room: `await ctx.connect(auto_subscribe=AutoSubscribe.SUBSCRIBE_ALL)`This step is key for your agent to interact with participants seamlessly. 4. Troubleshooting: If you run into any issues, you can monitor your agent’s status and logs using the CLI: `lk agent status lk agent logs --log-type=deploy`Also, consider implementing timeouts and keeping an eye on connection events in your frontend to handle any hiccups gracefully. If you’d like me to walk you through any of these steps in more detail or if you have any questions, just let me know—I’m here to help! Sources: Agent deployment CLI reference | LiveKit Docs | lib/controllers/app_ctrl.dart | Vision Agent Quickstart | LiveKit Docs | Deploying to production | LiveKit Docs | python-agent-example-app/main.py
c
how to connect twilio to already deployed agent?
t
I'm glad you're looking to connect Twilio to your already deployed agent in LiveKit! Let's walk through the steps together to make sure everything goes smoothly: 1. Set Up Twilio SIP Trunk: Start by configuring Twilio to forward incoming calls to your LiveKit SIP endpoint using Elastic SIP Trunking. You'll want to create a SIP trunk, set the origination URL to your LiveKit SIP URI, and link your Twilio phone number to this trunk. 2. Configure Twilio SIP Credentials: Next, create a credential list in Twilio with a username and password, then associate it with your SIP trunk for authentication. Just double-check that these credentials match what you've set up in your LiveKit inbound trunk configuration. 3. Set Up LiveKit Inbound Trunk: Now, create an inbound trunk in LiveKit to accept calls from Twilio. You can use the CLI to define the trunk and make sure the SIP credentials align perfectly. 4. Create a Dispatch Rule: This step helps route incoming calls to specific rooms. For instance, you might route calls to rooms with a prefix like
call-
. This keeps things organized and efficient. 5. Configure the Agent: Make sure your agent is ready to automatically join rooms created by incoming calls. Using the
RoomDispatcher
in your agent code will help listen for new rooms and connect whenever a room matches your dispatch rule. 6. Testing: Finally, start your agent, place a call to your Twilio phone number, and check that the call routes to a LiveKit room with your agent joining automatically. This confirms everything is set up just right! If at any point you'd like some detailed code examples or need a hand with any specific step, please don't hesitate to ask. I'm here to help you every step of the way! Sources: Create and configure a Twilio SIP trunk | LiveKit Docs | .env.example | Inbound calls with Twilio Voice | LiveKit Docs