diff --git a/api-reference/cli/init.mdx b/api-reference/cli/init.mdx index 7b68844a..d5d9bbd6 100644 --- a/api-reference/cli/init.mdx +++ b/api-reference/cli/init.mdx @@ -8,13 +8,19 @@ Create a new Pipecat project with guided setup for bot type, transport, AI servi **Usage:** ```shell -pipecat init [OPTIONS] +pipecat init [TARGET] [OPTIONS] ``` +**Arguments:** + + + Optional target directory. Use `.` to scaffold into the current directory without creating a `` subfolder (same convention as `npm create vite@latest .`). When provided, the project name defaults to the directory's basename unless overridden with `--name`. Omit this argument to create a `` subfolder (legacy behavior). + + **Options:** - Output directory where files will be saved. Defaults to current directory. + Output directory where files will be saved. Defaults to current directory. Creates a `` subfolder within this directory. Mutually exclusive with `TARGET`. @@ -145,6 +151,7 @@ pipecat init [OPTIONS] When run without `--name` or `--config`, the CLI guides you through selecting: +- **Project name** - Defaults to the target directory's basename if a `TARGET` was provided (e.g., `pc init .` uses the current directory name) - **Bot type and client framework** - Phone, web (Next.js, Vite, Vanilla JS), or mobile - **Transport provider** - Daily, Twilio, Telnyx, Plivo, Exotel - **Pipeline mode** - Cascade or Realtime @@ -166,6 +173,14 @@ All required fields must be specified or the command exits with a list of all mi pipecat init ``` +### Scaffold Into Current Directory + +```shell +# In-place mode: scaffolds into `.` without creating a subfolder +# Project name is derived from the directory name +pipecat init . +``` + ### Non-Interactive (Cascade) ```shell @@ -173,6 +188,15 @@ pipecat init --name my-bot --bot-type web --transport daily \ --mode cascade --stt deepgram_stt --llm openai_llm --tts cartesia_tts ``` +### In-Place With Custom Options + +```shell +# Combine in-place scaffolding with non-interactive flags +# Project name still derived from directory unless --name is provided +pipecat init . --bot-type web --transport daily \ + --mode cascade --stt deepgram_stt --llm openai_llm --tts cartesia_tts +``` + ### Non-Interactive (Realtime) ```shell @@ -282,6 +306,8 @@ pipecat init --output my-bot ## Generated Project Structure +When scaffolding with a project name (default behavior): + ``` mybot/ ├── server/ # Python bot server @@ -297,3 +323,21 @@ mybot/ ├── .gitignore └── README.md # Project setup instructions ``` + +When using in-place mode (`pc init .`), the files are created directly in the target directory without a project name subfolder: + +``` +./ +├── server/ # Python bot server +│ ├── bot.py # Main bot implementation +│ ├── pyproject.toml # Python dependencies +│ ├── .env.example # Environment variables template +│ ├── Dockerfile # Container image (if cloud enabled) +│ └── pcc-deploy.toml # Deployment config (if cloud enabled) +├── client/ # Web client (if generated) +│ ├── src/ +│ ├── package.json +│ └── ... +├── .gitignore +└── README.md # Project setup instructions +```