Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion codeflash/code_utils/env_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def get_codeflash_api_key() -> str:
# within the same process, the environment variable could become outdated.
api_key = shell_api_key or env_api_key if is_LSP_enabled() else env_api_key or shell_api_key

api_secret_docs_message = "For more information, refer to the documentation at [https://docs.codeflash.ai/getting-started/codeflash-github-actions#add-your-api-key-to-your-repository-secrets]." # noqa
api_secret_docs_message = "For more information, refer to the documentation at [https://docs.codeflash.ai/optimizing-with-codeflash/codeflash-github-actions#manual-setup]." # noqa
if not api_key:
msg = (
"I didn't find a Codeflash API key in your environment.\nYou can generate one at "
Expand Down
44 changes: 29 additions & 15 deletions docs/getting-started/local-installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,6 @@ poetry add codeflash@latest --group dev
</Tip>
</Step>

<Step title="Generate a Codeflash API Key">
Codeflash uses cloud-hosted AI models and integrations with GitHub. You'll need an API key to authorize your access.

1. Visit the [Codeflash Web App](https://app.codeflash.ai/)
2. Sign up with your GitHub account (free)
3. Navigate to the [API Key](https://app.codeflash.ai/app/apikeys) page to generate your API key

<Note>
**Free Tier Available**

Codeflash offers a **free tier** with a limited number of optimizations. Perfect for trying it out on small projects!
</Note>
</Step>

<Step title="Run Automatic Configuration">
Navigate to your project's root directory (where your `pyproject.toml` file is or should be) and run:

Expand All @@ -95,10 +81,38 @@ When running `codeflash init`, you will see the following prompts:
5. Which test framework do you use? (pytest/unittest)
6. Install GitHub actions for Continuous optimization?
```

After you have answered these questions, the Codeflash configuration will be saved in the `pyproject.toml` file.
</Step>

<Step title="Generate a Codeflash API Key">
Codeflash uses cloud-hosted AI models and integrations with GitHub. You'll need an API key to authorize your access.

1. Visit the [Codeflash Web App](https://app.codeflash.ai/)
2. Sign up with your GitHub account (free)
3. Navigate to the [API Key](https://app.codeflash.ai/app/apikeys) page to generate your API key

<Note>
**Free Tier Available**

Codeflash offers a **free tier** with a limited number of optimizations. Perfect for trying it out on small projects!
</Note>
</Step>

<Step title="Install the Codeflash GitHub App">

{/* TODO: Justify to users Why we need the user to install Github App even in local Installation or local optimization? */}
Finally, if you have not done so already, Codeflash will ask you to install the GitHub App in your repository.
The Codeflash GitHub App allows access to your repository to the codeflash-ai bot to open PRs, review code, and provide optimization suggestions.

Please [install the Codeflash GitHub
app](https://github.com/apps/codeflash-ai/installations/select_target) by choosing the repository you want to install
Codeflash on.
</Step>


</Steps>

After you have answered these questions, the Codeflash configuration will be saved in the `pyproject.toml` file.
To understand the configuration options, and set more advanced options, see the [Manual Configuration](/configuration) page.

### Step 4: Install the Codeflash GitHub App
Expand Down
Loading