| 1 | # Onboarding |
| 2 | |
| 3 | When a user first runs `cn` in interactive mode, they will be taken through "onboarding". After they have completed onboarding once, they will follow a normal config loading flow. |
| 4 | |
| 5 | ## Onboarding flow |
| 6 | |
| 7 | **The onboarding flow runs when the user hasn't completed onboarding before, regardless of whether they have a valid config.yaml file.** |
| 8 | |
| 9 | 1. If the --config flag is provided, load this config |
| 10 | 2. If the CONTINUE_USE_BEDROCK environment variable is set to "1", automatically use AWS Bedrock configuration and skip interactive prompts |
| 11 | 3. Present the user with available options: |
| 12 | |
| 13 | - Log in with Continue: log them in, which will automatically create their assistant and then we can load the first assistant from the first org |
| 14 | - Enter your Anthropic API key: let them enter the key, and then either create a ~/.continue/config.yaml with the following contents OR update the existing config.yaml to add the model |
| 15 | |
| 16 | ```yaml |
| 17 | name: Local Config |
| 18 | version: 1.0.0 |
| 19 | schema: v1 |
| 20 | |
| 21 | models: |
| 22 | - uses: anthropic/claude-4-sonnet |
| 23 | with: |
| 24 | ANTHROPIC_API_KEY: <THEIR_ANTHROPIC_API_KEY> |
| 25 | ``` |
| 26 | |
| 27 | When CONTINUE_USE_BEDROCK=1 is detected, it will use AWS Bedrock configuration. The user must have AWS credentials configured through the standard AWS credential chain (AWS CLI, environment variables, IAM roles, etc.). |
| 28 | |
| 29 | When something in the onboarding flow is done automatically, we should tell the user what happened. For example, when CONTINUE_USE_BEDROCK=1 is detected, the CLI displays: "✓ Using AWS Bedrock (CONTINUE_USE_BEDROCK detected)" |
| 30 | |
| 31 | ### AWS Bedrock Environment Variable |
| 32 | |
| 33 | Users can bypass the interactive onboarding menu by setting the `CONTINUE_USE_BEDROCK` environment variable to "1": |
| 34 | |
| 35 | ```bash |
| 36 | export CONTINUE_USE_BEDROCK=1 |
| 37 | cn <command> |
| 38 | ``` |
| 39 | |
| 40 | This will: |
| 41 | |
| 42 | - Skip the interactive onboarding prompts |
| 43 | - Automatically configure the CLI to use AWS Bedrock |
| 44 | - Require that AWS credentials are already configured through the standard AWS credential chain |
| 45 | - Display a confirmation message to the user |
| 46 | - Mark onboarding as completed |
| 47 | |
| 48 | ## Normal flow |
| 49 | |
| 50 | **The normal flow runs when the user has already completed onboarding.** |
| 51 | |
| 52 | 1. If the --config flag is provided, load this config |
| 53 | 2. If the user is logged in, look for the first assistant in the selected org |
| 54 | 3. If there are no assistants in that org, then look for a local ~/.continue/config.yaml |
| 55 | 4. If there is no config.yaml, look for an ANTHROPIC_API_KEY in the environment and manually construct the config object to include just the claude-4-sonnet model with that API key |
| 56 | 5. If none of the above, then bring the user to step 3 of the onboarding flow |