Installation
You’ll need npm installed to use the CLI.We recommend running commands with
npx
instead of installing globally.
Commands
login
init
--agent <agent_id>
: (optional) Link an existing agent.
If not provided, a new agent will be created.
tunnel
agent-id=<value>
Specify the unique identifier of the agent. If no agent-id is provided, it will look for an env variable ending withLAYERCODE_AGENT_ID
from the .env file. If also not found, command will fail.path=<value>
[default: /api/agent] Set the API path to append for the agent endpoint.port=<value>
[default: 3000] Port number to run the tunnel on.tail
Continuously stream logs, including CLI messages
Example Usage
Troubleshooting
If you encounter issues:- Ensure npm and Node.js are installed and up-to-date.
- Try logging out and back in with
npx @layercode/cli login
. - By default, your tunnel will set your webhook url path as /api/agent. You should update this with the —path flag based on where your webhook endpoint is inside your application e.g. ‘/api/agent’ or at the root ’/’ or ‘/voice-agent’. See our guide on webhooks for more details