Merge branch 'main' into onboarding-again
This commit is contained in:
commit
1605bde69d
4 changed files with 20 additions and 15 deletions
|
|
@ -33,13 +33,6 @@
|
|||
"pkgRoot": "."
|
||||
}
|
||||
],
|
||||
[
|
||||
"@semantic-release/git",
|
||||
{
|
||||
"assets": ["package.json", "CHANGELOG.md"],
|
||||
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
||||
}
|
||||
],
|
||||
"@semantic-release/github"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,9 +4,10 @@ When a user first runs `cn` in interactive mode, they will be taken through "onb
|
|||
|
||||
## Onboarding flow
|
||||
|
||||
**The onboarding flow runs when the user hasn't completed onboarding before, regardless of whether they have a valid config.yaml file.**
|
||||
|
||||
1. If the --config flag is provided, load this config
|
||||
2. If the user has a ~/.continue/config.yaml with an acceptable model, load this config automatically
|
||||
3. Otherwise, we will present the user with two options:
|
||||
2. Otherwise, we will present the user with two options:
|
||||
|
||||
- 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
|
||||
- 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
|
||||
|
|
@ -26,8 +27,10 @@ When something in the onboarding flow is done automatically, we should tell the
|
|||
|
||||
## Normal flow
|
||||
|
||||
**The normal flow runs when the user has already completed onboarding.**
|
||||
|
||||
1. If the --config flag is provided, load this config
|
||||
2. If the user is logged in, look for the first assistant in the selected org
|
||||
3. If there are no assistants in that org, then look for a local ~/.continue/config.yaml
|
||||
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
|
||||
5. If none of the above, then bring the user to step 3 of the onboarding flow
|
||||
5. If none of the above, then bring the user to step 3 of the onboarding flow
|
||||
|
|
@ -1,5 +1,14 @@
|
|||
import * as fs from "fs";
|
||||
import * as os from "os";
|
||||
import * as path from "path";
|
||||
import { logout as workosLogout } from "../auth/workos.js";
|
||||
|
||||
export async function logout() {
|
||||
workosLogout();
|
||||
}
|
||||
|
||||
// Remove onboarding completion flag so user will go through onboarding again
|
||||
const onboardingFlagPath = path.join(os.homedir(), ".continue", ".onboarding_complete");
|
||||
if (fs.existsSync(onboardingFlagPath)) {
|
||||
fs.unlinkSync(onboardingFlagPath);
|
||||
}
|
||||
}
|
||||
|
|
@ -168,7 +168,7 @@ export async function runNormalFlow(
|
|||
if (isAuthenticated()) {
|
||||
try {
|
||||
const result = await initialize(authConfig, undefined);
|
||||
return { ...result, wasOnboarded: true };
|
||||
return { ...result, wasOnboarded: false };
|
||||
} catch (error) {}
|
||||
}
|
||||
|
||||
|
|
@ -176,7 +176,7 @@ export async function runNormalFlow(
|
|||
if (fs.existsSync(CONFIG_PATH)) {
|
||||
try {
|
||||
const result = await initialize(authConfig, CONFIG_PATH);
|
||||
return { ...result, wasOnboarded: true };
|
||||
return { ...result, wasOnboarded: false };
|
||||
} catch (error) {
|
||||
console.log(chalk.yellow("⚠ Invalid config file found"));
|
||||
}
|
||||
|
|
@ -188,7 +188,7 @@ export async function runNormalFlow(
|
|||
await createOrUpdateConfig(process.env.ANTHROPIC_API_KEY);
|
||||
console.log(chalk.gray(` Config saved to: ${CONFIG_PATH}`));
|
||||
const result = await initialize(authConfig, CONFIG_PATH);
|
||||
return { ...result, wasOnboarded: true };
|
||||
return { ...result, wasOnboarded: false };
|
||||
}
|
||||
|
||||
// Step 5: Fall back to onboarding flow
|
||||
|
|
@ -230,4 +230,4 @@ export async function initializeWithOnboarding(
|
|||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue