kodit 0.1.17__tar.gz → 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of kodit might be problematic. Click here for more details.
- {kodit-0.1.17 → kodit-0.2.0}/.github/workflows/docker.yaml +26 -1
- {kodit-0.1.17 → kodit-0.2.0}/Dockerfile +2 -2
- {kodit-0.1.17 → kodit-0.2.0}/PKG-INFO +8 -10
- {kodit-0.1.17 → kodit-0.2.0}/README.md +7 -9
- kodit-0.2.0/docs/_index.md +97 -0
- {kodit-0.1.17 → kodit-0.2.0}/docs/demos/_index.md +2 -2
- kodit-0.2.0/docs/demos/knock-knock-auth/index.md +335 -0
- {kodit-0.1.17 → kodit-0.2.0}/docs/developer/index.md +0 -1
- kodit-0.2.0/docs/getting-started/_index.md +12 -0
- kodit-0.2.0/docs/getting-started/installation/index.md +43 -0
- kodit-0.2.0/docs/getting-started/integration/index.md +97 -0
- kodit-0.2.0/docs/getting-started/quick-start/index.md +56 -0
- kodit-0.2.0/docs/reference/_index.md +12 -0
- kodit-0.2.0/docs/reference/configuration/index.md +100 -0
- kodit-0.2.0/docs/reference/telemetry/index.md +34 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/_version.py +2 -2
- kodit-0.2.0/src/kodit/snippets/languages/javascript.scm +24 -0
- kodit-0.2.0/src/kodit/snippets/languages/typescript.scm +25 -0
- kodit-0.2.0/tests/kodit/snippets/javascript.js +74 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/kodit/snippets/method_extraction_test.py +44 -0
- kodit-0.2.0/tests/kodit/snippets/typescript.tsx +73 -0
- kodit-0.1.17/docs/_index.md +0 -259
- kodit-0.1.17/docs/demos/knock-knock-auth/index.md +0 -335
- {kodit-0.1.17 → kodit-0.2.0}/.cursor/rules/kodit.mdc +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/.github/CODE_OF_CONDUCT.md +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/.github/CONTRIBUTING.md +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/.github/dependabot.yml +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/.github/workflows/docs.yaml +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/.github/workflows/pull_request.yaml +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/.github/workflows/pypi-test.yaml +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/.github/workflows/pypi.yaml +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/.github/workflows/test.yaml +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/.gitignore +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/.python-version +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/.vscode/launch.json +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/.vscode/settings.json +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/LICENSE +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/alembic.ini +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/pyproject.toml +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/.gitignore +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/__init__.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/app.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/bm25/__init__.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/bm25/keyword_search_factory.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/bm25/keyword_search_service.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/bm25/local_bm25.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/bm25/vectorchord_bm25.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/cli.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/config.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/database.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/embedding/__init__.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/embedding/embedding_factory.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/embedding/embedding_models.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/embedding/embedding_provider/__init__.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/embedding/embedding_provider/embedding_provider.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/embedding/embedding_provider/hash_embedding_provider.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/embedding/embedding_provider/local_embedding_provider.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/embedding/embedding_provider/openai_embedding_provider.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/embedding/embedding_repository.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/embedding/local_vector_search_service.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/embedding/vector_search_service.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/embedding/vectorchord_vector_search_service.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/enrichment/__init__.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/enrichment/enrichment_factory.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/enrichment/enrichment_provider/__init__.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/enrichment/enrichment_provider/enrichment_provider.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/enrichment/enrichment_provider/local_enrichment_provider.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/enrichment/enrichment_provider/openai_enrichment_provider.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/enrichment/enrichment_service.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/indexing/__init__.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/indexing/fusion.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/indexing/indexing_models.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/indexing/indexing_repository.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/indexing/indexing_service.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/log.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/mcp.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/middleware.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/migrations/README +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/migrations/__init__.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/migrations/env.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/migrations/script.py.mako +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/migrations/versions/7c3bbc2ab32b_add_embeddings_table.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/migrations/versions/85155663351e_initial.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/migrations/versions/__init__.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/migrations/versions/c3f5137d30f5_index_all_the_things.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/snippets/__init__.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/snippets/languages/__init__.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/snippets/languages/csharp.scm +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/snippets/languages/go.scm +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/snippets/languages/python.scm +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/snippets/method_snippets.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/snippets/snippets.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/source/__init__.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/source/source_models.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/source/source_repository.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/source/source_service.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/util/__init__.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/src/kodit/util/spinner.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/__init__.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/conftest.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/experiments/cline-prompt-regression-tests/cline_prompt.txt +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/experiments/cline-prompt-regression-tests/cline_prompt_test.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/experiments/embedding.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/experiments/similarity_test.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/kodit/__init__.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/kodit/bm25/local_bm25_test.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/kodit/bm25/vectorchord_repository_test.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/kodit/cli_test.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/kodit/e2e.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/kodit/embedding/__init__.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/kodit/embedding/embedding_provider/local_embedding_provider_test.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/kodit/embedding/embedding_provider/openai_embedding_provider_test.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/kodit/embedding/local_vector_search_service_test.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/kodit/embedding/vectorchord_vector_search_service_test.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/kodit/enrichment/__init__.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/kodit/enrichment/enrichment_provider/__init__.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/kodit/enrichment/enrichment_provider/openai_enrichment_provider_test.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/kodit/indexing/__init__.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/kodit/indexing/indexing_repository_test.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/kodit/indexing/indexing_service_test.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/kodit/mcp_test.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/kodit/snippets/__init__.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/kodit/snippets/csharp.cs +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/kodit/snippets/detect_language_test.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/kodit/snippets/golang.go +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/kodit/snippets/knock-knock-server.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/kodit/snippets/python.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/kodit/source/__init__.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/kodit/source/source_service_test.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/performance/similarity.py +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/tests/smoke.sh +0 -0
- {kodit-0.1.17 → kodit-0.2.0}/uv.lock +0 -0
|
@@ -2,8 +2,30 @@ name: Publish Docker image
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
|
+
pull_request_target:
|
|
6
|
+
types: [opened, synchronize, reopened]
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
TEST_TAG: user/app:test
|
|
5
10
|
|
|
6
11
|
jobs:
|
|
12
|
+
test-build:
|
|
13
|
+
name: Test and build Docker image
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- name: Check out the repo
|
|
17
|
+
uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Build and push Docker image
|
|
20
|
+
id: push
|
|
21
|
+
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
|
|
22
|
+
with:
|
|
23
|
+
context: .
|
|
24
|
+
file: ./Dockerfile
|
|
25
|
+
push: false
|
|
26
|
+
load: true
|
|
27
|
+
tags: ${{ env.TEST_TAG }}
|
|
28
|
+
|
|
7
29
|
push_to_registry:
|
|
8
30
|
name: Push Docker image to registry
|
|
9
31
|
runs-on: ubuntu-latest
|
|
@@ -14,6 +36,9 @@ jobs:
|
|
|
14
36
|
contents: read
|
|
15
37
|
attestations: write
|
|
16
38
|
id-token: write
|
|
39
|
+
needs: test-build
|
|
40
|
+
# Only run on main branch or when explicitly triggered
|
|
41
|
+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
|
|
17
42
|
steps:
|
|
18
43
|
- name: Check out the repo
|
|
19
44
|
uses: actions/checkout@v4
|
|
@@ -46,4 +71,4 @@ jobs:
|
|
|
46
71
|
with:
|
|
47
72
|
subject-name: ${{ vars.REGISTRY }}/${{ vars.REGISTRY_ORG }}/${{ github.event.repository.name }}
|
|
48
73
|
subject-digest: ${{ steps.push.outputs.digest }}
|
|
49
|
-
push-to-registry: true
|
|
74
|
+
push-to-registry: true
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# syntax=docker/dockerfile:1.9
|
|
2
|
-
FROM python:3.13.
|
|
2
|
+
FROM python:3.13.4-slim-bookworm AS build
|
|
3
3
|
|
|
4
4
|
# The following does not work in Podman unless you build in Docker
|
|
5
5
|
# compatibility mode: <https://github.com/containers/podman/issues/8477>
|
|
@@ -60,7 +60,7 @@ RUN --mount=type=cache,target=/root/.cache \
|
|
|
60
60
|
|
|
61
61
|
##########################################################################
|
|
62
62
|
|
|
63
|
-
FROM python:3.13.
|
|
63
|
+
FROM python:3.13.4-slim-bookworm
|
|
64
64
|
SHELL ["sh", "-exc"]
|
|
65
65
|
|
|
66
66
|
ENV PATH=/app/bin:$PATH
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kodit
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Code indexing for better AI code generation
|
|
5
5
|
Project-URL: Homepage, https://docs.helixml.tech/kodit/
|
|
6
6
|
Project-URL: Documentation, https://docs.helixml.tech/kodit/
|
|
@@ -101,8 +101,8 @@ intent. Kodit has been tested to work well with:
|
|
|
101
101
|
|
|
102
102
|
- Seamless integration with popular AI coding assistants
|
|
103
103
|
- Tested and verified with:
|
|
104
|
-
- [Cursor](https://docs.helix.ml/kodit/#integration-with-cursor)
|
|
105
|
-
- [Cline](https://docs.helix.ml/kodit/#integration-with-cline)
|
|
104
|
+
- [Cursor](https://docs.helix.ml/kodit/getting-started/integration/#integration-with-cursor)
|
|
105
|
+
- [Cline](https://docs.helix.ml/kodit/getting-started/integration/#integration-with-cline)
|
|
106
106
|
- Please contribute more instructions! ... any other assistant is likely to work ...
|
|
107
107
|
|
|
108
108
|
### Enterprise Ready
|
|
@@ -126,16 +126,14 @@ Supported providers:
|
|
|
126
126
|
|
|
127
127
|
## 🚀 Quick Start
|
|
128
128
|
|
|
129
|
-
1. [Install Kodit](https://docs.helix.ml/kodit
|
|
130
|
-
2. [Index codebases](https://docs.helix.ml/kodit
|
|
131
|
-
3. [Integrate with your coding assistant](https://docs.helix.ml/kodit
|
|
129
|
+
1. [Install Kodit](https://docs.helix.ml/kodit/getting-started/installation/)
|
|
130
|
+
2. [Index codebases](https://docs.helix.ml/kodit/getting-started/quick-start/)
|
|
131
|
+
3. [Integrate with your coding assistant](https://docs.helix.ml/kodit/getting-started/integration/)
|
|
132
132
|
|
|
133
133
|
### Documentation
|
|
134
134
|
|
|
135
|
-
- [
|
|
136
|
-
- [
|
|
137
|
-
- [Connecting to Kodit](https://docs.helix.ml/kodit/#integrating-kodit-with-coding-assistants)
|
|
138
|
-
- [Configuration Options](https://docs.helix.ml/kodit/#configuring-kodit)
|
|
135
|
+
- [Getting Started Guide](https://docs.helix.ml/kodit/getting-started/)
|
|
136
|
+
- [Reference Guide](https://docs.helix.ml/kodit/reference/)
|
|
139
137
|
- [Contribution Guidelines](.github/CONTRIBUTING.md)
|
|
140
138
|
|
|
141
139
|
## Roadmap
|
|
@@ -50,8 +50,8 @@ intent. Kodit has been tested to work well with:
|
|
|
50
50
|
|
|
51
51
|
- Seamless integration with popular AI coding assistants
|
|
52
52
|
- Tested and verified with:
|
|
53
|
-
- [Cursor](https://docs.helix.ml/kodit/#integration-with-cursor)
|
|
54
|
-
- [Cline](https://docs.helix.ml/kodit/#integration-with-cline)
|
|
53
|
+
- [Cursor](https://docs.helix.ml/kodit/getting-started/integration/#integration-with-cursor)
|
|
54
|
+
- [Cline](https://docs.helix.ml/kodit/getting-started/integration/#integration-with-cline)
|
|
55
55
|
- Please contribute more instructions! ... any other assistant is likely to work ...
|
|
56
56
|
|
|
57
57
|
### Enterprise Ready
|
|
@@ -75,16 +75,14 @@ Supported providers:
|
|
|
75
75
|
|
|
76
76
|
## 🚀 Quick Start
|
|
77
77
|
|
|
78
|
-
1. [Install Kodit](https://docs.helix.ml/kodit
|
|
79
|
-
2. [Index codebases](https://docs.helix.ml/kodit
|
|
80
|
-
3. [Integrate with your coding assistant](https://docs.helix.ml/kodit
|
|
78
|
+
1. [Install Kodit](https://docs.helix.ml/kodit/getting-started/installation/)
|
|
79
|
+
2. [Index codebases](https://docs.helix.ml/kodit/getting-started/quick-start/)
|
|
80
|
+
3. [Integrate with your coding assistant](https://docs.helix.ml/kodit/getting-started/integration/)
|
|
81
81
|
|
|
82
82
|
### Documentation
|
|
83
83
|
|
|
84
|
-
- [
|
|
85
|
-
- [
|
|
86
|
-
- [Connecting to Kodit](https://docs.helix.ml/kodit/#integrating-kodit-with-coding-assistants)
|
|
87
|
-
- [Configuration Options](https://docs.helix.ml/kodit/#configuring-kodit)
|
|
84
|
+
- [Getting Started Guide](https://docs.helix.ml/kodit/getting-started/)
|
|
85
|
+
- [Reference Guide](https://docs.helix.ml/kodit/reference/)
|
|
88
86
|
- [Contribution Guidelines](.github/CONTRIBUTING.md)
|
|
89
87
|
|
|
90
88
|
## Roadmap
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Kodit: Code Indexing MCP Server"
|
|
3
|
+
linkTitle: Kodit Docs
|
|
4
|
+
cascade:
|
|
5
|
+
type: docs
|
|
6
|
+
menu:
|
|
7
|
+
main:
|
|
8
|
+
name: Kodit Docs
|
|
9
|
+
weight: 3
|
|
10
|
+
next: /kodit/getting-started
|
|
11
|
+
weight: 1
|
|
12
|
+
aliases:
|
|
13
|
+
- /coda
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<a href="https://docs.helix.ml/kodit/"><img src="https://docs.helix.ml/images/helix-kodit-logo.png" alt="Helix Kodit Logo" width="300"></a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<p align="center">
|
|
21
|
+
Kodit connects your AI coding assistant to external codebases to provide accurate and up-to-date snippets of code.
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
<div class="flex justify-center items-center gap-4">
|
|
25
|
+
|
|
26
|
+
[](https://github.com/helixml/kodit/blob/main/LICENSE)
|
|
27
|
+
[](https://github.com/helixml/kodit/discussions)
|
|
28
|
+
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
**Helix Kodit** is an **MCP server** that connects your AI coding assistant to external codebases. It can:
|
|
32
|
+
|
|
33
|
+
- Improve your AI-assisted code by providing canonical examples direct from the source
|
|
34
|
+
- Index local and public codebases
|
|
35
|
+
- Integrates with any AI coding assistant via MCP
|
|
36
|
+
- Search using keyword and semantic search
|
|
37
|
+
- Integrate with any OpenAI-compatible or custom API/model
|
|
38
|
+
|
|
39
|
+
If you're an engineer working with AI-powered coding assistants, Kodit helps by
|
|
40
|
+
providing relevant and up-to-date examples of your task so that LLMs make less mistakes
|
|
41
|
+
and produce fewer hallucinations.
|
|
42
|
+
|
|
43
|
+
## ✨ Features
|
|
44
|
+
|
|
45
|
+
### Codebase Indexing
|
|
46
|
+
|
|
47
|
+
Kodit connects to a variety of local and remote codebases to build an index of your
|
|
48
|
+
code. This index is used to build a snippet library, ready for ingestion into an LLM.
|
|
49
|
+
|
|
50
|
+
- Index local directories and public Git repositories
|
|
51
|
+
- Build comprehensive snippet libraries for LLM ingestion
|
|
52
|
+
- Support for multiple codebase types and languages
|
|
53
|
+
- Efficient indexing and search capabilities
|
|
54
|
+
|
|
55
|
+
### MCP Server
|
|
56
|
+
|
|
57
|
+
Relevant snippets are exposed to an AI coding assistant via an MCP server. This allows
|
|
58
|
+
the assistant to request relevant snippets by providing keywords, code, and semantic
|
|
59
|
+
intent. Kodit has been tested to work well with:
|
|
60
|
+
|
|
61
|
+
- Seamless integration with popular AI coding assistants
|
|
62
|
+
- Tested and verified with:
|
|
63
|
+
- [Cursor](./getting-started/integration/index.md#integration-with-cursor)
|
|
64
|
+
- [Cline](./getting-started/integration/index.md#integration-with-cline)
|
|
65
|
+
- Please contribute more instructions! ... any other assistant is likely to work ...
|
|
66
|
+
|
|
67
|
+
### Enterprise Ready
|
|
68
|
+
|
|
69
|
+
Out of the box, Kodit works with a local SQLite database and very small, local models.
|
|
70
|
+
But enterprises can scale out with performant databases and dedicated models. Everything
|
|
71
|
+
can even run securely, privately, with on-premise LLM platforms like
|
|
72
|
+
[Helix](https://helix.ml).
|
|
73
|
+
|
|
74
|
+
Supported databases:
|
|
75
|
+
|
|
76
|
+
- SQLite
|
|
77
|
+
- [Vectorchord](https://github.com/tensorchord/VectorChord)
|
|
78
|
+
|
|
79
|
+
Supported providers:
|
|
80
|
+
|
|
81
|
+
- Local (which uses tiny CPU-only open-source models)
|
|
82
|
+
- OpenAI
|
|
83
|
+
- Secure, private LLM enclave with [Helix](https://helix.ml).
|
|
84
|
+
- Any other OpenAI compatible API
|
|
85
|
+
|
|
86
|
+
## Roadmap
|
|
87
|
+
|
|
88
|
+
The roadmap is currently maintained as a [Github Project](https://github.com/orgs/helixml/projects/4).
|
|
89
|
+
|
|
90
|
+
## 💬 Support
|
|
91
|
+
|
|
92
|
+
For commercial support, please contact [Helix.ML](founders@helix.ml). To ask a question,
|
|
93
|
+
please [open a discussion](https://github.com/helixml/kodit/discussions).
|
|
94
|
+
|
|
95
|
+
## License
|
|
96
|
+
|
|
97
|
+
[Apache 2.0 © 2025 HelixML, Inc.](https://github.com/helixml/kodit/blob/main/LICENSE)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Kodit Demos
|
|
3
3
|
linkTitle: Demos
|
|
4
|
-
weight:
|
|
4
|
+
weight: 3
|
|
5
5
|
tags:
|
|
6
6
|
- demo
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
The following sections provide
|
|
9
|
+
The following sections provide examples and demos using Kodit.
|
|
10
10
|
|
|
11
11
|
<!--more-->
|
|
12
12
|
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Kodit Demo: Proprietary Auth Patterns"
|
|
3
|
+
linkTitle: Proprietary Code
|
|
4
|
+
description: A demo of Kodit where knowledge of proprietary code is required.
|
|
5
|
+
weight: 1
|
|
6
|
+
tags:
|
|
7
|
+
- demo
|
|
8
|
+
- auth
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
Another common feature of private codebases is proprietary code to achieve a certain
|
|
12
|
+
task. For example, you might a specific way to request data from your data lake, or a
|
|
13
|
+
specific format to use when using a common API.
|
|
14
|
+
|
|
15
|
+
This example uses the analogy of a proprietary authentication mechanism. I have a super
|
|
16
|
+
secret server with sensitive data. It is protected with a [custom auth implementation](https://gist.github.com/cbf0bd1f3338ddf9f98879148d2d752d)
|
|
17
|
+
that requires the user to "knock three times" before they get access.
|
|
18
|
+
|
|
19
|
+
## With Cursor
|
|
20
|
+
|
|
21
|
+
Without Kodit, an AI assistant makes an average assumption about what the auth might
|
|
22
|
+
look like, based upon the context provided by the user. The transcript is below. You can
|
|
23
|
+
see that Cursor doesn't have a chance.
|
|
24
|
+
|
|
25
|
+
### Original Cursor Response
|
|
26
|
+
|
|
27
|
+
> **User**
|
|
28
|
+
>
|
|
29
|
+
> Write a python script that is able to access my super secret knock knock api on localhost:8000/secret.
|
|
30
|
+
>
|
|
31
|
+
> **Cursor**
|
|
32
|
+
>
|
|
33
|
+
> I'll help you create a Python script to interact with your local knock knock API. I'll create a script that makes a > request to the specified endpoint.
|
|
34
|
+
>
|
|
35
|
+
> Let me write a script that uses the `requests` library to make HTTP requests to your local API:
|
|
36
|
+
>
|
|
37
|
+
> ```python
|
|
38
|
+
> import requests
|
|
39
|
+
>
|
|
40
|
+
> def access_secret_api():
|
|
41
|
+
> try:
|
|
42
|
+
> # Make a GET request to the secret endpoint
|
|
43
|
+
> response = requests.get('http://localhost:8000/secret')
|
|
44
|
+
>
|
|
45
|
+
> # Check if the request was successful
|
|
46
|
+
> response.raise_for_status()
|
|
47
|
+
>
|
|
48
|
+
> # Print the response
|
|
49
|
+
> print("Response from secret API:", response.text)
|
|
50
|
+
>
|
|
51
|
+
> except requests.exceptions.RequestException as e:
|
|
52
|
+
> print(f"Error accessing the API: {e}")
|
|
53
|
+
>
|
|
54
|
+
> if __name__ == "__main__":
|
|
55
|
+
> access_secret_api()
|
|
56
|
+
> ```
|
|
57
|
+
>
|
|
58
|
+
> I've created a Python script that will:
|
|
59
|
+
>
|
|
60
|
+
> 1. Make a GET request to `http://localhost:8000/secret`
|
|
61
|
+
> 2. Handle any potential errors that might occur during the request
|
|
62
|
+
> 3. Print the response from the API if successful
|
|
63
|
+
>
|
|
64
|
+
> To run this script, you'll need to have the `requests` library installed. You can install it using pip:
|
|
65
|
+
|
|
66
|
+
## With Kodit
|
|
67
|
+
|
|
68
|
+
Now let's index the code for my secret server and then leverage Kodit in Cursor.
|
|
69
|
+
|
|
70
|
+
1. Start afresh. Delete your data directory or your database.
|
|
71
|
+
2. Index the [server code](https://gist.github.com/cbf0bd1f3338ddf9f98879148d2d752d): `kodit index https://gist.github.com/cbf0bd1f3338ddf9f98879148d2d752d.git`
|
|
72
|
+
3. Launch the MCP server: `kodit serve`kodit
|
|
73
|
+
4. Connect Cursor.
|
|
74
|
+
|
|
75
|
+
The results are shown below. Cursor has correctly queried Kodit, which has responded with examples of the super secret auth implementation. This lead to cursor producing valid, working code that adhered to our esoteric auth implementation!
|
|
76
|
+
|
|
77
|
+
Here is the result of running the generated code:
|
|
78
|
+
|
|
79
|
+
```sh
|
|
80
|
+
uv run temp.py
|
|
81
|
+
Knock 1: Knock 1 received (token: sAQmj2uFrRxc-e9blSCfFg)
|
|
82
|
+
Knock 2: Knock 2 received (token: sAQmj2uFrRxc-e9blSCfFg)
|
|
83
|
+
Knock 3: Knock 3 received (token: sAQmj2uFrRxc-e9blSCfFg)
|
|
84
|
+
Secret area: {'message': 'Welcome to the secret area!', 'secret': 'The answer is 42'}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Kodit Cursor Response
|
|
88
|
+
|
|
89
|
+
> **User**
|
|
90
|
+
>
|
|
91
|
+
> Write a python script that is able to access my super secret knock knock api on localhost:8000/secret.
|
|
92
|
+
>
|
|
93
|
+
> **Cursor**
|
|
94
|
+
>
|
|
95
|
+
> Based on the information found in the codebase, your "super secret knock knock API" on `localhost:8000/secret` requires a > special authentication flow:
|
|
96
|
+
>
|
|
97
|
+
> 1. You must make 3 POST requests to `/knock`. Each time, you use the same token (provided in the response) in the > Authorization header as a Bearer token.
|
|
98
|
+
> 2. After 3 knocks, you can access `/secret` with a GET request, using the same token in the Authorization header.
|
|
99
|
+
>
|
|
100
|
+
> Would you like a Python script that automates this entire process (performs the 3 knocks and then accesses the secret), > or do you want just an example of how to access `/secret` assuming you already have a valid token?
|
|
101
|
+
>
|
|
102
|
+
> **User**
|
|
103
|
+
>
|
|
104
|
+
> the whole process.
|
|
105
|
+
>
|
|
106
|
+
> **Cursor**
|
|
107
|
+
>
|
|
108
|
+
> ```python
|
|
109
|
+
> import requests
|
|
110
|
+
>
|
|
111
|
+
> BASE_URL = "http://localhost:8000"
|
|
112
|
+
> KNOCKS_REQUIRED = 3
|
|
113
|
+
>
|
|
114
|
+
> def knock_and_get_secret():
|
|
115
|
+
> token = None
|
|
116
|
+
> headers = {}
|
|
117
|
+
> for i in range(KNOCKS_REQUIRED):
|
|
118
|
+
> if token:
|
|
119
|
+
> headers = {"Authorization": f"Bearer {token}"}
|
|
120
|
+
> else:
|
|
121
|
+
> headers = {}
|
|
122
|
+
> resp = requests.post(f"{BASE_URL}/knock", headers=headers)
|
|
123
|
+
> resp.raise_for_status()
|
|
124
|
+
> data = resp.json()
|
|
125
|
+
> token = data["token"]
|
|
126
|
+
> print(f"Knock {i+1}: {data['message']} (token: {token})")
|
|
127
|
+
>
|
|
128
|
+
> # Now access the secret
|
|
129
|
+
> headers = {"Authorization": f"Bearer {token}"}
|
|
130
|
+
> resp = requests.get(f"{BASE_URL}/secret", headers=headers)
|
|
131
|
+
> if resp.status_code == 200:
|
|
132
|
+
> print("Secret area:", resp.json())
|
|
133
|
+
> else:
|
|
134
|
+
> print("Failed to access secret:", resp.status_code, resp.text)
|
|
135
|
+
>
|
|
136
|
+
> if __name__ == "__main__":
|
|
137
|
+
> knock_and_get_secret()
|
|
138
|
+
>
|
|
139
|
+
> ```
|
|
140
|
+
>
|
|
141
|
+
> I've written a Python script in `temp.py` that automates the entire process:
|
|
142
|
+
>
|
|
143
|
+
> - It performs 3 POST requests to `/knock`, passing the token as required.
|
|
144
|
+
> - After the third knock, it makes a GET request to `/secret` with the token.
|
|
145
|
+
> - The script prints out the secret or any error message.
|
|
146
|
+
>
|
|
147
|
+
> You just need to have the `requests` library installed (`pip install requests`) to run this script. Let me know if you > want any adjustments or further explanation!
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Appendix
|
|
152
|
+
|
|
153
|
+
### Kodit Request/Response from Cursor
|
|
154
|
+
|
|
155
|
+
#### Request
|
|
156
|
+
|
|
157
|
+
```json
|
|
158
|
+
{
|
|
159
|
+
"user_intent": "Write a Python script to access a secret API at http://localhost:8000/secret.",
|
|
160
|
+
"related_file_paths": [
|
|
161
|
+
"temp.py"
|
|
162
|
+
],
|
|
163
|
+
"related_file_contents": [
|
|
164
|
+
""
|
|
165
|
+
],
|
|
166
|
+
"keywords": [
|
|
167
|
+
"Python",
|
|
168
|
+
"API request",
|
|
169
|
+
"localhost",
|
|
170
|
+
"secret",
|
|
171
|
+
"http://localhost:8000/secret"
|
|
172
|
+
]
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
#### Response
|
|
177
|
+
|
|
178
|
+
> file:///Users/phil/.kodit/clones/https___gist.github.com_cbf0bd1f3338ddf9f98879148d2d752d.git/knock-knock-server.py
|
|
179
|
+
> This Python code snippet sets up a basic HTTP server that listens on a specified port (default is 8000) using the > `HTTPServer` class from the `http.server` module. The server utilizes a custom request handler called `KnockAuthHandler`, > which likely handles authentication through a "knock" method. The `run_server` function outputs instructions to the > console (using the `rich` library for formatted text) on how to access a secret area of the server. Users are required to > make three POST requests to the `/knock` endpoint, receive a token, and then use that token in an Authorization header to > make a GET request to the `/secret` endpoint. The server will continue to run indefinitely until it is stopped.
|
|
180
|
+
>
|
|
181
|
+
> ```
|
|
182
|
+
> import json
|
|
183
|
+
> import secrets
|
|
184
|
+
> from http.server import BaseHTTPRequestHandler, HTTPServer
|
|
185
|
+
> from rich.console import Console
|
|
186
|
+
> def run_server(port=8000):
|
|
187
|
+
> server_address = ("", port)
|
|
188
|
+
> httpd = HTTPServer(server_address, KnockAuthHandler)
|
|
189
|
+
> console.print(f"[bold blue]Starting server on port {port}[/bold blue]")
|
|
190
|
+
> console.print("[yellow]To access the secret area:[/yellow]")
|
|
191
|
+
> console.print("1. Make 3 POST requests to /knock")
|
|
192
|
+
> console.print("2. Use the returned token in the Authorization header")
|
|
193
|
+
> console.print("3. Make a GET request to /secret with the token")
|
|
194
|
+
> httpd.serve_forever()
|
|
195
|
+
> ```
|
|
196
|
+
>
|
|
197
|
+
> file:///Users/phil/.kodit/clones/https___gist.github.com_cbf0bd1f3338ddf9f98879148d2d752d.git/knock-knock-server.py
|
|
198
|
+
> This code defines a basic HTTP server in Python that responds to POST requests at the "/knock" endpoint. It includes a > class `KnockAuthHandler` that extends `BaseHTTPRequestHandler` to handle incoming requests.
|
|
199
|
+
>
|
|
200
|
+
> Here's a breakdown of the main components:
|
|
201
|
+
>
|
|
202
|
+
> 1. **Imports**: The code imports necessary modules, including `json` for encoding and decoding JSON data, `secrets` for > generating secure random tokens, `BaseHTTPRequestHandler` and `HTTPServer` for creating the HTTP server, and `rich.> console.Console` for formatted console output.
|
|
203
|
+
>
|
|
204
|
+
> 2. **do_POST Method**: This method handles POST requests:
|
|
205
|
+
> - It checks if the request path is "/knock". If so:
|
|
206
|
+
> - It attempts to retrieve a token from the request header using the `_get_token_from_header` method (which is not > defined in the snippet).
|
|
207
|
+
> - If no token is found, a new secure token is created using `secrets.token_urlsafe(16)` and initialized in the > `knock_counts` dictionary with a count of 0.
|
|
208
|
+
> - The count for the token is incremented, and the number of knocks received is printed to the console in green.
|
|
209
|
+
> - A JSON response is constructed that includes a message about the number of knocks received, the token, and how > many knocks remain before a limit (set to 3).
|
|
210
|
+
> - If the request path is anything other than "/knock", it returns a 404 error with a JSON response indicating that the > endpoint was not found.
|
|
211
|
+
>
|
|
212
|
+
> 3. **Response Handling**: The `_set_headers` method is called to set appropriate HTTP headers before sending back the > JSON response.
|
|
213
|
+
>
|
|
214
|
+
> Overall, this snippet sets up a simple knocking authentication system, allowing clients to "knock" by sending POST > requests to a specified endpoint while maintaining a count of knocks per token.
|
|
215
|
+
>
|
|
216
|
+
> ```
|
|
217
|
+
> import json
|
|
218
|
+
> import secrets
|
|
219
|
+
> from http.server import BaseHTTPRequestHandler, HTTPServer
|
|
220
|
+
> from rich.console import Console
|
|
221
|
+
> class KnockAuthHandler(BaseHTTPRequestHandler):
|
|
222
|
+
> def do_POST(self):
|
|
223
|
+
> if self.path == "/knock":
|
|
224
|
+
> token = self._get_token_from_header()
|
|
225
|
+
> if not token:
|
|
226
|
+
> token = secrets.token_urlsafe(16)
|
|
227
|
+
> knock_counts[token] = 0
|
|
228
|
+
>
|
|
229
|
+
> knock_counts[token] += 1
|
|
230
|
+
> console.print(
|
|
231
|
+
> f"[green]Knock {knock_counts[token]} received for token {token}[/green]"
|
|
232
|
+
> )
|
|
233
|
+
>
|
|
234
|
+
> response = {
|
|
235
|
+
> "message": f"Knock {knock_counts[token]} received",
|
|
236
|
+
> "token": token,
|
|
237
|
+
> "knocks_remaining": max(0, 3 - knock_counts[token]),
|
|
238
|
+
> }
|
|
239
|
+
>
|
|
240
|
+
> self._set_headers()
|
|
241
|
+
> self.wfile.write(json.dumps(response).encode())
|
|
242
|
+
> else:
|
|
243
|
+
> self._set_headers(404)
|
|
244
|
+
> self.wfile.write(json.dumps({"error": "Not found"}).encode())
|
|
245
|
+
> ```
|
|
246
|
+
>
|
|
247
|
+
> file:///Users/phil/.kodit/clones/https___gist.github.com_cbf0bd1f3338ddf9f98879148d2d752d.git/knock-knock-server.py
|
|
248
|
+
> This code snippet defines a simple HTTP server using Python's `http.server` module and a custom request handler named > `KnockAuthHandler`.
|
|
249
|
+
>
|
|
250
|
+
> Here's a breakdown of the functionality:
|
|
251
|
+
>
|
|
252
|
+
> - The server listens for GET requests.
|
|
253
|
+
> - When a request is made to the path `/secret`, it checks for a token in the request headers.
|
|
254
|
+
> - The token is validated against a `knock_counts` dictionary, which tracks the number of times the token has been > "knocked" (i.e., how many requests have been made).
|
|
255
|
+
> - If the provided token is not present or if the knock count is less than 3, it responds with a 401 Unauthorized error > along with a message indicating that three knocks are required.
|
|
256
|
+
> - If the token is valid and the count is at least 3, it responds with a 200 status and welcomes the user to the secret > area, revealing a hidden message.
|
|
257
|
+
> - For any other paths, it returns a 404 Not Found error.
|
|
258
|
+
>
|
|
259
|
+
> Additional features include using JSON for responses and a potential use of the `rich` library for improved console > output (though it is not utilized in this snippet). The `secrets` module is imported but not used in the provided code.
|
|
260
|
+
>
|
|
261
|
+
> ```
|
|
262
|
+
> import json
|
|
263
|
+
> import secrets
|
|
264
|
+
> from http.server import BaseHTTPRequestHandler, HTTPServer
|
|
265
|
+
> from rich.console import Console
|
|
266
|
+
> class KnockAuthHandler(BaseHTTPRequestHandler):
|
|
267
|
+
> def do_GET(self):
|
|
268
|
+
> if self.path == "/secret":
|
|
269
|
+
> token = self._get_token_from_header()
|
|
270
|
+
> if not token or knock_counts.get(token, 0) < 3:
|
|
271
|
+
> self._set_headers(401)
|
|
272
|
+
> self.wfile.write(
|
|
273
|
+
> json.dumps(
|
|
274
|
+
> {
|
|
275
|
+
> "error": "Unauthorized",
|
|
276
|
+
> "message": "You need to knock three times first!",
|
|
277
|
+
> }
|
|
278
|
+
> ).encode()
|
|
279
|
+
> )
|
|
280
|
+
> return
|
|
281
|
+
>
|
|
282
|
+
> self._set_headers()
|
|
283
|
+
> self.wfile.write(
|
|
284
|
+
> json.dumps(
|
|
285
|
+
> {
|
|
286
|
+
> "message": "Welcome to the secret area!",
|
|
287
|
+
> "secret": "The answer is 42",
|
|
288
|
+
> }
|
|
289
|
+
> ).encode()
|
|
290
|
+
> )
|
|
291
|
+
> else:
|
|
292
|
+
> self._set_headers(404)
|
|
293
|
+
> self.wfile.write(json.dumps({"error": "Not found"}).encode())
|
|
294
|
+
> ```
|
|
295
|
+
>
|
|
296
|
+
> file:///Users/phil/.kodit/clones/https___gist.github.com_cbf0bd1f3338ddf9f98879148d2d752d.git/knock-knock-server.py
|
|
297
|
+
> This code snippet imports necessary libraries and defines a class `KnockAuthHandler`, which extends > `BaseHTTPRequestHandler` from the `http.server` module. The class includes a method `_set_headers` that sets the HTTP > response status code (defaulting to 200) and specifies the content type of the response as "application/json". This > method prepares the server to send a JSON response for HTTP requests.
|
|
298
|
+
>
|
|
299
|
+
> The other imported modules, `json` and `secrets`, suggest that the class may be working with JSON data and generating > secure tokens or identifiers, although the snippet does not currently use them. The `rich.console` import indicates that > the script may eventually use the Rich library for enhanced console output, though it is not utilized in the provided > code.
|
|
300
|
+
>
|
|
301
|
+
> ```
|
|
302
|
+
> import json
|
|
303
|
+
> import secrets
|
|
304
|
+
> from http.server import BaseHTTPRequestHandler, HTTPServer
|
|
305
|
+
> from rich.console import Console
|
|
306
|
+
> class KnockAuthHandler(BaseHTTPRequestHandler):
|
|
307
|
+
> def _set_headers(self, status_code=200):
|
|
308
|
+
> self.send_response(status_code)
|
|
309
|
+
> self.send_header("Content-type", "application/json")
|
|
310
|
+
> self.end_headers()
|
|
311
|
+
> ```
|
|
312
|
+
>
|
|
313
|
+
> file:///Users/phil/.kodit/clones/https___gist.github.com_cbf0bd1f3338ddf9f98879148d2d752d.git/knock-knock-server.py
|
|
314
|
+
> The provided code snippet is a Python definition of a class `KnockAuthHandler` that extends `BaseHTTPRequestHandler` from > the `http.server` module. This class is designed to handle HTTP requests, specifically for authentication purposes.
|
|
315
|
+
>
|
|
316
|
+
> In this class:
|
|
317
|
+
>
|
|
318
|
+
> - The method `_get_token_from_header` retrieves the "Authorization" header from the HTTP request.
|
|
319
|
+
> - It checks if the header starts with the prefix "Bearer " and, if so, splits the string to extract the token part (the > portion after "Bearer ").
|
|
320
|
+
> - If the "Authorization" header does not contain a valid Bearer token, the method returns an empty string.
|
|
321
|
+
>
|
|
322
|
+
> The use of `json`, `secrets`, and `rich.console.Console` indicates that there may be additional functionality related to > JSON handling, secure random number generation, and enhanced console output, respectively, though these elements are not > utilized in the provided snippet.
|
|
323
|
+
>
|
|
324
|
+
> ```
|
|
325
|
+
> import json
|
|
326
|
+
> import secrets
|
|
327
|
+
> from http.server import BaseHTTPRequestHandler, HTTPServer
|
|
328
|
+
> from rich.console import Console
|
|
329
|
+
> class KnockAuthHandler(BaseHTTPRequestHandler):
|
|
330
|
+
> def _get_token_from_header(self) -> str:
|
|
331
|
+
> auth_header = self.headers.get("Authorization", "")
|
|
332
|
+
> if auth_header.startswith("Bearer "):
|
|
333
|
+
> return auth_header.split(" ")[1]
|
|
334
|
+
> return ""
|
|
335
|
+
> ```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Getting Started"
|
|
3
|
+
description: Getting started guide for Kodit.
|
|
4
|
+
weight: 1
|
|
5
|
+
next: /kodit/getting-started/installation
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
The following sections show you how to get started with Kodit:
|
|
9
|
+
|
|
10
|
+
<!--more-->
|
|
11
|
+
|
|
12
|
+
{{< default-section-cards-list >}}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Installing Kodit
|
|
3
|
+
description: How to install Kodit.
|
|
4
|
+
weight: 1
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Kodit is a Python CLI application that can be installed locally or remotely. To install choose the path that is most appropriate for your setup. Most users start by experimenting with Kodit locally and progress to installing it remotely on a server.
|
|
8
|
+
|
|
9
|
+
## homebrew
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
brew install helixml/kodit/kodit
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## uv
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
uv tool install kodit
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## pipx
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
pipx install kodit
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Docker
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
docker run -it --rm registry.helix.ml/helix/kodit:latest
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Always replace latest with a specific version.
|
|
34
|
+
|
|
35
|
+
## pip
|
|
36
|
+
|
|
37
|
+
Use this if you want to use kodit as a python library:
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
pip install kodit
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
(Requires Python 3.12+)
|