Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace placeholder site with Docusaurus #3

Merged
merged 10 commits into from
Dec 12, 2024
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
38 changes: 17 additions & 21 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
# Dependencies
/node_modules

# Production
/build

node_modules
dist
dist-ssr
*.local
# Generated files
.docusaurus
.cache-loader

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
# Misc
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
29 changes: 20 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
# Landing Page for CodeGate
# CodeGate docs

Landing page and documentation site for the CodeGate Project
This repository contains the public-facing docs for CodeGate, hosted at
[https://docs.codegate.ai](https://docs.codegate.ai).

![Picture of website in Light mode](./images/light.png)
## Local Development

![Picture of website in Dark mode](./images/dark.png)
```bash
npm install
npm run start
```

# React + Vite
This command starts a local development server and opens up a browser window.
Most changes are reflected live without having to restart the server.

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
## Build

Currently, two official plugins are available:
```bash
npm run build
```

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
This command generates static content into the `build` directory.

## About

This site is built with [Docusaurus](https://docusaurus.io/), a modern static
website generator.
3 changes: 3 additions & 0 deletions docs/about/_category_.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
label: 'About CodeGate'
position: 50
collapsed: false
66 changes: 66 additions & 0 deletions docs/about/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
title: Contributing
description: How to contribute to the project.
sidebar_position: 30
---

CodeGate is an open source (Apache-2.0) project maintained by
[Stacklok](https://www.stacklok.com), and we welcome community contributions.

:::danger[Content needed]

This is all boilerplate lifted from elsewhere, pending final contributor
guidelines

:::

## How to contribute

### Reporting issues

If you encounter a bug, create a new issue on our GitHub repository with a clear
description, steps to reproduce, and any relevant screenshots or error logs.

Search existing issues to avoid duplicates.

### Suggesting features

If you have an idea for a new feature, create a new issue labeled "feature
request" with a detailed explanation of the proposed functionality and its
benefits.

### Development environment

Refer to the [Developer reference](../development/index.md) section for details
about setting up your development environment, building the app, and running
tests.

### Submitting changes

To contribute code, fork the
[CodeGate repository](https://github.com/stacklok/codegate) on GitHub to your
personal account.

Push your changes to your forked repository and open a pull request from your
branch to the main branch of the original repository.

Provide a detailed description of your changes in the pull request, referencing
any relevant issues or discussions. Include tests if applicable.

## Communication

### Community discussion

Join the `#codegate` channel on the
[Stacklok Discord server](https://discord.gg/stacklok) to discuss project ideas,
ask questions, and share resources.

### Code reviews

Be open to feedback from reviewers during the pull request process and make
necessary adjustments.

### Respectful communication

Always maintain a respectful and constructive tone in your interactions with
other contributors and maintainers.
22 changes: 22 additions & 0 deletions docs/about/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: Frequently asked questions
description: Frequently asked questions about the CodeGate project.
sidebar_label: FAQ
sidebar_position: 10
---

:::danger[Content needed]

Please help seed some questions in the draft doc

:::

### Does CodeGate replace my AI code assistant plugin?

No, CodeGate works _with_ your AI code assistant, as a local gateway between
your client and the LLM it's communicating with.

### Does CodeGate work with any plugins other than Copilot and Continue?

Currently, CodeGate works with GitHub Copilot and Continue. We are actively
exploring additional integrations based on user feedback.
10 changes: 10 additions & 0 deletions docs/about/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: About CodeGate
description: More information about the CodeGate project.
---

import DocCardList from '@theme/DocCardList';

Learn more about the CodeGate project.

<DocCardList />
11 changes: 11 additions & 0 deletions docs/about/roadmap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Roadmap
description: What are we working on next?
sidebar_position: 20
---

:::danger[Content needed]

Needs content from Pathfinder team

:::
2 changes: 2 additions & 0 deletions docs/development/_category_.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
label: 'Developer reference'
position: 40
159 changes: 159 additions & 0 deletions docs/development/cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
---
title: CLI commands and flags
description: CodeGate provides a command-line interface
sidebar_position: 10
---

CodeGate provides a command-line interface through `cli.py` with the following
structure:

## Main command

```bash
codegate [OPTIONS] COMMAND [ARGS]...
```

## Available commands

### `serve`

Start the CodeGate server:

```bash
codegate serve [OPTIONS]
```

#### Options {#server-options}

- `--port INTEGER`: Port to listen on (default: `8989`)
- Must be between 1 and 65535
- Overrides configuration file and environment variables
- `--host TEXT`: Host to bind to (default: `localhost`)
- Overrides configuration file and environment variables
- `--log-level [ERROR|WARNING|INFO|DEBUG]`: Set the log level (default: `INFO`)
- Case-insensitive
- Overrides configuration file and environment variables
- `--log-format [JSON|TEXT]`: Set the log format (default: `JSON`)
- Case-insensitive
- Overrides configuration file and environment variables
- `--config FILE`: Path to YAML config file

- Optional
- Must be a valid YAML file
- Configuration values can be overridden by environment variables and CLI
options

- `--prompts FILE`: Path to YAML prompts file

- Optional
- Must be a valid YAML file
- Overrides default prompts and configuration file prompts

- `--vllm-url TEXT`: vLLM provider URL (default: `http://localhost:8000`)

- Optional
- Base URL for vLLM provider (/v1 path is added automatically)
- Overrides configuration file and environment variables

- `--openai-url TEXT`: OpenAI provider URL (default:
`https://api.openai.com/v1`)

- Optional
- Base URL for OpenAI provider
- Overrides configuration file and environment variables

- `--anthropic-url TEXT`: Anthropic provider URL (default:
`https://api.anthropic.com/v1`)

- Optional
- Base URL for Anthropic provider
- Overrides configuration file and environment variables

- `--ollama-url TEXT`: Ollama provider URL (default: `http://localhost:11434`)
- Optional
- Base URL for Ollama provider (/api path is added automatically)
- Overrides configuration file and environment variables

### `show-prompts`

Display the loaded system prompts:

```bash
codegate show-prompts [OPTIONS]
```

#### Options {#show-prompts-options}

- `--prompts FILE`: Path to YAML prompts file
- Optional
- Must be a valid YAML file
- If not provided, shows default prompts from [prompts/default.yaml](https://github.com/stacklok/codegate/blob/main/prompts/default.yaml)

## Error handling

The CLI provides user-friendly error messages for:

- Invalid port numbers
- Invalid log levels
- Invalid log formats
- Configuration file errors
- Prompts file errors
- Server startup failures

All errors are output to stderr with appropriate exit codes.

## Examples

Start server with default settings:

```bash
codegate serve
```

Start server on specific port and host:

```bash
codegate serve --port 8989 --host localhost
```

Start server with custom logging:

```bash
codegate serve --log-level DEBUG --log-format TEXT
```

Start server with configuration file:

```bash
codegate serve --config my-config.yaml
```

Start server with custom prompts:

```bash
codegate serve --prompts my-prompts.yaml
```

Start server with custom vLLM endpoint:

```bash
codegate serve --vllm-url https://vllm.example.com
```

Start server with custom Ollama endpoint:

```bash
codegate serve --ollama-url http://localhost:11434
```

Show default system prompts:

```bash
codegate show-prompts
```

Show prompts from a custom file:

```bash
codegate show-prompts --prompts my-prompts.yaml
```
Loading